PDA

View Full Version : please help im new in lua scripting



painless2
07-28-2012, 02:35 AM
hello i tried make script but when i wanna executa he gimme errormessage:
XenoScript Error:
Script: Dara Rots Refiller.Lua
Line #: 453
Chunk: J:?Programme?XenoBot?Data?XenoLuaLib.lua
Error: attempt to index global 'Container' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.


and please if someone can fix it please add to make spears in hand after buying them that whould be rlly nice :S
heres the script:



--[[

MinCap = 10 --
SpearsToLeave = 1 --
SpearID = 3277 --
WantedSpears = 12 --
---------------------------------------------------------------------
-----------------------------------------------------------------------
---------------------------------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
dofile("Forgee.lua")
function onWalkerSelectLabel(labelName)
if (labelName == "Check") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.Cap() < 10) or ((Self.ItemCount(3277) < 1)) then
gotoLabel("Gobank")
setWalkerEnabled(true)
else
gotoLabel("Start")
setWalkerEnabled(true)
end
elseif (labelName == "Bank") then
setWalkerEnabled(false)
delayWalker(5000) --a
Self.Say("hi")
sleep(math.random(700, 1400)) --b
Self.SayToNpc("deposit all")
sleep(math.random(400, 1000))
Self.SayToNpc("yes")
wait(15000,19000)
setWalkerEnabled(true)
elseif (labelName == "Loot") then
Self.DepositItems({10275,1},{9692,1})
elseif (labelName == "BuySpears") then
setWalkerEnabled(false)
delayWalker(7000) --h
Self.Say("hi")
sleep(math.random(800, 1700)) --i
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --j
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(3277, (12-Self.ItemCount(3277)))
setWalkerEnabled(true)
elseif (labelName == "backpacks") then
setWalkerEnabled(false)
resetBackpacks()
wait(1500,1900)
setWalkerEnabled(true)
end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end
]]--

Kim
08-05-2012, 03:56 PM
I'm having the same problem using scripts that are running well on other people, I don't know how to fix it, I've tried everything and I also see that there are loads of people who are having this issues too.

Tibtrak
08-05-2012, 04:17 PM
Kim The error posted by painless2, is not the same as the one Smeekarn and you have posted about earlier. In the errormessage here you can see what is wrong and at what line in the .lua its located, and nobody would have been able to run the script he posted here. Unlike the one you have posted about before where several ppl can run the scripts and there is no error message saying whats wrong.

I still dont know what it is that is causing your problem ;/

Kim
08-05-2012, 04:35 PM
Tibtrak You are right, I think I was just nervous about this problem and I see it everywhere hehe. I wish we can fix it ASAP ;)

Kim
08-05-2012, 05:20 PM
http://forums.xenobot.net/showthread.php?4543-XenoScript-No-such-file-or-directory


Just changed the dofile "SyntaxLuaLab.lua" for "Forgee.lua" and all the scripts are working smoothly perfect!

Tibtrak
08-05-2012, 06:48 PM
Alright Kim, thats great! I told Smeekarn in the other thread to do that, but he said it didn't make a difference. Obviously it worked for you, thats good;)