Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- declare and set up the monitor
- local attachedMonitor = peripheral.wrap("left")
- local attachedMonitor.setBackgroundColor(colors.black)
- local attachedMonitor.setTextColor(colors.white)
- local attachedMonitor.setTextScale(.5)
- local attachedMonitor.clear()
- -- show the button
- local attachedMonitor.setBackgroundColor(colors.blue)
- local attachedMonitor.setCursorPos(3,2)
- local attachedMonitor.write(string.rep(" ",10)) -- 10 spaces
- --Display the label
- local attachedMonitor.setTextColor (colors.white)
- local attachedMonitor.setCursorPos(3+2,2) -- remember 2 columns more for centering here
- local attachedMonitor.write("Button")
- -- reset to original text/background colors
- local attachedMonitor.setBackgroundColor(colors.black)
- local attachedMonitor.setTextColor(colors.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement