Quote Originally Posted by Aristeus View Post
You also need to put in the coordinates for the door (x, y, z) in the appropriate places but don't touch anything in the function "useKeyOnDoor"

Also, you don't need to have this in a separate script just put it in the same script you're using to hunt.
Paste the second section at the end of the file and the first under the lablename that you've chosen to open the door with.

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