Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---True/False---
- WyvernTower = false ---Set this to 'true' if you can want to hunt Wyverns on the way (80+ Recommended)
- Warlords = false ---Set this to 'true' if you can want to hunt Warlords -1 (90+ Recommended)
- QuestFloor = false ---Set this to 'true' if you can want to hunt at the Quest Floor (3Warlords+Dragon+3OrcLeaders)(120+ Recommended)
- WarlordTower = false ---Set this to 'true' if you can want to hunt at the Warlords at the tower (Warlords+Berserkers+Leaders)(100+ Recommended)
- ---Backpacks---
- MinimizeBPs = true ---Set to 'true' if you want to minimize your backpacks
- MinimizeMain = true ---Set to 'true' if you want to minimize your main backpack
- LootBP = 2867 ---ID of loot items BP
- StackableBP = 2871 ---ID of stackables BP
- GoldBP = 8860 ---ID of gold BP
- SupplyBP = 2865 ---ID of backpack where your supplies will go
- ---Potions--
- maxMana = 150 ---Mana potions you want to take to hunt
- leaveMana = 60 ---Mana potions you want to leave the spawn at
- manaId = 268 ---Mana potions ID
- manaPrice = 50 ---Mana potions price
- maxHealth = 50 ---Health Potion's you want to take to hunt
- leaveHealth = 40 ---Health Potion's you want to leave spawn at
- HealthId = 'Great Health Potion' ---Health Potion ID
- HealthPrice = 190 ---Health Potion price
- ---Supply BP-- ( What will be moved inside your supply backpack)
- SHPID = Item.GetID("Mana potion") ---Name of what's going to go inside that backpack
- GHPID = Item.GetID("Great health potion") ---Name of what's going to go inside that backpack
- ---Other--
- MinCap = 200 ---Set the cap you want your character to leave spawn at
- -----------------------------------------------------------------------------------------------------------------------
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- function onWalkerSelectLabel(LabelName)
- if (LabelName == "Deposit") then
- setWalkerEnabled(false)
- print("Depositing Items...")
- sleep(math.random(500, 1000))
- Self.ReachDepot()
- wait(500, 600)
- Self.DepositItems( -- Backpack 1 Inside Depot <item ID="7395" action="2"/>
- {7395, 0},
- {5907, 0},
- {3063, 0},
- {3391, 0},
- {3369, 0},
- {7397, 0},
- {7394, 0},
- {7400, 0},
- {818, 0},
- {3322, 0},
- {5875, 0},
- {3072, 0},
- {3071, 0},
- {7408, 0},
- {3091, 0}
- )
- Self.DepositItems( -- Backpack 2 Inside Depot
- {5896, 1},
- {5897, 1},
- {5902, 1},
- {10196, 1},
- {10196, 1},
- {3091, 1},
- {11477, 1},
- {11480, 1},
- {11478, 1},
- {11452, 1},
- {10318, 1},
- {11479, 1},
- {18996, 1},
- {18993, 1},
- {18997, 1},
- {11453, 1},
- {3301, 1},
- {3313, 1},
- {3316, 1},
- {3049, 1},
- {3254, 1},
- {3265, 1}
- )
- if Self.Stamina()/60 > 15 then
- setWalkerEnabled(true)
- else
- print("Low Stamina")
- end
- elseif LabelName == ("CheckDp") then
- print("Checking Supplies...")
- if ((Self.ItemCount(HealthId) < leaveHealth)) or ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
- gotoLabel("StartDp")
- else
- print("EnoughSupplies..")
- gotoLabel("GoHunt")
- end
- elseif LabelName == ("CheckWyvern") then
- Walker.Stop()
- if (WyvernTower) == false then
- gotoLabel("AfterWyvern")
- Walker.Start()
- else
- print("Hunting Wyvern Tower")
- Walker.Start()
- end
- elseif LabelName == ("CheckWarlord") then
- Walker.Stop()
- if (Warlords) == false then
- gotoLabel("AfterWarlord")
- Walker.Start()
- else
- print("Hunting Warlords")
- Walker.Start()
- end
- elseif LabelName == ("CheckDown") then
- Walker.Stop()
- if (QuestFloor) == false then
- gotoLabel("AfterDown")
- Walker.Start()
- else
- print("Hunting Quest Floor")
- Walker.Start()
- end
- elseif LabelName == ("CheckWarlordUp") then
- Walker.Stop()
- if (WarlordTower) == false then
- gotoLabel("AfterUp")
- Walker.Start()
- else
- print("Hunting WarlordTower")
- Walker.Start()
- end
- elseif (LabelName == "CheckHunt") then
- print("Checking Supplies...")
- if ((Self.ItemCount(HealthId) < leaveHealth)) or ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) or (Self.ItemCount(6530) >= 1) then
- gotoLabel("Refill")
- else
- print("Enough Supplies to Hunt")
- gotoLabel("StartHunt")
- end
- elseif (LabelName == "Bank") then
- setWalkerEnabled(false)
- print("Withdrawing Money...")
- delayWalker(5000)
- Self.SayToNpc({"Hi","Deposit all", "Yes"}, 65)
- sleep(math.random(800, 1500))
- Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
- sleep(math.random(800, 1500))
- Self.SayToNpc("yes")
- sleep(math.random(800, 1500))
- Self.WithdrawMoney((HealthPrice*(maxHealth-Self.ItemCount(HealthId))))
- sleep(math.random(800, 1500))
- Self.SayToNpc("yes")
- setWalkerEnabled(true)
- elseif (LabelName == "SellItems") then
- setWalkerEnabled(false)
- Self.SayToNpc({"Hi", "Trade"}, 65)
- wait(900, 1200)
- Self.ShopSellItemsDownTo(3269, 0)
- wait(900, 1200)
- setWalkerEnabled(true)
- elseif (LabelName == "BpReset") then
- setWalkerEnabled(false)
- print("Reseting Backpacks...")
- Client.HideEquipment()
- wait(900)
- Self.CloseContainers()
- wait(900,2000)
- Self.OpenMainBackpack(MinimizeMain):OpenChildren({LootBP,MinimizeBPs},{StackableBP,MinimizeBPs},{GoldBP,MinimizeBPs},{SupplyBP,MinimizeBPs})
- setWalkerEnabled(true)
- elseif LabelName == ("Pots") then
- setWalkerEnabled(false)
- print("Buying Supplies...")
- Self.SayToNpc({"hi", "vial", "yes", "vial", "yes", "vial", "yes", "trade"}, 65)
- wait(1000)
- Self.SayToNpc({"vials", "yes", "yes", "yes"}, 65)
- wait(1000)
- if (Self.ItemCount(manaId) < maxMana) then
- Self.ShopBuyItemsUpTo(manaId, maxMana)
- wait(800)
- end
- if (Self.ItemCount(HealthId) < maxHealth) then
- Self.ShopBuyItemsUpTo(HealthId, maxHealth)
- wait(800)
- end
- setWalkerEnabled(true)
- end
- end
- Module.New("MoveManas", function(module)
- if (Self.ItemCount(ManaPotID) >= 1) or (Self.ItemCount(HealthID) >=1) or (Self.ItemCount(SHPID) >=1) or (Self.ItemCount(GHPID) >=1) then
- local MainBp = Container.GetFirst()
- local DestinationBp = Container.GetByName(SupplyBP)
- for spot = 0, MainBp:ItemCount() do
- local item = MainBp:GetItemData(spot)
- if (item.id == ManaPotID) or (item.id == SDID) or (item.id == SHPID) or (item.id == GHPID) then
- MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
- module:Delay(500)
- break
- end
- module:Delay(200)
- end
- end
- end)
- Self.ReachDepot = function(ATTEMPTS)
- --Forgee Library
- local ATTEMPTS = ATTEMPTS or 5
- local DP_IDS = {3497, 3498, 3499, 3500}
- local DP_POSITIONS = {}
- Walker.Stop()
- local function reachDP()
- for i = 1, #DP_IDS do
- for POS_X = -7, 7, 1 do
- for POS_Y = -5, 5, 1 do
- if (Map.GetTopUseItem(Self.Position().x + POS_X, Self.Position().y + POS_Y, Self.Position().z).id == DP_IDS[i]) then
- DP_POSITION = {x = Self.Position().x + POS_X, y = Self.Position().y + POS_Y, z = Self.Position().z}
- table.insert(DP_POSITIONS, DP_POSITION)
- end
- end
- end
- end
- print("XenoBot has found "..#DP_POSITIONS.." depots around you.")
- wait(2000)
- for i = 1, #DP_POSITIONS do
- local LAST_POSITION = Self.Position()
- local BLOCKED = 0
- local COORDINATES = DP_POSITIONS[i]
- for j = CREATURES_LOW, CREATURES_HIGH do
- local CREATURE = Creature.GetFromIndex(j)
- if (CREATURE:isPlayer() and CREATURE:ID() ~= Self.ID() and CREATURE:isOnScreen()) then
- if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[1]) then
- --SOUTH
- if ((CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y-1) or (CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y-2) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y-1, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y-2, COORDINATES.z) == false)) then
- BLOCKED = BLOCKED+1
- end
- end
- if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[2]) then
- --WEST
- if ((CREATURE:Position().x == COORDINATES.x+1 and CREATURE:Position().y == COORDINATES.y) or (CREATURE:Position().x == COORDINATES.x+2 and CREATURE:Position().y == COORDINATES.y) or (Map.IsTileWalkable(COORDINATES.x+1, COORDINATES.y, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x+2, COORDINATES.y, COORDINATES.z) == false)) then
- BLOCKED = BLOCKED+1
- end
- end
- if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[3]) then
- --NORTH
- if ((CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y+1) or (CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y+2) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y+1, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y+2, COORDINATES.z) == false)) then
- BLOCKED = BLOCKED+1
- end
- end
- if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[4]) then
- --EAST
- if ((CREATURE:Position().x == COORDINATES.x-1 and CREATURE:Position().y == COORDINATES.y) or (CREATURE:Position().x == COORDINATES.x-2 and CREATURE:Position().y == COORDINATES.y) or (Map.IsTileWalkable(COORDINATES.x-1, COORDINATES.y, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x-2, COORDINATES.y, COORDINATES.z) == false)) then
- BLOCKED = BLOCKED+1
- end
- end
- end
- end
- if (BLOCKED == 0) then
- print("XenoBot is now trying to reach a free depot.")
- Self.UseItemFromGround(COORDINATES.x, COORDINATES.y, COORDINATES.z)
- wait(2000, 4000)
- if (Self.DistanceFromPosition(LAST_POSITION.x, LAST_POSITION.y, LAST_POSITION.z) >= 1) then
- wait(5000, 10000)
- if (Self.DistanceFromPosition(COORDINATES.x, COORDINATES.y, COORDINATES.z) == 1) then
- print("XenoBot has successfully reached a free depot and will now proceed with following actions.")
- wait(2000)
- return true
- end
- end
- end
- end
- return false
- end
- while (ATTEMPTS > 0) do
- if (reachDP()) then
- return true
- end
- ATTEMPTS = ATTEMPTS-1
- wait(100)
- end
- return false
- end
- function Self.ShopSellItemsDownTo(item, count)
- wait(300, 1700)
- Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
- wait(900, 1200)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement