Posted 13 April 2012 - 08:29 PM
Hi i started lua yesterday so i don't know much about it.
I made a turtle with rednet connection that accepts commands like forward, up, down, etc from a computer but the only command that work's is forward.
My code:
turtle code:
computer code:
I made a turtle with rednet connection that accepts commands like forward, up, down, etc from a computer but the only command that work's is forward.
My code:
turtle code:
shell.run("clear")
rednet.open("right")
print("Remote Turtle")
var = 1
while var == 1 do
action, senderID, text = os.pullEvent()
if action == "rednet_message" then
if text == "forward" then
turtle.forward()
if text == "back" then
turtle.back()
if text == "up" then
turtle.up()
if text == "down" then
turtle.down()
if text == "left" then
turtle.turnLeft()
if text == "right" then
turtle.turnRight()
if text == "exit" then
var == 2
end
end
end
computer code:
rednet.open("right")
print("Remote Turtle Control Computer")
print()
var = 1
while var == 1 do
write("Enter a Remote Turtle command: ")
input = read()
if input == "xit" then
var = 2
else
rednet.broadcast(input)
end
end
I really hope someone can help me with this :P/>/>