Removing an item from store

Yes -- all of the xxxx_amount() functions don't hit the server, except shop_amount(), since that number could change at any time.

The script is called StashBot, but it's not public.
 
Nice!

I'd suggest that we don't call shop_amount() in this function, since that hits the server every time, and anyone removing an item from the shop would already pass shop_amount() for i. Instead, flag item_amount(), visit the URL to pull one or all, then return false if you didn't get enough, or put the difference back in if you got too many:
Code:
put_shop(price.to_int(), lim.to_int(), item_amount(it) - target), it);

should this line be (missing open bracket before item_amount)-
Code:
 put_shop(price.to_int(), lim.to_int(), (item_amount(it) - target), it);
?

(using this in my logout script to pull anything that is in my display case from my shop and put in the display case)
edit: or I would if there was a get_display() function


best regards
Dave
 
Last edited:
Back
Top