Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Mtest

DerMarten Jul 28th, 2015 196 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. os.loadAPI("button")
  2. mon0 = peripheral.wrap("monitor_0")
  3. mon1 = peripheral.wrap("monitor_1")
  4. mon0.clear()
  5. mon1.clear()
  6. button.initMon(mon0)
  7. button.initMon(mon1)
  8. --------------------------------
  9. function fillTable()
  10.   button.setTable("Licht oben", button1, 2, 12, 2, 4)
  11.   button.setTable("Licht unten", button2, 16, 26, 2, 4)
  12.   button.setTable("Tor", button3, 2, 12, 6, 8)
  13.   button.setTable("Tur", button4, 16, 26, 6, 8)
  14.   button.setTable("Strom", button5, 2, 12, 10, 12)
  15.   button.setTable("ME", button6, 16, 26, 10, 12)
  16.   button.setTable("Button7", button7, 2, 12, 14, 16)
  17.   button.setTable("Button8", button8, 16, 26, 14, 16)
  18.   button.setTable("ALARM", button9, 2, 26, 18, 19)
  19. --------------------------------xmin-xmax-ymin-ymax
  20.   button.screen(mon0)
  21.   button.screen(mon1)
  22. end
  23.  
  24. function getClickt()
  25.   event, side,x,y = os.pullEvent("monitor_touch")
  26.   button.checkxy(x,y)
  27. end
  28. function button1()
  29.   button.toggleButton("Licht oben",mon0)
  30.   button.toggleButton("Licht oben",mon1)
  31. end
  32. function getClickt()
  33.   event, side,x,y = os.pullEvent("monitor_touch")
  34.   button.checkxy(x,y)
  35. end
  36. function button2()
  37.   button.toggleButton("Licht unten",mon0)
  38.   button.toggleButton("Licht unten",mon1)
  39. end
  40. function getClickt()
  41.   event, side,x,y = os.pullEvent("monitor_touch")
  42.   button.checkxy(x,y)
  43. end
  44. function button3()
  45.   button.toggleButton("Tor", mon0)
  46.   button.toggleButton("Tor", mon1)
  47. end
  48. function getClickt()
  49.   event, side,x,y = os.pullEvent("monitor_touch")
  50.   button.checkxy(x,y)
  51. end
  52. function button4()
  53.   button.toggleButton("Tur", mon0)
  54.   button.toggleButton("Tur", mon1)
  55. end
  56. function getClickt()
  57.   event, side,x,y = os.pullEvent("monitor_touch")
  58.   button.checkxy(x,y)
  59. end
  60. function button5()
  61.   button.toggleButton("Strom", mon0)
  62.   button.toggleButton("Strom", mon1)
  63. end
  64. function getClickt()
  65.   event, side,x,y = os.pullEvent("monitor_touch")
  66.   button.checkxy(x,y)
  67. end
  68. function button6()
  69.   button.toggleButton("ME", mon0)
  70.   button.toggleButton("ME", mon1)
  71. end
  72. function getClickt()
  73.   event, side,x,y = os.pullEvent("monitor_touch")
  74.   button.checkxy(x,y)
  75. end
  76. function button7()
  77.   button.toggleButton("Button7", mon0)
  78.   button.toggleButton("Button7", mon1)
  79. end
  80. function getClickt()
  81.   event, side,x,y = os.pullEvent("monitor_touch")
  82.   button.checkxy(x,y)
  83. end
  84. function button8()
  85.   button.toggleButton("Button8", mon0)
  86.   button.toggleButton("Button8", mon1)
  87. end
  88. function getClickt()
  89.   event, side,x,y = os.pullEvent("monitor_touch")
  90.   button.checkxy(x,y)
  91. end
  92. function button9()
  93.   button.toggleButton("ALARM", mon0)
  94.   button.toggleButton("ALARM", mon1)
  95. end
  96. -------------------------------------
  97. fillTable()
  98. while true do
  99.   getClickt()
  100. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top