Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub BuyItem(string ItemToBuy, int amount)
/if (${FindItemCount[${ItemToBuy}]}>= ${amount}) /return
/declare i int local
/declare QTY int local
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
/declare ListItem int local ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]}
/declare count int local ${FindItemCount[${ItemToBuy}]}
/if (!${ListItem}) {
/echo couldn't find ${ItemToBuy}
/return
} else {
/notify MerchantWnd ItemList listselect ${ListItem}
/delay 5
}
/echo Buying ${ItemToBuy} Till I get ${amount}
:BuyLoop
/while (${QTY}>0) {
/varset count ${FindItemCount[${ItemToBuy}]}
/if (${QTY}>999) {
/buyitem 1000
/delay 3 ${FindItemCount[${ItemToBuy}]} > ${count}
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
} else /if (${QTY}>0 && ${QTY}<1000) {
/buyitem ${QTY}
/delay 5 ${FindItemCount[${ItemToBuy}]} > ${count}
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
}
/if (${FindItemCount[${ItemToBuy}]}>${count}) /echo \ar${FindItemCount[${ItemToBuy}]}\aw/\ar${amount}\awx\ap${ItemToBuy} \at${Math.Calc[${FindItemCount[${ItemToBuy}]}/${amount}*100]}\aw% Done.
}
/while (${Window[MerchantWnd].Open}) {
/cleanup
/delay 5
}
/return
I dont know if im doing something wrong but i /mac buystuff Redwine 20000 (because i have 20 empty inventory slots for a stack of 1000 red wine) and it says "you already have 2100 Red Wine" and ends. I dont want only 2100 lol.
This assumes the "amount" input on the /call is the total you want on your person, not the total you want to buy.