- Joined
- Feb 9, 2017
- RedCents
- 588¢
cannonballdex submitted a resource for the classic Buy.inc. Huzzah!
Read more about this resource...
Read more about this resource...
Last edited by a moderator:
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.
Addresses the issue with the declarations being called in a loop causing error messages when purchasing more than 100 items from a vendor in a macro. - cannonballdex
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}
/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
Vendors loaded with lots of items are taking longer to populate. It's just a matter how long we need to wait.
Timing adjusted to all aspects of the purchase, should be sufficient but not too long.