This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
maxymunte's profile picture

redstone input

Started by maxymunte, 27 July 2012 - 04:25 PM
maxymunte #1
Posted 27 July 2012 - 06:25 PM
im tryed for like 4 hours to get this to work but i cant
now im asking how do i get the reactor to stop running when its turned on when the mfsu is full it sends a purple redstone signal if its full
becouse i only got it a bit to work when i have pull event restone but i dont want it to pause i just want is to do somthing whenever a redstone sigal comes in
code unedited yet

term.clear()
term.setCursorPos(1,1)
print("---------- Reactor Control System v1.3 ----------")
sleep(0,5)
print("Enter [open door] To access the reactor room.")
print()
print("Enter [start cooling] to turn on reactor cooling system.")
print()
print("Enter [reactor on] to turn reactor state On/off")
print("-------------------------------------------------")
write("Control Function? : ")
local input = read()
if input == "open door" then
  term.clear()
  term.setCursorPos(1,1)
  print("Opening the reactor room...")
  rs.setBundledOutput("back", colors.orange)
  sleep(1)
  term.clear()
  term.setCursorPos(1,1)
  print("To close door Enter Close")
  write("Control Function? : ")
  local secondinput = read()
  if secondinput == "close" then
	    term.clear()
	    term.setCursorPos(1, 1)
	    print("Closing reactor door...")
	    sleep(1)
	    rs.setBundledOutput("back", 0)
	    shell.run("reactor")
  else
	    term.clear()
	    term.setCursorPos(1, 1)
	    print("Command incorrect, shutting down.")
	    rs.setOutput("right",false)
	    rs.setOutput("left",false)
	    rs.setOutput("top",false)
	    rs.setOutput("back",false)
	    rs.setOutput("bottom",false)
	    sleep(2)
	    shell.run("reactor")
  end
elseif input == "start cooling" then
  term.clear()
  term.setCursorPos(1, 1)
  print("Reactor Cooling System Actived")
  rs.setBundledOutput("back", colors.red)
  sleep (1)
  term.clear()
  term.setCursorPos(1,1)
  print "To turn off Cooling System Enter Off"
  write(" Control Function? : ")
  local secondinput = read()
  if secondinput == "off" then
	    term.clear()
	    term.setCursorPos(1,1)
	    print("Cooling System Shutting Down")
	    sleep (2)
	    rs.setBundledOutput("back", 0)
	    sleep (2)
	  shell.run("reactor")
  else
	    term.clear()
	    term.setCursorPos(1, 1)
	    print("Command incorrect, shutting down.")
	    rs.setOutput("right",false)
	    rs.setOutput("left",false)
	    rs.setOutput("top",false)
	    rs.setOutput("back",false)
	    rs.setOutput("bottom",false)
	    sleep(2)
	    shell.run("reactor")
  end
elseif input == "reactor on" then
  term.clear()
  term.setCursorPos(1,1)
  print("Reactors Coming Online")
  rs.setBundledOutput("back", colors.combine(colors.red, colors.blue))
  sleep (1)
  term.clear()
  term.setCursorPos(1,1)
  print "To turn Reactors Off Enter Off"
  write ("Control Function? : ")
  local thirdinput = read()
  if thirdinput == "off" then
	    term.clear()
	    term.setCursorPos (1,1)
	    print("Reactors Shutting Down. Standby.")
	    rs.setBundledOutput("back", 0)
	    sleep(2)
	    shell.run("reactor")
  else
	    term.clear()
	    term.setCursorPos(1,1)
	    print "Command incorrect, shutting down."
	    rs.setOutput("right",false)
	    rs.setOutput("left",false)
	    rs.setOutput("top",false)
	    rs.setOutput("back",false)
	    rs.setOutput("bottom",false)
	    sleep (2)
	    shell.run("reactor")
  end
else
	  term.clear()
	  term.setCursorPos(1, 1)
	  print("Command incorrect, shutting down.")
	  rs.setOutput("right",false)
	  rs.setOutput("left",false)
	  rs.setOutput("top",false)
	  rs.setOutput("back",false)
	  rs.setOutput("bottom",false)
	  sleep(2)
	  shell.run("reactor")
  end
maxymunte #2
Posted 27 July 2012 - 06:29 PM
1 other thing i want is if redstone input purple is false then then reactor is on when redstone signal is true the reactor turns off and i need it to work whenever a redstone signal goes in i also tryed this for long time to get the nuclear reactor turn off and on automatically but i could get it to work
so if somone could show me how to do it thx
Tiin57 #3
Posted 28 July 2012 - 01:00 PM
Truely, I am sorry. I'd love to help you, but I cannot understand your grammar. Please fix it and I'll try again.