H3NL3Y

screenText

Nov 8th, 2020
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. local monitorSide = "top"
  2. local title = "To-Do List"
  3.  
  4. local list = {
  5. 'Do something',
  6. 'Do something else',
  7. 'Etc.'
  8. }
  9.  
  10. local mon = peripheral.wrap(monitorSide)
  11. local w,h = mon.getSize()
  12.  
  13. mon.setBackgroundColor(colors.white)
  14. mon.clear()
  15.  
  16. mon.setCursorPos((w - #title) / 2, 2)
  17. mon.setTextColor(colors.red)
  18. mon.write(title)
  19.  
  20. mon.setTextColor(colors.blue)
  21. for i=1, #list do
  22. mon.setCursorPos(3, 3 + i)
  23. mon.write(i..'. '..list[i])
  24. end
Advertisement
Add Comment
Please, Sign In to add comment