Posted 27 February 2013 - 05:29 PM
Title: Repeat Help.
I am trying to get my program to keep the display updated with changes in the redstone connecting to it without rebooting the program (if the reactor is on, it says on, when it goes off, it says off). It works for about 3 seconds and the I keep getting the "too long without yielding". Is it possible and if so, is there a better way to do this?
I am trying to get my program to keep the display updated with changes in the redstone connecting to it without rebooting the program (if the reactor is on, it says on, when it goes off, it says off). It works for about 3 seconds and the I keep getting the "too long without yielding". Is it possible and if so, is there a better way to do this?
term.clear()
term.setCursorPos(1, 1)
repeat
local mon = peripheral.wrap("top")
local x = rs.getInput("bottom")
local y = rs.getInput("back")
if x == true then
mon.setCursorPos(1,2)
mon.write(" ")
mon.setCursorPos(1,3)
mon.write("***Reactor Display Panel***")
mon.setCursorPos(1,4)
mon.write(" ")
mon.setCursorPos(1,5)
mon.write("-------------------------------------")
mon.setCursorPos(1,6)
mon.write(" Reactor Core is OFF")
mon.setCursorPos(1,7)
mon.write("-------------------------------------")
else
mon.setCursorPos(1,2)
mon.write(" ")
mon.setCursorPos(1,3)
mon.write("***Reactor Display Panel***")
mon.setCursorPos(1,4)
mon.write(" ")
mon.setCursorPos(1,5)
mon.write("-------------------------------------")
mon.setCursorPos(1,6)
mon.write(" Reactor Core is ON")
mon.setCursorPos(1,7)
mon.write("-------------------------------------")
end
if y == true then
mon.setCursorPos(1,8)
mon.write(" Status: OVERHEATING")
mon.setCursorPos(1,9)
mon.write("-------------------------------------")
mon.setCursorPos(1,10)
mon.write("<><><><><><><><><><><><><><><><><><><>")
else
mon.setCursorPos(1,8)
mon.write(" Status: SAFE ")
mon.setCursorPos(1,9)
mon.write("-------------------------------------")
mon.setCursorPos(1,10)
mon.write("<><><><><><><><><><><><><><><><><><><>")
end
until exit