Advertisement
Guest User

Untitled

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