Advertisement
Guest User

xitoo1

a guest
Jul 3rd, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.61 KB | None | 0 0
  1.  
  2.  
  3.  
  4. --BP SETUP--
  5. local MainBp  = "Jewelled Backpack" ----- Main Backpack
  6. local LootBp  = "Blue backpack" ---- Backpack to put loot in
  7. local GoldBp  = "Backpack" ------ Backpack to put gold in
  8. local ManaBp  = "Golden backpack" ------ Backpack to put manas in
  9. --(info: all the bps should be different (individual) colours)
  10.  
  11. --[[
  12. Depot SETUP (Have 2 backpacks in your depot, filled with backpacks)
  13. BP1 = Rares
  14. BP2 = Stackables
  15. --]]
  16.  
  17.  
  18. --[[Variables]]--
  19. local MinCap = 50 -- Mininum cap
  20. local ManaPotID = 268 -- ID of mana potion
  21. local ManaPotCost = 50 -- Cost of each mana potion
  22. local MinManaPot = 100 -- Mininum mana potion
  23. local MaxManaPot = 500 -- Maximum mana pots to buy
  24. local HealthPotID = 239 -- ID of health potion (strong = 236, great = 239)
  25. local MinHealthPot = 40 -- Minimum health potion
  26. local MaxHealthPot = 70 -- Maximum health potions to buy
  27. local HealthPotCost = 190 -- Cost of each mana potion
  28.  
  29.  
  30. --[[########################################################]]--
  31. --[[##########NOTHING BELOW HERE SHOULD BE CHANGED##########]]--
  32. --[[########################################################]]--
  33.  
  34. --[[LABEL MANAGER]]--
  35. displayInformationMessage("FRAZZIE DOMINANDO")
  36. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  37.  
  38. function onWalkerSelectLabel(labelName)
  39.    
  40.     if (labelName == "Start") then
  41.         Targeting.Start()
  42.         Looter.Start()
  43.         Walker.Start()
  44.         end
  45.         end
  46.  
  47. --[[Open Backpacks]]-- 
  48.        elseif (labelName == "OpenBP") then
  49.         print("Opening Backpacks") 
  50.             setWalkerEnabled(false)
  51.             Self.CloseContainers()
  52.             Self.OpenMainBackpack(true):OpenChildren({LootBp, true}, {GoldBp, true}, {ManaBp, true})
  53.             setWalkerEnabled(true)
  54.  
  55.             elseif (labelName == "CheckBP") then
  56.         print("Checking Backpacks")
  57.         if #Container.GetAll() == 4 then
  58.         Walker.Goto("BPsOK")
  59.         else
  60.         Walker.Goto("OpenBP")  
  61.         end
  62.         setWalkerEnabled(true)             
  63.    
  64.     elseif (labelName == "CheckBP") then
  65.         print("Checking Backpacks")
  66.         if #Container.GetAll() == 4 then
  67.         Walker.Goto("BPsOK")
  68.         else
  69.         Walker.Goto("OpenBP")  
  70.         end
  71.         setWalkerEnabled(true)
  72.          --[DepositItems]]--
  73.    
  74.     elseif (labelName == "Deposit") then
  75.         print("Depositing Items")  
  76.         Walker.Stop()
  77.         Self.ReachDepo()
  78.         Self.DepositItems({8027, 0}, {8043, 0})        
  79.         Self.DepositItems({9665, 1}, {3028, 1})
  80.         Walker.Start()
  81.         --[DepositGold]]--
  82.     elseif (labelName == "DepositGold") then
  83.         print("Depositing Gold")   
  84.         setWalkerEnabled(false)        
  85.         Self.SayToNpc("Hi")
  86.         sleep(math.random(700, 1400))
  87.         Self.SayToNpc("Deposit all")
  88.         sleep(math.random(700, 1400))
  89.         Self.SayToNpc("Yes")
  90.         sleep(math.random(700, 1400))      
  91.         Self.SayToNpc("Balance")
  92.         setWalkerEnabled(true)
  93.        
  94.         elseif  (labelName == "Potchecker") then
  95.         if ((Self.ItemCount(ManaPotID) < MaxManaPot) or (Self.ItemCount(HealthPotID) <= MinHealthPot)) then
  96.             gotoLabel("BuyPotions")
  97.     end
  98.    
  99.     elseif (labelName == "Minimize") then
  100.             setWalkerEnabled(false)
  101.             Client.HideEquipment()
  102.             wait(500, 1400)
  103.             for x = 0, #Container.GetIndexes() - 1 do
  104.                 local bp = Container.GetFromIndex(x)
  105.                 bp:Minimize()
  106.                 wait(200, 400)
  107.                
  108.                 --[[RefillPotions]]--
  109.     elseif (labelName == "WithdrawCash") then
  110.     print("Withdrawing Cash")  
  111.     Walker.Stop()
  112.         Self.SayToNpc({"hi", "deposit all", "yes", "balance"}, 60, 5)
  113.         local totalManaCost = math.abs((ManaPotCost*(MaxManaPot-Self.ItemCount(ManaPotID))))
  114.         local totalHealthCost = math.abs((HealthPotCost*(MaxHealthPot-Self.ItemCount(HealthPotID))))   
  115.         local boatMoney = 2000
  116.         local totalmoneyneeded = (totalManaCost + totalHealthCost + boatMoney)
  117.             wait(100,300)
  118.             local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
  119.             if (MATHCEIL > 0) then         
  120.             wait(700,1400)
  121.             Self.WithdrawMoney(MATHCEIL)
  122.             wait(500,900)
  123.             end
  124.             Walker.Start()
  125.            
  126.             --[[BuyPotions]]--
  127.     elseif (labelName == "BuyPotions") then
  128.     print("Buying Potions")    
  129.     Walker.Stop()
  130.         Self.SayToNpc({"hi", "trade"}, 65)
  131.         wait(900, 1200)
  132.         Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
  133.         wait(500,900)  
  134.         Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
  135.         wait(500,900)
  136.         Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
  137.         wait(500,900)      
  138.         Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
  139.         wait(500,900)      
  140.         Self.ShopBuyItemsUpTo(HealthPotID, MaxHealthPot)
  141.         wait(500,900)      
  142.         Self.ShopBuyItemsUpTo(HealthPotID, MaxHealthPot)           
  143.     Walker.Start()
  144.    
  145.     elseif (labelName == "CheckGo") then
  146.     if (Self.ItemCount(3549) == 1) then
  147.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Active" )    
  148.     else
  149.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Not found" )
  150.     end
  151.     delayWalker(1000)
  152.         if ((Self.ItemCount(ManaPotID) < MaxManaPot) or (Self.Cap() <= MinCap) or (Self.ItemCount(HealthPotID) < MaxHealthPot)) then
  153.             gotoLabel("Start")
  154.     end
  155.    
  156.  
  157.     elseif (labelName == "Check1") then
  158.     if (Self.ItemCount(3549) == 1) then
  159.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Active" )    
  160.     else
  161.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Not found" )
  162.     end
  163.     delayWalker(1000)
  164.         if ((Self.ItemCount(ManaPotID) <= MinManaPot) or (Self.Cap() <= MinCap)  or (Self.ItemCount(HealthPotID) <= MinHealthPot)) then
  165.             gotoLabel("Leave")
  166.     end
  167.    
  168.     elseif (labelName == "Check2") then
  169.     if (Self.ItemCount(3549) == 1) then
  170.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Active" )    
  171.     else
  172.         print("Current Mana Potions: " .. Self.ItemCount(ManaPotID) .. " / " ..  MaxManaPot .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthPotID) .. " / " ..  MaxHealthPot ..  "\nSoft Boots" .. " = " ..  "Not found" )
  173.     end
  174.     delayWalker(1000)
  175.         if ((Self.ItemCount(ManaPotID) <= MinManaPot) or (Self.Cap() <= MinCap)  or (Self.ItemCount(HealthPotID) <= MinHealthPot)) then
  176.             gotoLabel("Leave")
  177.             else
  178.             gotoLabel("StartHunt")
  179.            
  180.             --[[DepotChooser]]--
  181.     Self.ReachDepo = function (attempt)
  182.     local attempt = attempt or 4
  183.     Walker.Stop()
  184.     local DepotIDs = {3497, 3498, 3499, 3500}
  185.     local DepotPos = {}
  186.     for i = 1, #DepotIDs do
  187.         local dps = Map.GetUseItems(DepotIDs[i])
  188.         for d = 1, #dps do
  189.             table.insert(DepotPos, dps[d])
  190.         end
  191.     end
  192.     local function gotoDepot()
  193.         local pos = Self.Position()
  194.         for i = 1, #DepotPos do
  195.             location = DepotPos[i]
  196.             Self.UseItemFromGround(location.x, location.y, location.z)
  197.             wait(1000, 2000)
  198.             if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  199.                 wait(5000, 6000)
  200.                 if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  201.                     Walker.Start()
  202.                     return true
  203.                 end
  204.             else
  205.                 print("There is something blocking the path.")
  206.             end
  207.         end
  208.         return false
  209.     end
  210.     repeat
  211.         reachedDP = gotoDepot()
  212.         if reachedDP then
  213.             return true
  214.         end
  215.         attempt = attempt - 1
  216.         sleep(100)
  217.         print("Attempt to reach depot was unsuccessfull. " .. attempt .. " attempts left.")
  218.     until attempt <= 0
  219.     return false
  220. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement