Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1.  
  2. -- declare and set up the monitor
  3. local attachedMonitor = peripheral.wrap("left")
  4. attachedMonitor.setBackgroundColor(colors.black)
  5. attachedMonitor.setTextColor(colors.white)
  6. attachedMonitor.setTextScale(.5)
  7. attachedMonitor.clear()
  8.  
  9. -- show the button
  10. attachedMonitor.setBackgroundColor(colors.blue)
  11. attachedMonitor.setCursorPos(3,2)
  12. attachedMonitor.write(string.rep(" ",10)) -- 10 spaces
  13.  
  14. --Display the label
  15. attachedMonitor.setTextColor (colors.white)
  16. attachedMonitor.setCursorPos(3+2,2) -- remember 2 columns more for centering here
  17. attachedMonitor.write("Button")
  18.  
  19. -- reset to original text/background colors
  20. attachedMonitor.setBackgroundColor(colors.black)
  21. attachedMonitor.setTextColor(colors.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement