Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- big1 = peripheral.wrap("BigReactors_Reactor-1")
- big2 = peripheral.wrap("BigReactors_Reactor-2")
- mon = peripheral.find("monitor")
- if mon == nil then
- mon = term
- end
- act = 1000000 -- 1 mil
- des = 106000000 -- 106 mil
- function main()
- while true do
- sleep(1)
- val = cap.getEnergyStored()
- cur = math.floor(val*106)
- mon.clear()
- mon.setCursorPos(1,1)
- actv1 = big1.getActive()
- mon.write("Reactor 1 :")
- if actv1 == true then
- mon.setTextColour(colour.green)
- mon.write("Online")
- else
- mon.setTextColour(colour.red)
- mon.write("Offline")
- end
- mon.setTextColour(colours.white)
- mon.setCursorPos(1,3)
- mon.write("Tick Rate: "..big1.getEnergyProducedLastTick)
- mon.setCursorPos(1,5)
- actv2 = big2.getActive()
- mon.write("Reactor 2 :")
- if actv2 == true then
- mon.setTextColour(colour.green)
- mon.write("Online")
- else
- mon.setTextColour(colour.red)
- mon.write("Offline")
- end
- if cur < 50000000 then
- big1.setActive(true)
- big2.setActive(true)
- elseif cur >= 50000000 and trig == false then
- big1.setActive(false)
- big2.setActive(false)
- end
- end
- end
- function redstone()
- while true do
- sleep(1)
- if redstone.getInput("left") == false then
- trig = false
- else
- trig = true
- end
- end
- end
- function controll()
- term.clear()
- term.setCursorPos(1,1)
- print("Type 'Stop' to stop")
- input = io.read()
- sinput = string.lower(input)
- end
- function read()
- repeat controll()
- until sinput == "stop"
- end
- parellel.waitForAny(read,main,redstone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement