Advertisement
MagmaLP

Untitled

Jul 22nd, 2023
1,242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. mon.setTextScale(1)
  3. mon.setBackgroundColor(256)
  4. mon.setCursorPos(1,1)
  5. mon.clear()
  6.  
  7. function calc_color(color)
  8.     return math.pow(2, color - 1)
  9. end
  10. function msg(gap, line, color, groundb, text)
  11.     mon.setBackgroundColor(calc_color(groundb))
  12.     mon.setCursorPos(gap,line)
  13.     mon.setTextColor(calc_color(color))
  14.     text = mon.write(text)
  15. end
  16.  
  17. msg(01,01,01,08," Springfield ")
  18. msg(01,02,01,08,"Nuclear Power")
  19. msg(01,03,01,08,"    Plant    ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement