Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. if not islocation(2) then
  2.    gotolabel("ToMana", $wptsection)
  3. else
  4.     local SUPPLIES = {
  5.         {NAME = "great mana potion", AMOUNT = getuseroption("MpToBuy")},
  6.     }
  7.  
  8. while (windowcount(SuppBP["name"]) == 0) do
  9.     closewindows()
  10.     waitping()
  11.     openitem(MainBP["name"], 'back')
  12.     waitping()
  13.     openitem(SuppBP["name"], MainBP["name"], true)
  14.     waitping()
  15. end
  16.     opentrade()
  17.     waitping()
  18.     sellflasks()
  19.  
  20.     for _, SUP in ipairs(SUPPLIES) do
  21.         local TOTAL = (SUP.AMOUNT - itemcount(SUP.NAME))/100
  22.  
  23.         for I=1, TOTAL do
  24.             buyitems(SUP.NAME, SUP.AMOUNT)
  25.             waitping()
  26.             moveitems(SUP.NAME, SuppBP["name"], MainBP["name"], 100)
  27.             waitping()
  28.             TOTAL = TOTAL - 100
  29.         end
  30.  
  31.         if (itemcount(SUP.NAME) < SUP.AMOUNT) then
  32.             buyitems(SUP.NAME, SUP.AMOUNT - itemcount(SUP.NAME))
  33.             waitping()
  34.         end
  35.  
  36.         while (itemcount(SUP.NAME, MainBP["name"]) > 0) and (getcontainer(SuppBP["name"]).itemcount < getcontainer(SuppBP["name"]).maxcount) do
  37.             moveitems(SUP.NAME, SuppBP["name"], MainBP["name"], 100)
  38.             waitping()
  39.         end
  40.     end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement