brattus123, on 23 September 2013 - 12:05 AM, said:
with this code which is attempting to combine the rednet code with the orbit code im getting an error saying ("eof") expected on line 10 and i don't know why and also would it be possible to make this code loop until the redstone signal is applied
Turtle:
rednet.open ("left")
while true do
local event, id, msg = os.pullEvent ("rednet_message")
if id == 18 then
if msg == "nograv" then
shell.run ("offorbit")
end
end
end
else
shell.run ("orbit")
Proper code indentation would make this syntax error easier to spot.
rednet.open ("left")
while true do
local event, id, msg = os.pullEvent ("rednet_message")
if id == 18 then
if msg == "nograv" then
shell.run ("offorbit")
end
end
end
else
shell.run ("orbit")
The last 2 lines actually belong right after the other shell.run. Right now they are outside your loop and will never run. Can you see how code indentation makes it easier to read your own code?