Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.69 KB | None | 0 0
  1. local MainBP = getuseroption('MainBP')
  2. local AmmoBP = getuseroption('AmmoBP')
  3. local BuyHealth = getuseroption('BuyHealth')
  4. local UseGHP = getuseroption('UseGHP')
  5. local BuyUtHealth = getuseroption('BuyUtHealth')
  6. local SuppDPBP = getuseroption('SuppDPBP')
  7. local TakeSupp = getuseroption('TakeSupp')
  8. local TakeFood = getuseroption('TakeFood')
  9. local ValueFood = getuseroption('ValueFood')
  10.  
  11. setsetting('Looting/OpenNextBP', 'no')
  12.  
  13. while windowcount(MainBP) ~= 1 or windowcount(AmmoBP) ~= 1 or windowcount() ~= 2 do
  14.     closewindows()
  15.     openitem(MainBP, "back")
  16.     wait(200,300)
  17.     resizewindows()
  18.     openitem(AmmoBP, MainBP, true)
  19.     wait(200,300)
  20.     resizewindows()
  21.     wait(200,300)
  22. end
  23.  
  24.  
  25. if TakeSupp then
  26.     if itemcount("ultimate health potion") < BuyUtHealth or (UseGHP and itemcount("great health potion") < BuyHealth) or (TakeFood and itemcount("brown mushroom") < ValueFood) then
  27.         local function freeslots(c)
  28.             local tmp = getcontainer(c)
  29.             return tmp.maxcount - tmp.itemcount
  30.         end
  31.    
  32.         wait(200,300)
  33.         reachgrounditem('depot')
  34.         wait(200,300)
  35.         while windowcount(SuppDPBP) == 0 do
  36.             opendepot()
  37.             wait(200,300)
  38.             openitem(SuppDPBP, "Depot Chest", false)
  39.             wait(200,300)
  40.             resizewindows()
  41.             wait(200,300)
  42.         end
  43.  
  44.         while true do
  45.             waitping(1,2)
  46.             wait(1000,1200)
  47.             while UseGHP and ((itemcount("great health potion", AmmoBP) + itemcount("great health potion", MainBP)) < BuyHealth) and itemcount("great health potion", SuppDPBP) > 0 and (freeslots(MainBP) > 1 or freeslots(AmmoBP) > 0) do
  48.                 waitping(1,2)
  49.                 wait(1000,1200)
  50.                 if freeslots(MainBP) > 1 then
  51.                     moveitems("great health potion", MainBP, SuppDPBP, BuyHealth - (itemcount("great health potion", MainBP) + itemcount("great health potion", AmmoBP)))
  52.                     waitping(1,2)
  53.                 elseif freeslots(AmmoBP) > 0 then
  54.                     moveitems("great health potion", AmmoBP, SuppDPBP, BuyHealth - (itemcount("great health potion", MainBP) + itemcount("great health potion", AmmoBP)))
  55.                     waitping(1,2)
  56.                 end
  57.             end
  58.        
  59.             while (itemcount("ultimate health potion", MainBP) + itemcount("ultimate health potion", AmmoBP)) < BuyUtHealth and itemcount("ultimate health potion", SuppDPBP) > 0 and (freeslots(MainBP) > 1 or freeslots(AmmoBP) > 0) do
  60.                 waitping(1,2)
  61.                 wait(1000,1200)
  62.                 if freeslots(MainBP) > 1 then
  63.                     moveitems("ultimate health potion", MainBP, SuppDPBP, BuyUtHealth - (itemcount("ultimate health potion", MainBP) + itemcount("ultimate health potion", AmmoBP)))
  64.                     waitping(1,2)
  65.                 elseif freeslots(AmmoBP) > 0 then
  66.                     moveitems("ultimate health potion", AmmoBP, SuppDPBP, BuyUtHealth - (itemcount("ultimate health potion", MainBP) + itemcount("ultimate health potion", AmmoBP)))
  67.                     waitping(1,2)
  68.                 end
  69.             end
  70.        
  71.             while TakeFood and (itemcount("brown mushroom") - itemcount("brown mushroom", SuppDPBP) < ValueFood) and itemcount("brown mushroom", SuppDPBP) > 0 and (freeslots(MainBP) > 1 or freeslots(AmmoBP) > 0) do
  72.                 waitping(1,2)
  73.                 wait(1000,1200)
  74.                 if freeslots(MainBP) > 1 then
  75.                     moveitems("brown mushroom", MainBP, SuppDPBP, ValueFood - (itemcount("brown mushroom", MainBP) + itemcount("brown mushroom", AmmoBP)))
  76.                     waitping(1,2)
  77.                 elseif freeslots(AmmoBP) > 0 then
  78.                     moveitems("brown mushroom", AmmoBP, SuppDPBP, ValueFood - (itemcount("brown mushroom", MainBP) + itemcount("brown mushroom", AmmoBP)))
  79.                     waitping(1,2)
  80.                 end
  81.             end
  82.        
  83.             if ((UseGHP and itemcount("great health potion") < BuyHealth) or (TakeFood and itemcount("brown mushroom") < ValueFood) or (itemcount("ultimate health potion") < BuyUtHealth)) and itemcount(SuppDPBP, SuppDPBP) > 0 then
  84.                 openitem(SuppDPBP, SuppDPBP, false)
  85.                 waitping(1,2)
  86.             else
  87.                 break
  88.             end
  89.         end
  90.     end
  91. else
  92.     gotolabel("bank")
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement