Posted 08 September 2012 - 11:17 PM
hello
I'm trying to use a computer to turn my reactor off an on again, but when I ran my program, it said
'attempt to index ? (a nil value)
this is my code
mon = peripheral.wrap("top")
mon.clear()
mon.setTextScale(1)
mon.write("REACTOR 1")
input = read()
if input == "turn off" then
redstone.setOutput("back", true)
mon.clear()
mon.write("turned off")
sleep(3)
mon.clear()
mon.write("REACTOR 1")
end
if input == "turn on" then
redstone.setOutput("back", false)
mon.clear()
mon.write("Turned on")
sleep(3)
mon.clear()
mon.write("REACTOR 1")
end
I'm trying to use a computer to turn my reactor off an on again, but when I ran my program, it said
'attempt to index ? (a nil value)
this is my code
mon = peripheral.wrap("top")
mon.clear()
mon.setTextScale(1)
mon.write("REACTOR 1")
input = read()
if input == "turn off" then
redstone.setOutput("back", true)
mon.clear()
mon.write("turned off")
sleep(3)
mon.clear()
mon.write("REACTOR 1")
end
if input == "turn on" then
redstone.setOutput("back", false)
mon.clear()
mon.write("Turned on")
sleep(3)
mon.clear()
mon.write("REACTOR 1")
end