Log in

View Full Version : Buy items up to xx ammount



Joe
06-10-2012, 04:21 PM
Hi, I've been wondering how to make bot to buy certain item up to the ammount of XX?
Is there a function that buys items up to certain ammount?

Flappy Joe
06-10-2012, 04:36 PM
Self.ShopBuyItem("Mana Potion", (500-Self.ItemCount("Mana Potion")))


The 500 is the amount it will buy up to.

Self.ItemCount will count the amount you already have in your backpack, so if you have 250 mana potions in your backpack it will buy 250.

Joe
06-10-2012, 04:47 PM
Thanks for the code!
Got two more questions about this. Would it work if I placed mana potion id (without ""s) instead of "mana potion"?
Do items need to be written with capital letters?

Infernal Bolt
06-13-2012, 05:22 AM
Thanks for the code!
Got two more questions about this. Would it work if I placed mana potion id (without ""s) instead of "mana potion"?
Do items need to be written with capital letters?

The id would work just fine.