Posted 27 January 2015 - 10:40 AM
So, haven't played with Computercraft in a long time and decided to again, ran into a small problem,
That only works once every time the program is ran, I know a solution to this would be to just make the program then run itself, but that'd be a lazy workaround and I wanna know what I messed up on to avoid making this mistake in the future.
EDIT: Ignore this entire thing. Found my problem.
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.purple)
print("AppleOS v0")
rednet.open("top")
while true do
local id, msg = rednet.receive()
if msg == "rain" then
rs.setOutput("back", true)
sleep(1)
rs.setOutput("back", false)
end
end
That only works once every time the program is ran, I know a solution to this would be to just make the program then run itself, but that'd be a lazy workaround and I wanna know what I messed up on to avoid making this mistake in the future.
EDIT: Ignore this entire thing. Found my problem.
Edited on 27 January 2015 - 11:17 AM