Basically what happens is whenever something fills up, it lets off a redstone signal. I want that signal to lead into the computer and then display that it's full and not allow you to type in certain commands. But the only way that I know to get a redstone input is on a loop and restricts users from typing anything or interacting with the computer.
this is the main code. It's called "visproduction"
Quote
print ("")
local input = read()
if input == "help" then
term.clear()
term.setCursorPos(1, 1)
print ("Options are as follows:")
print ("")
print ("'Start' or 'Start vis production'")
print ("'Stop' or 'Stop vis production'")
print ("'Boost' or 'Boost vis production'")
print ("'Clear'")
print ("'estop'")
print ("'exit'")
print ("'shut down'")
-- print ("'check vis production status'") --this is how I want to check to see how it's running.
sleep(1)
shell.run("visproduction")
end
if input == "start" then
rs.setBundledOutput("back",1)
sleep(1)
shell.run("visproduction")
end
if input == "Start" then
rs.setBundledOutput("back",1)
sleep(1)
shell.run("visproduction")
end
if input == "start vis production" then
rs.setBundledOutput("back",1)
sleep(1)
shell.run("visproduction")
end
if input == "Start vis production" then
rs.setBundledOutput("back",1)
sleep(1)
shell.run("visproduction")
end
if input == "stop" then
rs.setBundledOutput("back",0)
sleep(1)
shell.run("visproduction")
end
if input == "Stop" then
rs.setBundledOutput("back",0)
sleep(1)
shell.run("visproduction")
end
if input == "stop vis production" then
rs.setBundledOutput("back",0)
sleep(1)
shell.run("visproduction")
end
if input == "Stop vis production" then
rs.setBundledOutput("back",0)
sleep(1)
shell.run("visproduction")
end
if input == "boost" then
rs.setBundledOutput("back",3)
sleep(1)
rs.setBundledOutput("back",1)
shell.run("visproduction")
end
if input == "Boost" then
rs.setBundledOutput("back",3)
sleep(1)
rs.setBundledOutput("back",1)
shell.run("visproduction")
end
if input == "boost vis production" then
rs.setBundledOutput("back",3)
sleep(1)
rs.setBundledOutput("back",1)
shell.run("visproduction")
end
if input == "Boost vis production" then
rs.setBundledOutput("back",3)
sleep(1)
rs.setBundledOutput("back",1)
shell.run("visproduction")
end
if input == "estop" then
rs.setBundledOutput("back",4)
shell.run("visproduction")
end
if input == "Estop" then
rs.setBundledOutput("back",4)
shell.run("visproduction")
end
if input == "clear" then
term.clear()
term.setCursorPos(1, 1)
shell.run("visproduction")
end
if input == "edit" then
print("Only authorized users can edit this program. Password Required")
sleep(2)
shell.run("editpass")
end
--this part comes back as the else code, and doesn't do shell.exit()
if input == "exit" then
shell.exit()
end
--
if input == "shut down" then
print("Shutting down Production OS. Please wait as it saves and safely shuts down the system.")
sleep(3)
print("Saving settings")
sleep(1)
print("Shutting down secondary processes")
sleep(0.5)
print("Shutting Down")
sleep(4)
os.shutdown()
else
print("not a valid operation")
shell.run("visproduction")
end
and here is the "editpass" program code.
Quote
write("Insert password here: ")
pass = read()
if pass == (correctpass) then
print("Correct, You may now edit this program.")
sleep(1)
print("saving content to prevent data loss")
sleep(1)
print("Shutting down secondary processes")
sleep(0.5)
print("Restarting. You will be in the editing screen upon startup")
sleep(4)
shell.run("edit","visproduction") --when I'm in the edit screen, then exit with ctrl E, it's like it runs visproduction, and then I --typed "e" as a code, so it returns as another else.
else
print("Incorrect")
sleep(1)
shell.run("visproduction")
end
This is my first forum post so I hope it's formatted correctly and not too much. Thanks for your help in advance.












