
Originally Posted by
deonsosa
Well I decided to start my first script. and everything was going good till I tried to run my script xd.
when I tried to run it i received this error
22:38 XenoScript Error:
Script: Hive 1.0.lua
Line #: 78
Chunk: C:\Users\Jorge E\Documents\XenoBot\Scripts\Hive 1.0.lua
Error: 'end' expected (to close 'function' at line 35) near '<eof>'
This is an error with user-input and should not be reported as a bug with XenoBot.
Here try this I fixed a few things and cleaned up:
lua code:------ REFILL SETTINGS ------
local MinMana = 100 --- How many mana potions until you leave the hunt.
local MaxMana = 600 --- How many mana potions you begin the hunt with.
local MinHealth = 20 --- How many health potions until you leave the hunt.
local MaxHealth = 50 --- How many health potions you begin the hunt with.
--------- HUNT SETTINGS ---------
local GoldBP = 8860 --- Item ID of your gold backpack.
local MinCap = 100 --- Leaves spawn when character reaches this cap.
--------- EXTRA SETTINGS --------
LogoutStamina = true --- Do you want to logout at 16 hours? (Inside the depot)
--- DON'T CHANGE ANYTHING BELOW THIS LINE ---
registerEventListener(WALKER_SELECTLABEL, "SelectLabel")
function SelectLabel(Label)
---------------------------------------------------------------------------
if (Label == "checkPotions") then
if (Self.Cap() > MinCap and Self.ItemCount(ManaId) > MinMana) then
gotoLabel("Hunt")
end
---------------------------------------------------------------------------
elseif (Label == "checkPotions2") then
if (Self.ItemCount(ManaId) < MaxMana) then
gotoLabel("Bank")
end
print("Current Manas: " .. Self.ItemCount(ManaId) .. " / " .. MaxMana)
---------------------------------------------------------------------------
elseif (Label == "depositGold") then
local amount = (MaxMana-Self.ItemCount(ManaId))*ManaPrice
setWalkerEnabled(false)
Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
wait(1000, 2000)
if (amount > 0) then
Self.SayToNpc({"withdraw " .. amount, "yes", "balance"}, 65)
wait(1500, 3000)
end
setWalkerEnabled(true)
---------------------------------------------------------------------------
elseif (Label == "buyManas") then
setWalkerEnabled(false)
Self.SayToNpc({"hi", "vial", "yes", "magic"}, 65)
if (Self.ItemCount(ManaId) < MaxMana) then
wait(1500, 3000)
Self.ShopBuyItemsUpTo(ManaId, MaxMana)
end
wait(1000, 2000)
setWalkerEnabled(true)
---------------------------------------------------------------------------
elseif (Label == "depot") then
Self.DepositItems(
14083,
14225,
3010,
14080,
14081,
238,
14076,
3027,
14079,
9057,
3032,
{3279, 1},
{8084, 1},
{14087, 1},
{14089, 1},
{3326, 1},
{14088, 1}
)
if (LogoutStamina and Self.Stamina() < 960) then
setBotEnabledfalse()
end
---------------------------------------------------------------------------
elseif (Label == "resetbp") then
setWalkerEnabledfalse()
Container.Close(GoldBP)
wait(500, 1000)
Container.GetFirst():OpenChildren(GoldBP)
wait(300, 600)
Container.Minimize(GoldBP)
wait(400, 800)
setWalkerEnabledtrue()
end
end