PDA

View Full Version : Forgee's openDoor(direction, keyid) help please!



noundies
10-01-2012, 06:50 AM
So i have the library. and get this error. is this not intended for one-liners?

http://i304.photobucket.com/albums/nn192/CyrePanda/helpxeno.png

Mega
10-01-2012, 07:37 AM
So i have the library. and get this error. is this not intended for one-liners?

http://i304.photobucket.com/albums/nn192/CyrePanda/helpxeno.png

Start the one line script with this

dofile("Forgee.lua") openDoor(SOUTH, 3033)

rAgeQuit
10-01-2012, 08:42 AM
Why would he do that? That will load forgee.lua everytime he comes to that script so it will eat his memory to shit?

Add the dofile("forgee.lua") to the first line in your .lua instead.

noundies
10-01-2012, 09:57 AM
http://i304.photobucket.com/albums/nn192/CyrePanda/xenohelp2.png


dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Door 2") then
gotoLabel("Open Door 2")
end
end

this error now. this is my .lua with the error i get.

sorry im not great with this kinda stuff. i've been looking at other peoples scripts trying to figure it out tho.

thanks for your time.

Forgee
10-01-2012, 10:05 AM
You are using a one-liner, so there is no other way to use a library than to load it every time the script runs. If you want to use a library properly, you will have to use the old label system, and call the function from the lua file.

dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Door 2") then
openDoor(SOUTH, 3033)
end
end

Make sure the labels are correct (I didn't :p).

noundies
10-01-2012, 10:08 AM
right before you posted, I made that exact stame script haha. but now it tells me,

03:07 GetSpotByID: Item of id 3033 could not be found in any open container.
03:07 OpenDoor: Could not find key 3033.

but the key is in BP#1

noundies
10-01-2012, 10:11 AM
right before you posted, I made that exact stame script haha. but now it tells me,

03:07 GetSpotByID: Item of id 3033 could not be found in any open container.
03:07 OpenDoor: Could not find key 3033.

but the key is in BP#1

problem solved.

03:11 You see a silver key (Key:3033).
It weighs 1.00 oz. [ID 2969]

i entered 3033 instead if 2969

Mega
10-01-2012, 10:18 AM
Why would he do that? That will load forgee.lua everytime he comes to that script so it will eat his memory to shit?

Add the dofile("forgee.lua") to the first line in your .lua instead.

Its a one-liner as Forgee said, and i use it without any problems what so ever.

noundies
10-01-2012, 10:53 AM
new problem! Rather than make a new thread, ill ask here!


dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Enter Door1") then
openDoor(North, 2969)

elseif (labelname ~= "Entered Door1") then --here I want it to try again if the door didnt open. I'm positive this is incorrect
openDoor(North, 2969)
end

end


im positive it is wrong but Idk what to do. what I want is for it to check if it made it past the first door before trying to Enter Door2.

Messed Around
10-01-2012, 11:02 AM
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Enter Door1") then
openDoor(North, 2969)

elseif (labelname ~= "Entered Door1") then --here I want it to try again if the door didnt open. I'm positive this is incorrect
if (Self.Position().x == ^x and Self.Position().y == ^y and Self.Position().z == ^z) then
openDoor(North, 2969)
else
gotoLabel("Enter Door1")
end
end
end

Is that what your looking for? ^x, ^y & ^z are where you put the co-ordinates for the spot near the second door. Just remove ^x, and put the x co-ordinate and so on.

Forgee
10-01-2012, 11:33 AM
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Door North") then
local pos = Self.Position()
while Self.Position().x == pos.x and Self.Position().y == pos.y and Self.Position().z == pos.z do
openDoor(NORTH, 2969)
wait(5000)
end
end
end
When using a direction to get the door position you don't need more than one label for each direction. I call them "Door North", "Door South" etc, that way I never need more than 4 door labels. If you don't want to change the labels in your waypoint, replace "Door North" with the label you have.

noundies
10-01-2012, 11:33 AM
this is getting so confusing!

I changed it up a little because I want him to go through one door, then another. But I want him to make checkers for each door.

For example,
Stand infront of Door1
Open Door 1 (I'll use Enter Door1 as preference because later I will have an Exit Door1)
Stand on otherside of Door1
Check if I made it past Door1

If I made it past Door1 then


Stand infront of Door2


If i did not make it past Door1 then


go back to Stand infront of Door1

--Same process and continue through Door 2 and then Go Hunt.

But Right now he's not even trying to use the key to open the door! I threw it on the floor and he still tries without the key!

http://i304.photobucket.com/albums/nn192/CyrePanda/xenohelp3.png
Here's the script from the screen shot.


dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "Enter Door1") then
setWalkerEnabled(false)
delayWalker(3000)
openDoor(NORTH, 2969)
wait(500, 1000)
setWalkerEnabled(true)
end

end

Forgee
10-01-2012, 12:03 PM
The way I suggested you would only need to have one label for each door instead of two, and it would check that it got through before moving on to the next door.
It is also recommended that you try the solutions you are given, or people will stop trying to help.

As for why it's trying to open the door without key, I don't know. Looks as if there was no keyID defined. That has never happened for me and it shouldn't. Make sure you killed the script and re executed it after saving the changes.