Code:
dofile("Forgee.lua")
------------------------------------------------------------------------------------------
------- Customize your script ------------------------------------------------------------
------------------------------------------------------------------------------------------
Hard = true -- Set true if you want the hardest version, with more smiths and drones
---BP Setup---
GoldBp = "Golden Backpack" -- Put the name of your backpack for gold
GoldBpID = 2871 -- Put the ID of your backpack for gold
LootBp = "Demon Backpack" -- Put the name of your backpack for loot
LootBpID = 9601 -- Put the ID of your backpack for loot
---Potions & Cap Setup---
--Cap
CapToRefill = 50 -- below this amount bot goes to refill
--Mana
PotsToRefill = 50 -- below this amount bot goes to refill
ManasToBuy = 150 -- Amount of mana potions to buy
pots = 268 -- ID of manapotion (should not be changed)
--Health
HealthPotsID = 236 -- ID of healthpotion you want to buy
HealthPotsPrice = 100 -- Price of healthpotion
HealthPotsToBuy = 25 -- Amount of healthpotions to buy
------------------------------------------------------------------------------------------
------- Do Not Touch Below! :) -----------------------------------------------------------
------------------------------------------------------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "ReopenBps") then
setBotEnabled(false)
closeBackpacks()
wait(1000,2000)
openBackpacks(GoldBpID, LootBpID)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "CheckStatus") then
setBotEnabled(false)
local pots = Self.ItemCount(268)
local cap = Self.Cap()
if(pots <= PotsToRefill or cap <= CapToRefill) then
setBotEnabled(true)
gotoLabel('ToTown')
else
setBotEnabled(true)
gotoLabel('Hunt')
end
elseif (labelName == "DepositGold") then
setBotEnabled(false)
delayWalker(10000)
Self.SayToNpc('hi')
wait(1000,2000)
Self.SayToNpc('deposit all')
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
local GoldToManas = ((ManasToBuy-Self.ItemCount(268))*50)
local GoldToHealth = ((HealthPotsToBuy-Self.ItemCount(HealthPotsID))*HealthPotsPrice)
local GoldToPots = (GoldToManas+GoldToHealth)
Self.SayToNpc("withdraw " .. GoldToPots)
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
Self.SayToNpc('withdraw 500')
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "DepositLoot") then
setBotEnabled(false)
Self.DepositItems({7452, 0}, {7398, 0}, {9657, 0})
setBotEnabled(true)
elseif (labelName == "ReachDepot") then
setBotEnabled(false)
Self.ReachDepot()
setBotEnabled(true)
elseif (labelName == "GoMistrock") then
setBotEnabled(false)
Self.SayToNpc({'hi','mistrock','yes'}, 60)
wait(1500,3000)
setBotEnabled(true)
elseif (labelName == "GoYalahar") then
setBotEnabled(false)
Self.SayToNpc({'hi','yalahar','yes'}, 60)
wait(1500,3000)
setBotEnabled(true)
elseif (labelName == "CheckManas") then
if (Self.ItemCount(pots) <= PotsToRefill) then
setWalkerEnabled(true)
gotoLabel("BuyManas")
else
setWalkerEnabled(true)
gotoLabel("GoHunt")
end
elseif (labelName == "BuyPotions") then
setBotEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItem(268,(ManasToBuy-Self.ItemCount(268)))
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "BuyHealthPotions") then
setBotEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItem(HealthPotsID,(HealthPotsToBuy-Self.ItemCount(HealthPotsID)))
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "LevitateDown") then
setBotEnabled(false)
Self.Cast("exani hur down", 50)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "LevitateUp") then
setBotEnabled(false)
Self.Cast("exani hur up", 50)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "CheckHard") then
delayWalker(3000)
if Hard == true then
gotoLabel("Hard")
else
gotoLabel("Soft")
end
elseif (labelName == "CheckHard2") then
delayWalker(3000)
if Hard == true then
gotoLabel("Hard2")
else
gotoLabel("Soft2")
end
elseif(labelName == "CheckPosition") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32620,31411,2))
if(Self.DistanceFromPosition(32620, 31411, 2) <= 0) then
setBotEnabled(true)
gotoLabel("Continue")
else
wait(1000,2000)
gotoLabel('back')
wait(2000,3000)
setBotEnabled(true)
end
elseif(labelName == "CheckPosition2") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32621,31411,3))
if(Self.DistanceFromPosition(32621, 31411, 3) <= 0) then
setBotEnabled(true)
gotoLabel("Continue2")
else
wait(1000,2000)
gotoLabel('back2')
wait(2000,3000)
setBotEnabled(true)
end
elseif(labelName == "CheckPosition3") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32628,31411,4))
if(Self.DistanceFromPosition(32628, 31411, 4) <= 2) then
setBotEnabled(true)
gotoLabel("Continue3")
else
wait(1000,2000)
gotoLabel('back3')
wait(2000,3000)
setBotEnabled(true)
end
elseif (labelName == "Levitatedown") then
delayWalker(2000)
Self.Cast("exani hur down", 50)
wait(1000,2000)
setTargetingEnabled(false)
elseif (labelName == "Levitateup") then
delayWalker(2000)
Self.Cast("exani hur up", 50)
wait(1000,2000)
setTargetingEnabled(false)
elseif (labelName == "CheckHealthsShop") then
setBotEnabled(false)
if ((Self.ItemCount(HealthPotsID) < HealthPotsToBuy)) then
setBotEnabled(true)
gotoLabel("BuyHealthPotions")
else
setBotEnabled(true)
gotoLabel("GoOn")
end
end
end
All worked before upgrade...