Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. mouseWidth = 0
  2. mouseHeight = 0
  3.  
  4. monitor = peripheral.wrap("top")
  5.  
  6. side="back"
  7. rs.setOutput(side,true)
  8. redstone.setOutput(side,true)
  9.  
  10. monitor.clear()
  11.  
  12. monitor.setCursorPos(1,1)
  13.  
  14. w,h=monitor.getSize()
  15.  
  16. print(w)
  17. print(h)
  18.  
  19.  
  20.  
  21. monitor.setCursorPos(4,3)
  22. monitor.write(" ON ")
  23. monitor.setBackgroundColor((colors.lime))
  24.  
  25. monitor.setCursorPos(15,3)
  26. monitor.write(" ON ")
  27. monitor.setBackgroundColor((colors.lime))
  28.  
  29. monitor.setCursorPos(24,3)
  30. monitor.write(" ON ")
  31. monitor.setBackgroundColor((colors.lime))
  32.  
  33. monitor.setCursorPos(33,3)
  34. monitor.write(" ON ")
  35. monitor.setBackgroundColor((colors.lime))
  36.  
  37.  
  38.  
  39. monitor.setCursorPos(4,9)
  40. monitor.write(" ON ")
  41. monitor.setBackgroundColor((colors.lime))
  42.  
  43. monitor.setCursorPos(15,9)
  44. monitor.write(" ON ")
  45. monitor.setBackgroundColor((colors.lime))
  46.  
  47. monitor.setCursorPos(24,9)
  48. monitor.write(" ON ")
  49. monitor.setBackgroundColor((colors.lime))
  50.  
  51. monitor.setCursorPos(33,9)
  52. monitor.write(" ON ")
  53. monitor.setBackgroundColor((colors.lime))
  54.  
  55.  
  56.  
  57. monitor.setCursorPos(4,15)
  58. monitor.write(" ON ")
  59. monitor.setBackgroundColor((colors.lime))
  60.  
  61. monitor.setCursorPos(15,15)
  62. monitor.write(" ON ")
  63. monitor.setBackgroundColor((colors.lime))
  64.  
  65. monitor.setCursorPos(24,15)
  66. monitor.write(" ON ")
  67. monitor.setBackgroundColor((colors.lime))
  68.  
  69. monitor.setCursorPos(33,15)
  70. monitor.write(" ON ")
  71. monitor.setBackgroundColor((colors.lime))
  72.  
  73.  
  74.  
  75. monitor.setCursorPos(4,21)
  76. monitor.write(" ON ")
  77. monitor.setBackgroundColor((colors.lime))
  78.  
  79. monitor.setCursorPos(15,21)
  80. monitor.write(" ON ")
  81. monitor.setBackgroundColor((colors.lime))
  82.  
  83. monitor.setCursorPos(24,21)
  84. monitor.write(" ON ")
  85. monitor.setBackgroundColor((colors.lime))
  86.  
  87. monitor.setCursorPos(33,21)
  88. monitor.write(" ON ")
  89. monitor.setBackgroundColor((colors.lime))
  90.  
  91.  
  92.  
  93. function checkClickPosition()
  94. if mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 3 then
  95. redstone.setBundledOutput(side,colors.red)
  96. elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 3 then
  97. redstone.setBundledOutput(side,colors.green)
  98. elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 3 then
  99. redstone.setBundledOutput(side,colors.brown)
  100. elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 3 then
  101. redstone.setBundledOutput(side,colors.blue)
  102. elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 9 then
  103. redstone.setBundledOutput(side,colors.purple)
  104. elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 9 then
  105. redstone.setBundledOutput(side,colors.cyan)
  106. elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 9 then
  107. redstone.setBundledOutput(side,colors.lightgray)
  108. elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 9 then
  109. redstone.setBundledOutput(side,colors.gray)
  110. elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 15 then
  111. redstone.setBundledOutput(side,colors.pink)
  112. elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 15 then
  113. redstone.setBundledOutput(side,colors.lime)
  114. elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 15 then
  115. redstone.setBundledOutput(side,colors.yellow)
  116. elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 15 then
  117. redstone.setBundledOutput(side,colors.lightblue)
  118. elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 21 then
  119. redstone.setBundledOutput(side,colors.magenta)
  120. elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 21 then
  121. redstone.setBundledOutput(side,colors.orange)
  122. elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 21 then
  123. redstone.setBundledOutput(side,colors.white)
  124. elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 21 then
  125. redstone.setBundledOutput(side,colors.black)
  126.  
  127. end
  128. end
  129.  
  130. repeat
  131. event,p1,p2,p3 = os.pullEvent()
  132.  
  133.  
  134. if event=="monitor_touch" then
  135.  
  136. mouseWidth = p2
  137. mouseHeight = p3
  138. checkClickPosition()
  139.  
  140. end
  141.  
  142. until event=="char" and p1==("x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement