Posted 07 August 2012 - 08:40 AM
Recently i have been attempting to make a code which makes it so that the computer needs a Redstone input in order to stay on. So far i have this:
term.clear()
term.setCursorPos(1,1)
if redstone.getInput("back", true) then
print("Welcome User")
else
print("Not Enough Power")
sleep(3)
os.shutdown()
end
This works fine when the computer is first switched on. The computer will switch off if a Redstone current is not applied to the back of the computer. I have been having trouble trying to figure out how to make it so that if during use the computer does not have a Redstone current it will immediately switch off.
Help is greatly appreciated
term.clear()
term.setCursorPos(1,1)
if redstone.getInput("back", true) then
print("Welcome User")
else
print("Not Enough Power")
sleep(3)
os.shutdown()
end
This works fine when the computer is first switched on. The computer will switch off if a Redstone current is not applied to the back of the computer. I have been having trouble trying to figure out how to make it so that if during use the computer does not have a Redstone current it will immediately switch off.
Help is greatly appreciated