Posted 01 May 2012 - 07:12 PM
I created a simple program to have two turtles place blocks to create a door, and a second to mine them to open the door. I have them hidden behind a wall and want to activate them using a rednet signal. I also have a simple startup program to load the programs on the turtles and prep them.
startup:
fs.copy("disk/dooropen","dooropen")
fs.copy("disk/doorclose","doorclose")
rednet.open("right")
x=os.computerID()
print("My name is ", x)
open door:
x, message = rednet.receive()
print(message)
if message == "Open" then
turtle.dig()
turtle.forward()
turtle.turnLeft()
turlte.dig()
turtle.up()
turtle.dig()
turtle.turnleft()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.down()
turtle.dig()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
end
close door:
x, message = rednet.receive()
print(message)
if message == "Close" then
turtle.dig()
turtle.forward()
turtle.turnLeft()
turlte.place()
turtle.up()
turtle.place()
turtle.turnleft()
turtle.forward()
turtle.turnRight()
turtle.place()
turtle.down()
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
end
The startup works, but for some reason, when I broadcast the signal, the turtle doesn't run the program :/ any suggestions?
startup:
fs.copy("disk/dooropen","dooropen")
fs.copy("disk/doorclose","doorclose")
rednet.open("right")
x=os.computerID()
print("My name is ", x)
open door:
x, message = rednet.receive()
print(message)
if message == "Open" then
turtle.dig()
turtle.forward()
turtle.turnLeft()
turlte.dig()
turtle.up()
turtle.dig()
turtle.turnleft()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.down()
turtle.dig()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
end
close door:
x, message = rednet.receive()
print(message)
if message == "Close" then
turtle.dig()
turtle.forward()
turtle.turnLeft()
turlte.place()
turtle.up()
turtle.place()
turtle.turnleft()
turtle.forward()
turtle.turnRight()
turtle.place()
turtle.down()
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
end
The startup works, but for some reason, when I broadcast the signal, the turtle doesn't run the program :/ any suggestions?