Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Reactor_Status = {}
- local Reactor_Heat = {}
- local Reactor_Power = {}
- local Facility_Status = -1 -- -1 = Offline, 0 = Reserve Power, 1 = Startup, 2 = Normal Operations
- local Reactor_Layout = {}
- local PowerFacilityChannel = 35
- local modem
- function ReadMessage( Channel, Message, ReplyChannel) --reads messages
- if Channel == PowerFacilityChannel and Message == "getStatus" then
- modem.transmit(Reply,PowerFacilityChannel,Facility_Status)
- elseif Channel == PowerFacilityChannel and Message == "shutdown_Power" then
- ShutPower()
- end
- end
- function ShutPower()--turns off all power
- end
- function CheckReactors()--updates reactor variables based off reactor data()
- end
- function PowerFacilityCheck()--ensures everything is working correctly, if error detected, facility turns off
- end
- function Loop()
- while true do
- local a, b, c, d, e, f = os.pullEvent()
- if a == "modem_message" then
- ReadMessage(c,d,e)
- elseif a == "pass" then
- CheckReactors()
- end
- if Facility_Status > -1 then
- PowerFacilityCheck()
- os.queueEvent("pass")
- else
- break
- end
- end
- end
- Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement