void main() {
print("done");
}
Doesn't work for me.
They're identical except for the
bits.Code:void main() { print("done"); }
Where is the .txt file supposed to go? Currently it's in my scripts folder. I'm using a Mac, any possible problems there? The .txt file has been saved in TextWrangler, if that makes a difference. I've tried calling the script both from the gCLI and from the Scripts menu, neither work.
I don't know anything about TextWrangler, but if it formats text, then that's your problem.Where is the .txt file supposed to go? Currently it's in my scripts folder. I'm using a Mac, any possible problems there? The .txt file has been saved in TextWrangler, if that makes a difference.
club necklace t
diamond necklace t
heart necklace t
spade necklace t
club necklace 0
diamond necklace 3
heart necklace -2
spade necklace 0
You're asking how to get that information into your datafile, not how to make the script do it.
void main() {
string [item] list;
file_to_map("displaycase.txt", list, amount);
foreach key in list
if(item_amount(key)>0)
put_display( item_amount(amount), key);
print("done");
}
foreach key in $items[]
if(display_amount(key)>0) collect [key] = -1;
record display_case_items {
string item_name;
};
display_case_items[item] DC;
string [item] DC;
void main() {
string [item] list;
file_to_map("DC Data.txt", list);
print("Putting...");
foreach key in list
if(item_amount(key)>0)
print(""+key, "blue");
print("... into display case");
file_to_map("DC Data.txt", list);
foreach key in list
if(item_amount(key)>0)
put_display( item_amount(key), key);
print("DC updated", "green");
}
int [item] collect;
foreach key in $items[]
if(display_amount(key)>0) collect [key] = -1;
foreach key in collect {
if(map_to_file(collect, "DC Data.txt") == false) print("Your DC data failed to save.", "Red");
}
void main(){
int [item] dc;
file_to_map("DC Data.txt", dc);
foreach key in $items[]
if(display_amount(key) > 0)
dc [key] = -1;
foreach key in get_inventory()
if(item_amount(key) > 0){
print("Putting "+item_amount(key)+" "+key+" into display case...", "blue");
put_display(item_amount(key), key);
}
if(map_to_file(dc, "DC Data.txt") == false)
print("Your DC data failed to save.", "red");
print("DC updated", "green");
}