Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("top")
- local function fillScreen(color)
- monitor.setBackgroundColor(color)
- local x,y = monitor.getSize()
- for i=1, y do
- monitor.setCursorPos(1,i)
- monitor.write(string.rep(" ", x))
- end
- end
- local function rsTimer(value)
- while true do
- rs.setBundledOutput("bottom", value)
- sleep(.5)
- rs.setBundledOutput("bottom", 0)
- sleep(.5)
- end
- end
- local selection = 1
- while true do
- local event = os.pullEvent()
- if event == "monitor_touch" then
- if selection == 1 then
- fillScreen(colors.green)
- selection = 2
- else
- fillScreen(colors.blue)
- selection = 1
- end
- elseif event == "redstone" then
- while rs.getInput("left") do
- rsTimer(selection)
- end
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment