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

Checking for redstone

Started by aimdog, 12 August 2012 - 12:53 PM
aimdog #1
Posted 12 August 2012 - 02:53 PM
I am trying to make a program that controls a nuclear reactor in tekkit. The problem I am having is that I want it all to be automated and show what is hapening on a monitor.I need a master switch that turns the reactor off and also a thermal monitor that shut off the nuclear reactor for a cool down period. so I want the program to be checking for constanty for 2 redstone signals at once but as I am new to computercraft I dont know how could anybody help??
Cranium #2
Posted 12 August 2012 - 03:36 PM
To have it automated, you could either use CcSensors to monitor the heat, or more simply use a timer for it. You would have to have the program wait for an input from the sensor, and if the heat is above this value, to output a signal to the reactor to shut it off. I've never used CcSensors, but many people have posted examples of what they have done.
aimdog #3
Posted 12 August 2012 - 09:48 PM
I want to be able to see the state of the nuclear reactor on a large monitor. I am using a thermal monitor and a redstone wire in to the nuclear reactor.to shut it off i also have a button to be used as a master shut off switch connected to the computer but I am now getting an error code it is ""bios:206: [string "qwertyu"] :35: '<eof>' expected"" here is my code

print ("Welcome To Nuclear Reactor Monitor")
while true do
os.pullEvent("redstone")
if redstone.getInput("right") then -- master switch
print ("Starting Neuclear Reactor")
redstone.setOutput("back",true) -- on/off of the reactor
else if redstone.getInput("left") then -- thermal monitor
print("Overheat Detected shuting off reactor for cool down perod")
redstone.setOutput("back",false)
sleep(30)
else if redstone.getInput("right") then
print ("Nuclear Reactor OFF")
redstone.setOutput("back",false)
end
end
end
end
end
Lyqyd #4
Posted 13 August 2012 - 12:30 AM
Why do you have so many ends? Get rid of the ones that aren't necessary.
Cranium #5
Posted 13 August 2012 - 01:33 AM
There should only be a total of two ends in this code.