PDA

View Full Version : Open door?



secret121
01-16-2016, 05:03 PM
im trying to make this noob script and theres a couple doors and i cant seem to get them to open.


im using

elseif (labelName == "Door1") then
OpenDoor(32657, 31965, 8, 6252)
end


in my lua and its not working when it gets to Door1 in the wpts it just skips and goes to the next one

im sure im doing something wrong but i cant figure it out

can anyone help me out?

acrozo01
01-16-2016, 05:35 PM
It's easier to use it directly in Xenobot Walker

Self.OpenDoor(32657,31965,8)

But if you really want to use in Lua

elseif (labelName == "Door1") then
Walker.Stop()
Self.OpenDoor(32657,31965,8)
Wait(1000)
Walker.Open()


If you want to open a door with a key it's a bit harder.
I can't help with that. :D

sholh
01-16-2016, 06:58 PM
This is the code for key
elseif (labelName == 'Sv Door') then
OpenDoor(32027, 31444, 6, 2969)
this is the fuction
function OpenDoor(x, y, z, id)
tmp = nil
if Map.IsTileWalkable(x, y, z) then
return false
else
tmp = Map.GetTopUseItem(x, y, z).id
Self.UseItemFromGround(x, y, z)
wait(Self.Ping() * 2, Self.Ping() * 3)
if tmp == Map.GetTopUseItem(x, y, z).id then
UseItemFromBP(x, y, z, id)
end
end
end

function UseItemFromBP(x, y, z, id)
for i = 0, 15 do
BP = Container.New(i)
for SPOT = BP:ItemCount() - 1, 0, -1 do
if (BP:GetItemData(SPOT).id == id) then
BP:UseItemWithGround(SPOT, x, y, z)
end
end
end
end

mikjail
01-16-2016, 08:59 PM
It's easier to use it directly in Xenobot Walker

Self.OpenDoor(32657,31965,8)

How you do this directly in Xeno Walker?

acrozo01
01-16-2016, 09:03 PM
Self.OpenDoor(32657,31965,8)

How you do this directly in Xeno Walker?

Open Walker , Right Click on Walker window , Press add one liner script , and write that.

secret121
01-16-2016, 10:13 PM
It's easier to use it directly in Xenobot Walker

Self.OpenDoor(32657,31965,8)

But if you really want to use in Lua

elseif (labelName == "Door1") then
Walker.Stop()
Self.OpenDoor(32657,31965,8)
Wait(1000)
Walker.Open()


If you want to open a door with a key it's a bit harder.
I can't help with that. :D


dont need a key thanks its working now

Jontor
01-16-2016, 10:23 PM
dont need a key thanks its working now

Pretty sure you can do it using a waypoint from 'Advanced Waypoints...' menu in walker

acrozo01
01-17-2016, 08:57 AM
dont need a key thanks its working now

You're welcome.

acrozo01
01-17-2016, 08:57 AM
Pretty sure you can do it using a waypoint from 'Advanced Waypoints...' menu in walker

Not sure tho'.

mikjail
08-20-2016, 05:41 PM
It's easier to use it directly in Xenobot Walker

Self.OpenDoor(32657,31965,8)

But if you really want to use in Lua

elseif (labelName == "Door1") then
Walker.Stop()
Self.OpenDoor(32657,31965,8)
Wait(1000)
Walker.Open()


If you want to open a door with a key it's a bit harder.
I can't help with that. :D

But what if the door is open? it will check anyways?

Elvang
08-20-2016, 10:14 PM
But what if the door is open? it will check anyways?

Yes it will.

kozdam4s
10-26-2018, 08:04 PM
Hello, it does not work for me to open the door, can someone give a working script or lua?