Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dreactor = peripheral.wrap("draconic_reactor_3")
- dmon = peripheral.wrap("monitor_23")
- function clear()
- dmon.clear()
- term.clear()
- term.setCursorPos(1,1)
- dmon.setCursorPos(1,1)
- end
- while true do
- if peripheral.isPresent("draconic_reactor_3") then
- if peripheral.isPresent("monitor_23") then
- clear()
- term.setCursorPos(16,1)
- dmon.setCursorPos(7,1)
- print("Draconic Reactor")
- dmon.write("Draconic Reactor")
- tbl = peripheral.call("draconic_reactor_3", "getReactorInfo")
- tbl = dreactor.getReactorInfo()
- for k, v in pairs (tbl) do
- if k == "status" then
- stats = v
- term.setCursorPos(8,3)
- dmon.setCursorPos(8,3)
- print("Status: "..stats)
- dmon.write("Status: "..stats)
- end
- if k == "fuelConversion" then
- term.setCursorPos(2,9)
- dmon.setCursorPos(2,9)
- conv = v / 9088 * 100
- print("F. Converted: "..conv.."%")
- dmon.write("F. Converted: "..conv.."%")
- if conv >= 80 then
- dreactor.stopReactor()
- term.setCursorPos(1,10)
- dmon.setCursorPos(1,10)
- print("Ran Out Of Fuel")
- dmon.write("Ran Out Of Fuel")
- end
- end
- if k == "temperature" then
- if v >= 8500 then
- dreactor.stopReactor()
- clear()
- term.setCursorPos(1,10)
- dmon.setCursorPos(1,10)
- dmon.write("Reactor Overheated")
- print("Reactor Overheated")
- end
- term.setCursorPos(3,4)
- dmon.setCursorPos(3,4)
- print("Temperature: "..v)
- dmon.write("Temperature: "..v)
- end
- if stats == "charged" then
- dreactor.activateReactor()
- end
- if k == "fieldDrainRate" then
- term.setCursorPos(3,6)
- dmon.setCursorPos(3,6)
- print("Field Drain: "..v)
- dmon.write("Field Drain: "..v)
- end
- if k == "generationRate" then
- term.setCursorPos(4,5)
- dmon.setCursorPos(4,5)
- print("Generating: "..v)
- dmon.write("Generating: "..v)
- end
- if k == "energySaturation" then
- term.setCursorPos(1,7)
- dmon.setCursorPos(1,7)
- spos = v / 876543209 * 100
- print("RF Saturation: "..spos.."%")
- dmon.write("RF Saturation: "..spos.."%")
- if spos <= 20 then
- if stats == "offline" or "charging" then
- else
- dreactor.stopReactor()
- clear()
- term.setCursorPos(1,10)
- dmon.setCursorPos(1,10)
- dmon.write("Shutdown.. Drained Too Fast")
- print("Shutdown.. Drained Too Fast")
- end
- end
- end
- if k == "fieldStrength" then
- term.setCursorPos(7,8)
- dmon.setCursorPos(7,8)
- fpos = v / 87654320 * 100
- print("Shields: "..fpos.."%")
- dmon.write("Shields: "..fpos.."%")
- if fpos <= 25 then
- if stats == "offline" or "charging" then
- else
- dreactor.stopReactor()
- clear()
- term.setCursorPos(1,10)
- dmon.setCursorPos(1,10)
- dmon.write("Shutdown.. Shields failing")
- print("Shutdown.. Shields failing")
- end
- end
- end
- end
- sleep(1)
- else
- clear()
- print("Can't find monitor")
- sleep(10)
- --os.reboot()
- end
- else
- clear()
- dmon.write("Couldn't Find Reactor")
- print("Couldn't find reactor")
- sleep(10)
- --os.reboot()
- end
- end
Add Comment
Please, Sign In to add comment