Craft4Cube

Reaktor

Aug 10th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. m = peripheral.wrap("left")
  2. A = colors.black
  3. B = colors.black
  4. C = colors.black
  5. D = colors.black
  6. function draw()
  7. print("LOADING...")
  8. m.setTextScale(3)
  9. m.clear()
  10. --LICHT
  11. m.setBackgroundColor(colors.black)
  12. m.setTextColor(colors.white)
  13. m.setCursorPos(1,1)
  14. m.write("Licht")
  15. m.setBackgroundColor(colors.green)
  16. m.setTextColor(colors.lime)
  17. m.setCursorPos(10,1)
  18. m.write("an")
  19. m.setTextColor(colors.orange)
  20. m.setBackgroundColor(colors.red)
  21. m.setCursorPos(13,1)
  22. m.write("aus")
  23. --MONITORE
  24. m.setBackgroundColor(colors.black)
  25. m.setTextColor(colors.white)
  26. m.setCursorPos(1,2)
  27. m.write("Monitore")
  28. m.setBackgroundColor(colors.green)
  29. m.setTextColor(colors.lime)
  30. m.setCursorPos(10,2)
  31. m.write("an")
  32. m.setBackgroundColor(colors.red)
  33. m.setTextColor(colors.orange)
  34. m.setCursorPos(13,2)
  35. m.write("aus")
  36. --KERN1
  37. m.setBackgroundColor(colors.black)
  38. m.setTextColor(colors.white)
  39. m.setCursorPos(1,3)
  40. m.write("Kern1")
  41. m.setBackgroundColor(colors.green)
  42. m.setTextColor(colors.lime)
  43. m.setCursorPos(10,3)
  44. m.write("an")
  45. m.setBackgroundColor(colors.red)
  46. m.setTextColor(colors.orange)
  47. m.setCursorPos(13,3)
  48. m.write("aus")
  49. --KERN2
  50. m.setBackgroundColor(colors.black)
  51. m.setTextColor(colors.white)
  52. m.setCursorPos(1,4)
  53. m.write("Kern2")
  54. m.setBackgroundColor(colors.green)
  55. m.setTextColor(colors.lime)
  56. m.setCursorPos(10,4)
  57. m.write("an")
  58. m.setBackgroundColor(colors.red)
  59. m.setTextColor(colors.orange)
  60. m.setCursorPos(13,4)
  61. m.write("aus")
  62. print("DRAW-COMPLETE")
  63. end
  64. draw()
  65.  
  66.  
  67. local inp = 1
  68. local count = 0
  69.  
  70. while true do
  71. event,side,x,y = os.pullEvent()
  72. if event == "monitor_touch" then
  73. print("SYSTEM-TOUCH")
  74. -- Licht an
  75. if x == 10 and y == 1 then
  76. A = colors.white
  77. end
  78. if x == 11 and y == 1 then
  79. A = colors.white
  80. end
  81. -- Licht aus
  82. if x == 13 and y == 1 then
  83. A = colors.black
  84. end
  85. if x == 14 and y == 1 then
  86. A = colors.black
  87. end
  88. if x == 15 and y == 1 then
  89. A = colors.black
  90. end
  91.  
  92. -- Monitore an
  93. if x == 10 and y == 2 then
  94. B = colors.yellow
  95. end
  96. if x == 11 and y == 2 then
  97. B = colors.yellow
  98. end
  99. -- Monitore aus
  100. if x == 13 and y == 2 then
  101. B = colors.black
  102. end
  103. if x == 14 and y == 2 then
  104. B = colors.black
  105. end
  106. if x == 15 and y == 2 then
  107. B = colors.black
  108. end
  109.  
  110. -- Kern1 an
  111. if x == 10 and y == 3 then
  112. C = colors.green
  113. end
  114. if x == 11 and y == 3 then
  115. C = colors.green
  116. end
  117. -- Kern1 aus
  118. if x == 13 and y == 3 then
  119. C = colors.black
  120. end
  121. if x == 14 and y == 3 then
  122. C = colors.black
  123. end
  124. if x == 15 and y == 3 then
  125. C = colors.black
  126. end
  127.  
  128. -- Kern2 an
  129. if x == 10 and y == 4 then
  130. D = colors.red
  131. end
  132. if x == 11 and y == 4 then
  133. D = colors.red
  134. end
  135. -- Kern2 aus
  136. if x == 13 and y == 4 then
  137. D = colors.black
  138. end
  139. if x == 14 and y == 4 then
  140. D = colors.black
  141. end
  142. if x == 15 and y == 4 then
  143. D = colors.black
  144. end
  145.  
  146.  
  147. end
  148. rs.setBundledOutput("back",A+B+C+D)
  149. end
Advertisement
Add Comment
Please, Sign In to add comment