Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local reactor = peripheral.wrap("BigReactors-Reactor_1")
  2. local mon = peripheral.wrap("monitor_0")
  3.  
  4. -- clear the monitor at startup
  5. mon.clear()
  6.  
  7. function repeats(s, n)
  8.   return n > 0 and s .. repeats(s, n-1) or ""
  9. end
  10.  
  11.  
  12. function drawLine (m, row, color)
  13.   local currentColor = m.getBackgroundColor()
  14.   local currentPos = m.getCursorPos()
  15.  
  16.   m.setCursorPos(row, 0)
  17.   m.setBackgroundColor(color)
  18.   m.write(repeats(" ", m.getSize().x)
  19.  
  20.   m.setCursorPos(currentPos.x, currentPos.y)
  21.   m.setBackgroundColor(currentColor)
  22. end
  23.  
  24. function drawDisplay ()
  25.   drawLine(mon, 1, colors.red)
  26. end
  27.  
  28. drawDisplay()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement