Posted 01 August 2012 - 08:45 AM
Ok. So what i am trying to do is have a program that will stop a user from opening the door to a Industrial Craft 2 nuclear reactor during its cool down phase of about 8 min, using Red Power I was able to get a signal to be outputted during that time, hitting the block to the left of the computer (door is on the right). The problem is that no matter if the input is on or not, it thinks it is on (aka. redstone is off, lets you in fine AND redstone is on, and it STILL lets you in no problem). Ive been though a couple tutorials and I cant seem to find anything that helped me. Any help is appreciated! And i realize that my code may be a bit of a mess, if there is something that is redundent or extra or whatever help with it is appreciated!
local Input1 = "Override"
local Overpass = "Inferno"
os.pullEvent = os.pullEventRaw
textutils.slowPrint("Welcome to Main Reactor Control Port 132.")
sleep(2)
term.clear()
term.setCursorPos(1,1)
if rs.getInput("left", false) then
textutils.slowPrint("Reactor stable. Entrance granted.")
rs.setOutput("right", true)
sleep(10)
rs.setOutput("right", false)
os.reboot()
end
if rs.getInput("left", true) then
rs.setOutput("right", false)
textutils.slowPrint("The Reactor is in a cooldown state, please wait a maximum of 8 miniutes to complete the cycle.")
local input = read()
if input == Input1 then
sleep(1)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Please enter override pasword.")
local input = read()
if input == Overpass then
sleep(1)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Accepted. Enter.")
rs.setOutput("right", true)
sleep(2)
term.clear()
term.setCursorPos(1,1)
sleep(8)
rs.setOutput("right", false)
else
sleep(2)
print("Incorrect. Please try again. In the event of an emergency permision is granted to break outer door.")
end
os.reboot()
end
end