Tomyf4

SmallModularReactor

Feb 3rd, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. num = 1
  2. screen = peripheral.wrap("back")
  3. rednet.open("front")
  4.  
  5. function SetScreen(Text, Color)
  6. screen.setBackgroundColor(Color)
  7. screen.clear()
  8. screen.setCursorPos(1,2)
  9. screen.setTextScale(1.5)
  10. screen.write(Text)
  11. end
  12.  
  13. SetScreen(" OK", 128)
  14.  
  15. while true do
  16. local id, message = rednet.receive()
  17. if message == "poweronreactor_"..num then
  18. redstone.setOutput("top", true)
  19. SetScreen(" ON", 8192)
  20. rednet.broadcast("Reactor"..num.." is now ONLINE")
  21. elseif message == "poweroffreactor_"..num then
  22. redstone.setOutput("top", false)
  23. SetScreen(" OFF", 16384)
  24. rednet.broadcast("Reactor"..num.." is now OFFLINE")
  25. end
  26. sleep(0.1)
  27. end
Add Comment
Please, Sign In to add comment