Advertisement
Parg60

reactorStatusServer

Dec 17th, 2020 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. modem = peripheral.wrap("left")
  2. reactor = peripheral.wrap("BigReactors-Reactor_0")
  3. modem.open(7777) --receive
  4.  
  5. isActive = "NaN"
  6. chargeStatus = 0
  7. while true do
  8. event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  9. if message == "statusupdate" then
  10. if reactor.getActive() == true then
  11. isActive = "Reactor is currently active "
  12. else
  13. isActive = "Reactor is currently NOT active "
  14. end
  15.  
  16. chargeStatus = "and "..tostring(reactor.getEnergyStored()).." RF are stored."
  17.  
  18. replyMessage = isActive..chargeStatus
  19. modem.transmit(replyChannel, 7777, replyMessage)
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement