Quote Originally Posted by artichunter123 View Post
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