Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Monitor side ("front", "back", "left", "right", "top" or "bottom")
- local cmon = peripheral.wrap("top")
- --Start on or off? (0=off, 1=on)
- local state = 0
- while true do
- if state==1 then
- --Colour of the light ("white", "orange", "magenta", "lightBlue", "yellow", "lime", "pink", "gray", "lightGray", "cyan", "purple", "blue", "brown", "green", "red", "black")
- cmon.setBackgroundColor(colors.white)
- -- Do not change anything below this line
- cmon.clear()
- else
- cmon.setBackgroundColor(colors.black)
- cmon.clear()
- end
- event, side, x,y = os.pullEvent()
- if event == "monitor_touch" then
- state = (state + 1) % 2
- end
- end
Add Comment
Please, Sign In to add comment