Advertisement
Zeroji

Untitled

May 16th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. SCREENS = {"monitor_0", "monitor_1"}
  2. col={colors.white, colors.red, colors.green, colors.blue}
  3.  
  4. M={}
  5. D={}
  6. for i, side in ipairs(SCREENS) do
  7. m=peripheral.wrap(side)
  8. m.clear()
  9. m.setTextScale()
  10. M[i]=m
  11. D[i]={color=colors.white}
  12. end
  13.  
  14. running = true
  15. var = 10
  16.  
  17. os.startTimer(0.2)
  18. while running do
  19. event, eside, x, y = os.pullEvent()
  20. if event=="timer" then
  21. os.startTimer(0.2)
  22. end
  23.  
  24. for i, m in ipairs(M) do
  25. m.clear()
  26. m.setTextColor(D[i].color)
  27. m.setCursorPos(1, 1)
  28. m.write("+- WRGB")
  29. m.setCursorPos(1, 2)
  30. m.write(var)
  31.  
  32. if event=="monitor_touch" and eside==SCREENS[i] then
  33. if y==1 then
  34. if x==1 then
  35. var=var+1
  36. elseif x==2 then
  37. var=var+2
  38. elseif x >=4 and x <= 7 then
  39. D[i].color=col[x-3]
  40. end
  41. end
  42. end
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement