Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this should pass messages from the main
- -- reactor room to this one to get info.
- local wireless = peripheral.wrap("left")
- local reactors = {peripheral.find("BigReactors-Reactor")}
- wireless.open(1)
- local rn = 0
- local isActive = ''
- function wm_send( rn, stat, value)
- local temp = ''
- temp = rn .. '|' .. stat .. '|' .. value
- print(temp)
- wireless.transmit(1,2, temp )
- end -- wm_send
- while true do
- for x,y in ipairs( reactors) do
- if y.getNumberOfControlRods() > 20 then
- rn = 5
- else
- rn = 4
- end
- if y.getActive() then
- isActive = 'True'
- else
- isActive = 'False'
- end -- getActive
- wm_send( rn, 'active', isActive)
- wm_send( rn, 'rft', math.floor(y.getEnergyProducedLastTick() ))
- wm_send( rn, 'rfs', math.floor(y.getEnergyStored() ))
- wm_send( rn, 'casing',math.floor(y.getCasingTemperature() ))
- wm_send( rn, 'core', math.floor(y.getFuelTemperature() ))
- end -- loop through reactors.
- print('--------------------')
- sleep(1)
- end -- main loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement