Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not islocation(2) then
- gotolabel("ToMana", $wptsection)
- else
- local SUPPLIES = {
- {NAME = "great mana potion", AMOUNT = getuseroption("MpToBuy")},
- }
- while (windowcount(SuppBP["name"]) == 0) do
- closewindows()
- waitping()
- openitem(MainBP["name"], 'back')
- waitping()
- openitem(SuppBP["name"], MainBP["name"], true)
- waitping()
- end
- opentrade()
- waitping()
- sellflasks()
- for _, SUP in ipairs(SUPPLIES) do
- local TOTAL = (SUP.AMOUNT - itemcount(SUP.NAME))/100
- for I=1, TOTAL do
- buyitems(SUP.NAME, SUP.AMOUNT)
- waitping()
- moveitems(SUP.NAME, SuppBP["name"], MainBP["name"], 100)
- waitping()
- TOTAL = TOTAL - 100
- end
- if (itemcount(SUP.NAME) < SUP.AMOUNT) then
- buyitems(SUP.NAME, SUP.AMOUNT - itemcount(SUP.NAME))
- waitping()
- end
- while (itemcount(SUP.NAME, MainBP["name"]) > 0) and (getcontainer(SuppBP["name"]).itemcount < getcontainer(SuppBP["name"]).maxcount) do
- moveitems(SUP.NAME, SuppBP["name"], MainBP["name"], 100)
- waitping()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement