Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("getSteam")
- os.loadAPI("jimmi/button")
- refreshTimer = os.startTimer(1)
- local big = peripheral.find("BigReactors-Reactor")
- local mon = peripheral.find("monitor")
- local manual = false
- mon.clear()
- function automaticOnOff()
- button.toggleButton("Automatic")
- manual = not manual
- end
- function run()
- steam = getSteam.getAmount()
- steamP = steam / 20736 /10
- steamP = steamP
- --max rod out
- MaxRodOut = 50
- Rod = big.getControlRodLevel(0)
- RodDiff = (100 - MaxRodOut) /100
- if steamP > 0 and manual == false then
- big.setAllControlRodLevels((RodDiff*steamP)+MaxRodOut)
- end
- --Till Monitorn
- mon.setCursorPos(1,1)
- mon.clearLine()
- mon.setTextColor(2)
- mon.setBackgroundColor(128)
- if manual == false then
- mon.write(" Automatic rod activeated ")
- else
- mon.write(" Automatic rod deactivated ")
- end
- mon.setCursorPos(1,3)
- mon.setBackgroundColor(32768)
- mon.clearLine()
- mon.setTextColor(1)
- mon.write(" Steam: "..steamP.. "%")
- mon.setCursorPos(1,4)
- mon.clearLine()
- mon.write(" Rod: ".. (RodDiff*steamP)+MaxRodOut)
- mon.setCursorPos(1,6)
- mon.clearLine()
- mon.write(" Steam: "..big.getHotFluidProducedLastTick().." mb/t")
- mon.setCursorPos(1,7)
- mon.clearLine()
- mon.write(" CoreTemp: "..math.floor (big.getFuelTemperature()).." c")
- mon.setCursorPos(1,8)
- mon.clearLine()
- mon.write(" FuelUsage: " ..big.getFuelConsumedLastTick().. " mb/t")
- mon.setCursorPos(1,9)
- mon.clearLine()
- mon.write(" MaxRodOut: ".. MaxRodOut .."%")
- if steamP < 0 and manual == false then
- --kickstart
- big.setAllControlRodLevels(MaxRodOut)
- end
- --print("steam: "..steamP.."% Rod: ".. (RodDiff*steamP)+MaxRodOut)
- print("....Automating....")
- refreshTimer = os.startTimer(1)
- end
- button.setTable("Automatic",automaticOnOff,"",2,28,11,17)
- button.drawScreen()
- function pullEvents()
- local event, side, x, y = os.pullEvent()
- if event=="monitor_touch" then
- button.checkxy(x,y)
- end
- if event=="timer" then
- run()
- end
- end
- while true do pullEvents() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement