Advertisement
Samotage820

cc reactor display

Aug 2nd, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. rednet.open("front")
  2. monitor = peripheral.wrap("right")
  3. local msg
  4. local _, height = monitor.getSize()
  5. monitor.setCursorPos(1, height)
  6.  
  7. while true do
  8.     _, msg, _ = rednet.receive()
  9.     reactor_stat = string.match(msg, "^[^:]*")
  10.     buf_stat = string.match(msg, "[^:]*$")
  11.     monitor.scroll(1)
  12.     monitor.setCursorPos(1, height)
  13.     if reactor_stat == "ON" then
  14.         monitor.setTextColor(colors.lime)
  15.     else
  16.         monitor.setTextColor(colors.red)
  17.     end
  18.     monitor.write(reactor_stat)
  19.     monitor.setTextColor(colors.white)
  20.     monitor.write(buf_stat)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement