Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- To install use "pastebin run 6sy87Yin"
- -- http://pastebin.com/QGfvG1eU | Reactor Controller - Core | By Eforen (Ariel Lothlorien)
- cell = peripheral.wrap("cofh_thermalexpansion_energycell_1")
- reactor = peripheral.wrap("BigReactors-Reactor_1")
- -- net = peripheral.wrap("top")
- --methods = net.callRemote("cofh_thermalexpansion_energycell_1", "getEnergyStored", "unknown")
- --bottom = 0.25
- --top = 0.95
- bottom = 0.02
- top = 0.10
- event, par1 = "run", "start"
- timer = os.startTimer(1)
- while(event ~= "exit") do
- event, par1, par2, par3, par4, par5 = os.pullEvent()
- if(event == "key") then
- if par1 == 16 then
- os.queueEvent("exit")
- end
- if par1 == 19 then --R
- os.reboot()
- end
- if par1 == 31 then --S
- os.shutdown()
- end
- elseif(event == "timer") then
- timer = os.startTimer(1)
- --stored = cell.getEnergyStored("unknown")
- --max = cell.getMaxEnergyStored("unknown")
- stored = reactor.getEnergyStored()
- max = 10000000
- print(tostring(stored).."/"..tostring(max).."="..tostring(stored/max).."%")
- if(stored/max > top and reactor.getActive())then
- print("Turning Off Reactor...")
- reactor.setActive(false)
- elseif(stored/max < bottom and reactor.getActive()==false)then
- print("Turning On Reactor...")
- reactor.setActive(true)
- end
- end
- end
- if (par1 ~= nil) then
- print(par1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement