Jump to content




Rednet Stops Sending Signal Well Into Code


1 reply to this topic

#1 moneymaster2012

  • Members
  • 38 posts

Posted 17 March 2017 - 03:26 AM

Here is the script of my turtle:
function clear(x)
  term.clear()
  term.setCursorPos(1,x)
end
function send(message)
  rednet.broadcast(message)
end
function label(num)
  term.setBackgroundColor(colors.white)
  term.setTextColor(colors.red)
  clear(1)
  print("Professor T")
  term.setTextColor(colors.black)
  term.setCursorPos(1,3)
end
function menu()
  label()
end
--Startup
local m = fs.open("refresh","r")
local n = m.readLine()
m.close()
if n == "false" then
rednet.open("left")
label()
send("clear")
send("Hello class! Professor T will be with you in a moment.")
local senderID, message, protocol = rednet.receive()
local t = fs.open("opening","w")
t.write(message)
t.close()
local senderID, message, protocol = rednet.receive()
local t = fs.open("lesson-1","w")
t.write(message)
t.close()
local senderID, message, protocol = rednet.receive()
local t = fs.open("lesson-2","w")
t.write(message)
t.close()
local senderID, message, protocol = rednet.receive()
local t = fs.open("lesson-3","w")
t.write(message)
t.close()
local senderID, message, protocol = rednet.receive()
local t = fs.open("lesson-4","w")
t.write(message)
t.close()
shell.run("desk")
send("clear")
send("Now that we're settled, I am Professor T.")
local j = fs.open("refresh","w")
j.writeLine("true")
j.close()
shell.run("reboot")
else
sleep(2)
label()
rednet.open("left")
send("I am your teacher for today.")
sleep(3)
end

The problem is towards the end of the script. After send("Now that we're settled..."), the turtle just stops sending rednet signals to the computer that is hooked up to the monitor and just exits the script without listening to the last few bits of code. There is no error in any of the 4 computers. As you can see, I got frustrated and even let the system refresh and reboot before it moved on, but it still didn't work.

Any solutions?

#2 valithor

  • Members
  • 1,053 posts

Posted 18 March 2017 - 07:02 AM

Could you post the code that the computer that is receiving this messages is running? I am wondering if it is actually something else other than this code that is causing you to believe that the code is not running. I do not see any reason that those lines would not be run.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users