128 posts
Location
Holland
Posted 07 April 2013 - 07:59 AM
my opendoor program doesn`t work.
when i let it my turtle run, it says:''opendoor:1: attempt to call nil''.
i am a little bit a noob at coding.
here is the program i wrote:
RemoveDoor()
sleep(20)
PlaceDoor()
function RemoveDoor()
turtle.down()
turtle.dig()
turtle.down()
turtle.dig()
TwoUp()
end
function TwoUp()
turtle.Up()
turtle.Up()
end
function PlaceDoor()
turtle.down()
turle.place()
turtle.down()
turtle.place()
TwoUp()
end
515 posts
Location
Australia
Posted 07 April 2013 - 08:02 AM
The functions need to be declared first:
function TwoUp()
turtle.Up()
turtle.Up()
end
function RemoveDoor()
turtle.down()
turtle.dig()
turtle.down()
turtle.dig()
TwoUp()
end
function PlaceDoor()
turtle.down()
turle.place()
turtle.down()
turtle.place()
TwoUp()
end
RemoveDoor()
sleep(20)
PlaceDoor()
88 posts
Location
Toulouse, France
Posted 07 April 2013 - 08:02 AM
my opendoor program doesn`t work.
when i let it my turtle run, it says:''opendoor:1: attempt to call nil''.
i am a little bit a noob at coding.
here is the program i wrote:
RemoveDoor()
sleep(20)
PlaceDoor()
function RemoveDoor()
turtle.down()
turtle.dig()
turtle.down()
turtle.dig()
TwoUp()
end
function TwoUp()
turtle.Up()
turtle.Up()
end
function PlaceDoor()
turtle.down()
turle.place()
turtle.down()
turtle.place()
TwoUp()
end
You have to declare your functions before calling them ! ;)/>
EDIT : Ninja'ed !
1511 posts
Location
Pennsylvania
Posted 07 April 2013 - 08:06 AM
You practically coded it backwards :D/> I give you props for that (not making fun of you in any way, and yes, I am serious. I am very impressed)
128 posts
Location
Holland
Posted 07 April 2013 - 08:17 AM
i wanted to make a hidden door inside a hollow (twilight forest) tree and (an original) turtledoor, and all you need is a mining turtle and this program and some blocks for the mining turtle to place.
this program is universal and to make the door look different al you need is to place a different block in the door frame.
i am one of those coders who write their scripts in chunks.
i am thinking about adding wireless redstone/modem functionality to it.
thanks, do you guys want a pastebin code of it?
128 posts
Location
Holland
Posted 07 April 2013 - 09:12 AM