its doesnt work
its doesnt work
Hello there! im having some trouble getting this script to work, what am I doing wrong? didnt really understand what to do just paste it into my "hunting script"?
Walker.Stop()
wait(800,1600)
if Map.GetTopUseItem(32190, 32432, 8).id == 1632 then --- checks the id of the locked door
useKeyOnDoor(2968, 32190, 32432, 8) --- opens if locked.
wait(400,600)
Walker.Start()
else
if not Map.IsTileWalkable(32190, 32432, 8) then Self.UseDoor(32190, 32432, 8) --- opens door if unlocked
Walker.Start()
end
Walker.Start() ---- If door is neither locked or closed it'll just go to the next node and walk through it
end
function useKeyOnDoor(keyID, x, y, z) --- from forgee's library
local Cont = Container.New(0) -- check in main backpack (index is 0)
if Cont:CountItemsOfID(keyID) > 0 then
for s = 0, Cont:ItemCount() do --find specific itemid spot
local item = Cont:GetItemData(s)
if item.id == keyID then
Cont:UseItemWithGround(s, x, y, z)
end
end
end
end
Impossible for me to say what you're doing wrong with so little information. You'll have to describe what's not working.
The function should be pasted in the same script but not in the same label. Just put it at the end of the script. Only the first part should trigger at a specific label.
I just get a error message when im trying to make a label in the script, (Error: '<eof>' expected near 'elseif') dont know what im doing wrong, could you help me out? haha
KeyId=2968
x=32190
y=32432
z=8
elseif (labelName == "OpenDoor") then
Walker.Stop()
wait(800,1600)
if Map.GetTopUseItem(32190, 32432, 8).id == LockedID then --- checks the id of the locked door
useKeyOnDoor(2968, 32190, 32432, 8) --- opens if locked.
wait(400,600)
Walker.Start()
else
if not Map.IsTileWalkable(32190, 32432, 8) then Self.UseDoor(32190, 32432, 8) --- opens door if unlocked
Walker.Start()
end
Walker.Start() ---- If door is neither locked or closed it'll just go to the next node and walk through it
end
function useKeyOnDoor(keyID, x, y, z) --- from forgee's library
local Cont = Container.New(0) -- check in main backpack (index is 0)
if Cont:CountItemsOfID(keyID) > 0 then
for s = 0, Cont:ItemCount() do --find specific itemid spot
local item = Cont:GetItemData(s)
if item.id == keyID then
Cont:UseItemWithGround(s, x, y, z)
end
end
end
end
this is what I pasted in my hunting script..
I'm still having trouble understanding what you're pasting where. You shouldn't even be getting that bug if you followed the instructions correctly. Can't really help you with it either since it might be in some other part of the script (eof = end of function).
I'd suggest you read some basic guides on scripting first. None of this is particularly hard if you have the basics under control.
Good guide to start with: http://forums.xenobot.net/showthread...-Script-Making
I think you are copying scripts into wrong place, I think your putting function inside the function and I think that won't work, unsure tho, but what you really are missing is an "end" somewhere...
Post your WHOLE lua here and I can try help you, or if you wish, in private...
Belden's Free Scripts
Belden's Quest Scripts
Bought Lifetime Subscription from Fractal
Bought TeamSpeak 3 Service from Sikkness
Bought Leveling Service from Y2Quakepc2