Posted 26 May 2012 - 11:01 PM
I need some help with my code. I'm not sure what's wrong it tells me expected positive number, I'm tyring to send a message to my turtle and if the message is str it will move forward here's the code for the sending computer
–send
write ("which side is your modem:")
ms = io.read()
rednet.open(ms)
write ("id of turtle:")
idt = io.read()
idt = tonumber(idt)
while true do
event, param1 = os.pullEvent()
if param1 == "w" then
rednet.send("str", idt)
end
end
And here's the code for the receiving turtle
–receive
write ("which side is your modem:")
ms = io.read()
rednet.open(ms)
while true do
Id, message = rednet.receive()
if id == "str" then
turtle.forward()
end
end
Please could any1 help , this is hopefully going to be remote control program thanks.
Any help will be appreciated
–send
write ("which side is your modem:")
ms = io.read()
rednet.open(ms)
write ("id of turtle:")
idt = io.read()
idt = tonumber(idt)
while true do
event, param1 = os.pullEvent()
if param1 == "w" then
rednet.send("str", idt)
end
end
And here's the code for the receiving turtle
–receive
write ("which side is your modem:")
ms = io.read()
rednet.open(ms)
while true do
Id, message = rednet.receive()
if id == "str" then
turtle.forward()
end
end
Please could any1 help , this is hopefully going to be remote control program thanks.
Any help will be appreciated