Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------
- ----- Setup By -----
- ----- jimmyebeat ------
- ---- Version 2.0 ---
- --------------------
- --- Last Update ----
- --- 21.02.2020 ------
- --------------------
- --- Backpacks ---
- local MainBP = "Minotaur Backpack"
- local RingBP = "Grey Backpack"
- local SuppliesBP = "Orange Backpack"
- local LootBag = "Loot Bag"
- --- Ava ---
- local MaxHp = 1000
- local MinHp = 250
- local HpID = 3161
- local HpCost = 45
- --- Mana Potions ---
- local MaxMp = 800
- local MinMp = 250
- local MpID = 'ultimate mana potion'
- local MpCost = 100
- --- SD ---
- local MaxRunes = 50
- local MinRunes = 10
- local RunesID = 3155
- local RunesCost = 108
- --- Cap ---
- local MinCap = 1
- --- Deposit ---
- local RareDP = 0
- local StackDP = 0
- --- Another Options ---
- local UseSoftsBoots = true
- local BootsID = 813
- local AutoResetBp = true
- local HideEquipment = false
- local StaminaLogout = true
- local CloseTibiaAfterFrag = true
- --- Hunting Settings ---
- local RestoreMana = false
- local DropGold = false
- local DropVials = false
- ----------------------------
- --- END OF CONFIGURATION ---
- ----------------------------
- ----------------------------
- --- IF U DONT KNOW HOW TO --
- --- DO NOT EDIT BELOW -----
- ----------------------------
- ----------------------------
- Targeting.Start()
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- print([[Oramond Raid Ava]])
- function onWalkerSelectLabel(labelName)
- if (labelName == "Checker") then
- if (Self.ItemCount(MpID) <= MinMp) or (Self.ItemCount(HpID) <= MinHp) then
- gotoLabel("Leave")
- else
- gotoLabel("StartHunt")
- end
- elseif (labelName == "Bp") then
- Bp_Reset()
- if (HideEquipment) then
- Client.HideEquipment()
- end
- elseif (labelName == "FullCheck") then
- if (Self.ItemCount(MpID) <= MaxMp - 50) or (Self.ItemCount(HpID) <= MaxHp - 10) or (Self.ItemCount(RunesID) <= MaxRunes - 10) then
- Walker.Goto("Resupply")
- else
- Walker.Goto("SkipSupplies")
- end
- elseif (labelName == "CheckStamina") then
- setWalkerEnabled(false)
- if (Self.Stamina() < 900) and (StaminaLogout == true) then
- print([[Low stamina, Closing Tibia]])
- os.exit()
- else
- setWalkerEnabled(true)
- print([[Enough stamina, continue hunt..]])
- end
- elseif (labelName == "WithdrawSofts") then
- print("Withdrawing Soft Boots Money")
- Walker.Stop()
- Self.WithdrawMoney(25000)
- Walker.Start()
- elseif (labelName == "RepairSofts") then
- Walker.Stop()
- Self.SayToNpc({"hi", "soft boots", "yes"}, 65)
- Walker.Start()
- elseif (labelName == "CheckSofts") then
- delayWalker(500)
- if (UseSoftsBoots == true) and (Self.ItemCount(6530) >= 1) then
- gotoLabel("GoSofts")
- else
- gotoLabel("SkipSofts")
- end
- elseif (labelName == "Potions") then
- setWalkerEnabled(false)
- Self.SayToNpc("Hi")
- wait(200)
- Self.SayToNpc("trade")
- wait(500)
- Self.ShopBuyItem(MpID, (MaxMp-Self.ItemCount(MpID)))
- wait(500)
- setWalkerEnabled(true)
- elseif (labelName == "Runes") then
- setWalkerEnabled(false)
- Self.SayToNpc("Hi")
- wait(200)
- Self.SayToNpc("trade")
- wait(500)
- Self.ShopBuyItem(HpID, (MaxHp-Self.ItemCount(HpID)))
- wait(500)
- setWalkerEnabled(true)
- elseif (labelName == "Sell1") then
- setWalkerEnabled(false)
- delayWalker(500)
- Self.SayToNpc("hi")
- sleep(math.random(800, 1700))
- Self.SayToNpc("trade")
- sleep(math.random(2000, 2400))
- Self.ShopSellItem(21170, Self.ShopGetItemSaleCount(21170))
- Self.ShopSellItem(21172, Self.ShopGetItemSaleCount(21172))
- Self.ShopSellItem(21178, Self.ShopGetItemSaleCount(21178))
- Self.ShopSellItem(21168, Self.ShopGetItemSaleCount(21168))
- Self.ShopSellItem(21183, Self.ShopGetItemSaleCount(21183))
- Self.ShopSellItem(21165, Self.ShopGetItemSaleCount(21165))
- Self.ShopSellItem(21179, Self.ShopGetItemSaleCount(21179))
- Self.ShopSellItem(21180, Self.ShopGetItemSaleCount(21180))
- Self.ShopSellItem(21164, Self.ShopGetItemSaleCount(21164))
- Self.ShopSellItem(21167, Self.ShopGetItemSaleCount(21167))
- Self.ShopSellItem(21171, Self.ShopGetItemSaleCount(21171))
- Self.ShopSellItem(21169, Self.ShopGetItemSaleCount(21169))
- sleep(math.random(2000, 2400))
- setWalkerEnabled(true)
- elseif (labelName == "Sell2") then
- setWalkerEnabled(false)
- delayWalker(500)
- Self.SayToNpc("hi")
- sleep(math.random(800, 1700))
- Self.SayToNpc("trade")
- sleep(math.random(2000, 2400))
- Self.ShopSellItem(21196, Self.ShopGetItemSaleCount(21196))
- Self.ShopSellItem(21197, Self.ShopGetItemSaleCount(21197))
- Self.ShopSellItem(21193, Self.ShopGetItemSaleCount(21193))
- sleep(math.random(2000, 2400))
- setWalkerEnabled(true)
- elseif (labelName == "Sell3") then
- setWalkerEnabled(false)
- delayWalker(500)
- Self.SayToNpc("hi")
- sleep(math.random(800, 1700))
- Self.SayToNpc("trade")
- sleep(math.random(2000, 2400))
- Self.ShopSellItem(9057, Self.ShopGetItemSaleCount(9057))
- Self.ShopSellItem(3032, Self.ShopGetItemSaleCount(3032))
- Self.ShopSellItem(3030, Self.ShopGetItemSaleCount(3030))
- Self.ShopSellItem(3028, Self.ShopGetItemSaleCount(3028))
- Self.ShopSellItem(3033, Self.ShopGetItemSaleCount(3033))
- Self.ShopSellItem(16124, Self.ShopGetItemSaleCount(16124))
- Self.ShopSellItem(16120, Self.ShopGetItemSaleCount(16120))
- sleep(math.random(2000, 2400))
- setWalkerEnabled(true)
- end
- end
- ----------------------- Functions ----------------------
- local Bps = {}
- if MainBP then
- table.insert(Bps,MainBP)
- end
- if RingBP then
- table.insert(Bps,RingBP)
- end
- if SuppliesBP then
- table.insert(Bps,SuppliesBP)
- end
- if LootBag then
- table.insert(Bps,LootBag)
- end
- function UseGround(x, y, z)
- wait(200)
- Self.UseItemFromGround(x, y, z)
- wait(500)
- end
- function Door(x, y, z)
- wait(200)
- Self.OpenDoor(x, y, z)
- wait(250)
- end
- function Lever(direction)
- pos = Self.Position()
- if direction == "east" then
- UseGround(pos.x+1, pos.y, pos.z)
- elseif direction == "south" then
- UseGround(pos.x, pos.y+1, pos.z)
- elseif direction == "west" then
- UseGround(pos.x-1, pos.y, pos.z)
- elseif direction == "north" then
- UseGround(pos.x, pos.y-1, pos.z)
- end
- end
- function Door(x, y, z)
- wait(200)
- Self.OpenDoor(x, y, z)
- wait(250)
- end
- function CheckPosition(x, y, z, FalseLabel)
- pos = Self.Position()
- if pos.x == x and pos.y == y and pos.z == z then
- else
- print("Repeat")
- Walker.Goto(FalseLabel)
- end
- end
- function Bp_Reset()
- Walker.Stop()
- local tries = 3
- local n = #Bps
- Self.CloseContainers()
- local allgoodie = false
- wait(600,800)
- Self.OpenMainBackpack()
- wait(600,800)
- local main = Container(0)
- main:Minimize()
- wait(600,1000)
- while tries > 0 and (not allgoodie) do
- for i = 1, n do
- main:OpenChildren(Bps[i])
- wait(600,800)
- local cont = Container(Bps[i])
- cont:Minimize()
- if cont:ID() ~= Item.GetID(Bps[i]) then
- print("Could not find "..Bps[i]..', trying again. Tries left : '..tries)
- allgoodie = false
- break
- else allgoodie = true
- end
- end
- tries = tries-1
- end
- if allgoodie then Walker.Start()
- else print('Could not find all backpacks, stoping walker...')
- end
- end
- function ManaPercent()
- return math.ceil((Self.Mana()/Self.MaxMana()*100))
- end
- Module.New("Mana Restore", function(module)
- if (ManaPercent() < 85) and (#Self.GetTargets(8) == 0) and (Self.ItemCount(MpID) > 0) and RestoreMana then
- setWalkerEnabled(false)
- while (ManaPercent() < 85) and (#Self.GetTargets(8) == 0) and (Self.ItemCount(MpID) > 0) do
- Self.UseItemWithMe(MpID)
- wait(500,700)
- end
- setWalkerEnabled(true)
- end
- module:Delay(500)
- end,RestoreMana)
- Module.New("DropGold", function(module)
- if DropGold and (Self.Cap() <= MinCap + 50) then
- delayWalker(500)
- Self.DropItem(Self.Position().x, Self.Position().y, Self.Position().z, 3031, 100)
- end
- module:Delay(3000)
- end)
- Module.New("Drop vials", function(module)
- if (DropVials) and Self.Cap() < MinCap + 60 then
- Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)
- end
- module:Delay(10000, 15000)
- end)
- Module.New("Sort Supplies", function(module)
- local bp1 = Container(MainBP)
- for i = bp1:ItemCount() -1, 0, -1 do
- local id = bp1:GetItemData(i).id
- if id == MpID or id == HpID or id == RunesID then
- bp1:MoveItemToContainer(i, Container(SuppliesBP):Index())
- wait(600,800)
- end
- end
- module:Delay(800)
- end)
- function BuyItems(item, count)
- wait(900, 1200)
- if (Self.ItemCount(item) < count) then
- Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
- wait(200, 500)
- end
- end
- function SellItems(item) -- item = item ID
- wait(300, 1700)
- Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
- wait(900, 1200)
- end
- Self.ReachDepot = function (tries)
- local tries = tries or 3
- Walker.Stop()
- local DepotIDs = {3497, 3499, 3500}
- local DepotPos = {}
- for i = 1, #DepotIDs do
- local dps = Map.GetUseItems(DepotIDs[i])
- for j = 1, #dps do
- table.insert(DepotPos, dps[j])
- end
- end
- local function gotoDepot()
- local pos = Self.Position()
- print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
- for i = 1, #DepotPos do
- location = DepotPos[i]
- Self.UseItemFromGround(location.x, location.y, location.z)
- wait(1000, 2000)
- if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
- wait(5000, 6000)
- if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
- Walker.Start()
- return true
- end
- else
- print("")
- end
- end
- return false
- end
- repeat
- reachedDP = gotoDepot()
- if reachedDP then
- return true
- end
- tries = tries - 1
- sleep(100)
- print("")
- until tries <= 0
- return false
- end
- if(RestoreMana) then
- Module.Start('Mana Restore')
- end
- Map.GetUseItems = function (id)
- if type(id) == "string" then
- id = Item.GetID(id)
- end
- local pos = Self.Position()
- local store = {}
- for x = -7, 7 do
- for y = -5, 5 do
- if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
- itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- table.insert(store, itemPos)
- end
- end
- end
- return store
- end
- Module.New("Backpacks", function(module)
- if #Container.GetAll() < 3 and (AutoResetBp) then
- Cavebot.Stop()
- Bp_Reset()
- Cavebot.Start()
- end
- module:Delay(5000)
- end)
- local function getSpot(to)
- local cont = Container(to)
- for i=0, cont:ItemCount()-1 do
- if (not Item.isContainer(cont:GetItemData(i).id)) then
- local slot = i
- return slot
- end
- end
- return 0
- end
- GenericTextMessageProxy.New("Unjusted"):OnReceive(function (proxy, message)
- local frag = string.match(message, "Warning! The murder of (.+) was not justified.")
- if frag and (CloseTibiaAfterFrag == true) then
- os.exit()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement