Posted 17 September 2014 - 12:08 PM
Hi,
I'm trying to code an automatic cooling system for my reactor, when you type 'on' in the terminal redstone will turn on the system or off will do the opposite.
I wanted the terminal to always display a main page, welcoming them to the terminal and therefore the code is quite large as whenever a command is entered such as on, I had the terminal write Turning on… the script sleeps for a few seconds then the terminal will clear and re-write the welcome page.
Can you please try however to debug what's wrong. The error is happening on line 37, where I set the cursor pos.
I'm trying to code an automatic cooling system for my reactor, when you type 'on' in the terminal redstone will turn on the system or off will do the opposite.
I wanted the terminal to always display a main page, welcoming them to the terminal and therefore the code is quite large as whenever a command is entered such as on, I had the terminal write Turning on… the script sleeps for a few seconds then the terminal will clear and re-write the welcome page.
Can you please try however to debug what's wrong. The error is happening on line 37, where I set the cursor pos.
local monitor = peripheral.wrap("top")
while true do
monitor.clear()
monitor.setCursorPos(8,4)
monitor.write("Cooling System:")
monitor.setCursorPos(13,8)
monitor.write("OFF")
term.clear()
term.setCursorPos(7,3)
term.write("===================================")
term.setCursorPos(13,4)
term.write("Cooling System Controls.")
term.setCursorPos(7,5)
term.write("===================================")
term.setCursorPos(1,9)
term.write("To control the cooling system, please type either")
term.setCursorPos(1,10)
term.write("'OFF' or 'ON'. For the current status of the")
term.setCursorPos(1,11)
term.write("cooling system see monitor above. When turning on")
term.setCursorPos(1,12)
term.write("the cooling system please allow 1 minute before")
term.setCursorPos(13,13)
term.write("system is fully cooled.")
term.setCursorPos(1,15)
if input == "on" then
redstone.setOutput("back", true)
monitor.clear()
monitor.setCursorPos(8,4)
monitor.write("Cooling System:")
monitor.setCursorPos(13,8)
monitor.write("ON")
term.setCursorPos(1,17)
term.write("Turning Cooling System On...")
sleep(3)
term.clear
term.setCursorPos(7,3)
term.write("===================================")
term.setCursorPos(13,4)
term.write("Cooling System Controls.")
term.setCursorPos(7,5)
term.write("===================================")
term.setCursorPos(1,9)
term.write("To control the cooling system, please type either")
term.setCursorPos(1,10)
term.write("'OFF' or 'ON'. For the current status of the")
term.setCursorPos(1,11)
term.write("cooling system see monitor above. When turning on")
term.setCursorPos(1,12)
term.write("the cooling system please allow 1 minute before")
term.setCursorPos(13,13)
term.write("system is fully cooled.")
term.setCursorPos(1,15)
else if input == "off" then
redstone.setOutput("back", false)
monitor.clear()
monitor.setCursorPos(8,4)
monitor.write("Cooling System:")
monitor.setCursorPos(13,8)
monitor.write("OFF")
term.setCursorPos(1,17)
term.write("Turning Cooling System Off...")
sleep(3)
term.clear
term.setCursorPos(7,3)
term.write("===================================")
term.setCursorPos(13,4)
term.write("Cooling System Controls.")
term.setCursorPos(7,5)
term.write("===================================")
term.setCursorPos(1,9)
term.write("To control the cooling system, please type either")
term.setCursorPos(1,10)
term.write("'OFF' or 'ON'. For the current status of the")
term.setCursorPos(1,11)
term.write("cooling system see monitor above. When turning on")
term.setCursorPos(1,12)
term.write("the cooling system please allow 1 minute before")
term.setCursorPos(13,13)
term.write("system is fully cooled.")
term.setCursorPos(1,15)
else
term.setCursorPos("1,17)
term.write("Command not recognised...")
sleep(3)
term.clear
term.setCursorPos(7,3)
term.write("===================================")
term.setCursorPos(13,4)
term.write("Cooling System Controls.")
term.setCursorPos(7,5)
term.write("===================================")
term.setCursorPos(1,9)
term.write("To control the cooling system, please type either")
term.setCursorPos(1,10)
term.write("'OFF' or 'ON'. For the current status of the")
term.setCursorPos(1,11)
term.write("cooling system see monitor above. When turning on")
term.setCursorPos(1,12)
term.write("the cooling system please allow 1 minute before")
term.setCursorPos(13,13)
term.write("system is fully cooled.")
term.setCursorPos(1,15)
end
end
end