Guest User

LightSystem

a guest
Jul 22nd, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. --mMultiOS
  2. --<~t<true>marcelOS<info<0||name<0|explorer>version<1|0.2>changePrint<2|false>eventfilter<0|mouse_click|window_resize|window_fullscreen>EventManager<3|true>Debug<3|true>>code<0|print("Hello, explorer run under marcelOS")>>other<info<0||name<0|explorer>version<2|0.2>>code<0|~i<23>print("Unknown OS ...")>>>
  3. Application.window = windows.CreateWindow( "LightSystem" , Application , true)
  4. Application.window:SetSize(40,35)
  5. Application.window:FindSpace(111)
  6.  
  7.  
  8. function Rahmen()
  9. function ComputerraumRahmen()
  10. Application.window.l:setFontColor( colours.white )
  11. term.setCursorPos(1,1)
  12. term.setBackgroundColor(colors.black)
  13. Application.window:print( "Computerraum:" )
  14. term.setCursorPos(15,1)
  15. term.setBackgroundColor(colors.green)
  16. Application.window:print( "On" )
  17. term.setCursorPos(20,1)
  18. term.setBackgroundColor(colors.red)
  19. Application.window:print( "Off" )
  20. term.setCursorPos(26,1)
  21. term.setBackgroundColor(colors.black)
  22. Application.window:print( "Status:" )
  23. end
  24. Application.window.l:setFontColor( colours.white )
  25. term.setCursorPos(1,2)
  26. term.setBackgroundColor(colors.black)
  27. Application.window:print( "----------------------------------------------------------------------------------------------------------------------------------------------------------" )
  28. function ServerraumRahmen()
  29. Application.window.l:setFontColor( colours.white )
  30. term.setCursorPos(1,3)
  31. term.setBackgroundColor(colors.black)
  32. Application.window:print( "Serverraum:" )
  33. term.setCursorPos(15,3)
  34. term.setBackgroundColor(colors.green)
  35. Application.window:print( "On" )
  36. term.setCursorPos(20,3)
  37. term.setBackgroundColor(colors.red)
  38. Application.window:print( "Off" )
  39. term.setCursorPos(26,3)
  40. term.setBackgroundColor(colors.black)
  41. Application.window:print( "Status:" )
  42. end
  43. Application.window.l:setFontColor( colours.white )
  44. term.setCursorPos(1,4)
  45. term.setBackgroundColor(colors.black)
  46. Application.window:print( "----------------------------------------------------------------------------------------------------------------------------------------------------------" )
  47. function TekkitraumRahmen()
  48. Application.window.l:setFontColor( colours.white )
  49. term.setCursorPos(1,5)
  50. term.setBackgroundColor(colors.black)
  51. Application.window:print( "Tekkitraum:" )
  52. term.setCursorPos(15,5)
  53. term.setBackgroundColor(colors.green)
  54. Application.window:print( "On" )
  55. term.setCursorPos(20,5)
  56. term.setBackgroundColor(colors.red)
  57. Application.window:print( "Off" )
  58. term.setCursorPos(26,5)
  59. term.setBackgroundColor(colors.black)
  60. Application.window:print( "Status:" )
  61. end
  62. Application.window.l:setFontColor( colours.white )
  63. term.setCursorPos(1,6)
  64. term.setBackgroundColor(colors.black)
  65. Application.window:print( "----------------------------------------------------------------------------------------------------------------------------------------------------------" )
  66. function LagerraumRahmen()
  67. Application.window.l:setFontColor( colours.white )
  68. term.setCursorPos(1,7)
  69. term.setBackgroundColor(colors.black)
  70. Application.window:print( "Lagerraum:" )
  71. term.setCursorPos(15,7)
  72. term.setBackgroundColor(colors.green)
  73. Application.window:print( "On" )
  74. term.setCursorPos(20,7)
  75. term.setBackgroundColor(colors.red)
  76. Application.window:print( "Off" )
  77. term.setCursorPos(26,7)
  78. term.setBackgroundColor(colors.black)
  79. Application.window:print( "Status:" )
  80. end
  81. Application.window.l:setFontColor( colours.white )
  82. term.setCursorPos(1,8)
  83. term.setBackgroundColor(colors.black)
  84. Application.window:print( "----------------------------------------------------------------------------------------------------------------------------------------------------------" )
  85.  
  86. while true do
  87. Application.window:Paint()
  88. mTask.sleepEvent(Application,1)
  89. ComputerraumRahmen()
  90. ServerraumRahmen()
  91. TekkitraumRahmen()
  92. LagerraumRahmen()
  93. end
  94.  
  95. end
  96. term.setBackgroundColor(colors.black)
  97.  
  98. while true do
  99. Rahmen()
  100. Eingabe()
  101. Application.window:Paint()
  102. mTask.sleepEvent(Application,1)
  103. end
  104. -- Dieser Teil funktioniert leider nicht :(
  105. function Eingabe()
  106. event,side,x,y = os.pullEvent()
  107. if event == "monitor_touch" then
  108.  
  109. if x == 15 and y == 1 or x == 16 and y == 1 then
  110. rs.setOutput("bottom", true)
  111. rednet.send(1, "ComputerraumLightOn") --Zahl= Id des Server
  112. end
  113.  
  114. if x == 20 and y == 1 or x == 21 and y == 1 or x == 22 and y == 1 then
  115. rednet.send(1, "ComputerraumLightOff") --Zahl= Id des Server
  116. end
  117.  
  118.  
  119.  
  120. if x == 15 and y == 3 or x == 16 and y == 3 then
  121. rednet.send(1, "ServerraumLightOn") --Zahl= Id des Server
  122. end
  123.  
  124. if x == 20 and y == 3 or x == 21 and y == 3 or x == 22 and y == 3 then
  125. rednet.send(1, "ServerraumLightOff") --Zahl= Id des Server
  126. end
  127.  
  128.  
  129.  
  130. if x == 15 and y == 5 or x == 16 and y == 5 then
  131. rednet.send(1, "TekkitraumLightOn") --Zahl= Id des Server
  132. end
  133.  
  134. if x == 20 and y == 5 or x == 21 and y == 5 or x == 22 and y == 5 then
  135. rednet.send(1, "TekkitraumLightOff") --Zahl= Id des Server
  136. end
  137.  
  138.  
  139.  
  140. if x == 15 and y == 7 or x == 16 and y == 7 then
  141. rednet.send(1, "LagerraumLightOn") --Zahl= Id des Server
  142. end
  143.  
  144. if x == 20 and y == 7 or x == 21 and y == 7 or x == 22 and y == 7 then
  145. rednet.send(1, "LagerraumLightOff") --Zahl= Id des Server
  146. end
  147.  
  148.  
  149. end
  150. end
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. while true do
  160. Rahmen()
  161. Eingabe()
  162. Application.window:Paint()
  163. mTask.sleepEvent(Application,1)
  164. end
Advertisement
Add Comment
Please, Sign In to add comment