Super Toon
01-24-2016, 11:09 PM
This is my script i trate to make a Hive - Antenna tasker and this is the code:
--[[Variables]]--
local ManaPotID = 237 -- ID of mana potion (237 strong mana potion)
local ManaPotCost = 80 -- Cost of each mana potion (80 strong mana potion, 120 great mana potion)
local MinManaPot = 50 -- Mininum mana potion
local MaxManaPot = 400 -- Maximum mana pots to buy
--[[################################################## ######]]--
--[[##########NOTHING BELOW HERE SHOULD BE CHANGED##########]]--
--[[################################################## ######]]--
--[[LABEL MANAGER]]--
displayInformationMessage("Hive Antenna Tasker by pepito")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
--[[RefillPotions]]--
elseif (labelName == "WithdrawCash") then
print("Withdrawing Cash")
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes", "balance"}, 60, 5)
local totalManaCost = math.abs((ManaPotCost*(MaxManaPot-Self.ItemCount(ManaPotID))))
local totalmoneyneeded = (totalManaCost)
wait(100,300)
local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
if (MATHCEIL > 0) then
wait(700,1400)
Self.WithdrawMoney(MATHCEIL)
wait(500,900)
end
Walker.Start()
--[[BuyPotions&Runes]]--
elseif (labelName == "BuyPotions") then
print("Buying Potions")
Walker.Stop()
Self.SayToNpc({"hi", "vial", "yes", "yes", "trade", "magic"}, 65)
wait(900, 1200)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Walker.Start()
registerEventListener(WALKER_SELECTLABEL, 'onWalkerSelectLabel')
function onWalkerSelectLabel(labelName)
elseif labelName == 'CheckSupplies' then
Walker.ConditionalGoto(Self.Cap() < LeaveCap or Self.ItemCount(237) < MinManaPot, 'Refill', 'ContinueHunt')
end
end
And this is the error:
http://www.speedyshare.com/sMYZR/9163bef1/download/hive.png
--[[Variables]]--
local ManaPotID = 237 -- ID of mana potion (237 strong mana potion)
local ManaPotCost = 80 -- Cost of each mana potion (80 strong mana potion, 120 great mana potion)
local MinManaPot = 50 -- Mininum mana potion
local MaxManaPot = 400 -- Maximum mana pots to buy
--[[################################################## ######]]--
--[[##########NOTHING BELOW HERE SHOULD BE CHANGED##########]]--
--[[################################################## ######]]--
--[[LABEL MANAGER]]--
displayInformationMessage("Hive Antenna Tasker by pepito")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
--[[RefillPotions]]--
elseif (labelName == "WithdrawCash") then
print("Withdrawing Cash")
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes", "balance"}, 60, 5)
local totalManaCost = math.abs((ManaPotCost*(MaxManaPot-Self.ItemCount(ManaPotID))))
local totalmoneyneeded = (totalManaCost)
wait(100,300)
local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
if (MATHCEIL > 0) then
wait(700,1400)
Self.WithdrawMoney(MATHCEIL)
wait(500,900)
end
Walker.Start()
--[[BuyPotions&Runes]]--
elseif (labelName == "BuyPotions") then
print("Buying Potions")
Walker.Stop()
Self.SayToNpc({"hi", "vial", "yes", "yes", "trade", "magic"}, 65)
wait(900, 1200)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Self.ShopBuyItemsUpTo(ManaPotID, MaxManaPot)
wait(500,900)
Walker.Start()
registerEventListener(WALKER_SELECTLABEL, 'onWalkerSelectLabel')
function onWalkerSelectLabel(labelName)
elseif labelName == 'CheckSupplies' then
Walker.ConditionalGoto(Self.Cap() < LeaveCap or Self.ItemCount(237) < MinManaPot, 'Refill', 'ContinueHunt')
end
end
And this is the error:
http://www.speedyshare.com/sMYZR/9163bef1/download/hive.png