Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SCREENS = {"monitor_0", "monitor_1"}
- col={colors.white, colors.red, colors.green, colors.blue}
- M={}
- D={}
- for i, side in ipairs(SCREENS) do
- m=peripheral.wrap(side)
- m.clear()
- m.setTextScale()
- M[i]=m
- D[i]={color=colors.white}
- end
- running = true
- var = 10
- os.startTimer(0.2)
- while running do
- event, eside, x, y = os.pullEvent()
- if event=="timer" then
- os.startTimer(0.2)
- end
- for i, m in ipairs(M) do
- m.clear()
- m.setTextColor(D[i].color)
- m.setCursorPos(1, 1)
- m.write("+- WRGB")
- m.setCursorPos(1, 2)
- m.write(var)
- if event=="monitor_touch" and eside==SCREENS[i] then
- if y==1 then
- if x==1 then
- var=var+1
- elseif x==2 then
- var=var+2
- elseif x >=4 and x <= 7 then
- D[i].color=col[x-3]
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement