Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- mon0 = peripheral.wrap("monitor_0")
- mon1 = peripheral.wrap("monitor_1")
- mon0.clear()
- mon1.clear()
- button.initMon(mon0)
- button.initMon(mon1)
- --------------------------------
- function fillTable()
- button.setTable("Licht oben", button1, 2, 12, 2, 4)
- button.setTable("Licht unten", button2, 16, 26, 2, 4)
- button.setTable("Tor", button3, 2, 12, 6, 8)
- button.setTable("Tur", button4, 16, 26, 6, 8)
- button.setTable("Strom", button5, 2, 12, 10, 12)
- button.setTable("ME", button6, 16, 26, 10, 12)
- button.setTable("Button7", button7, 2, 12, 14, 16)
- button.setTable("Button8", button8, 16, 26, 14, 16)
- button.setTable("ALARM", button9, 2, 26, 18, 19)
- --------------------------------xmin-xmax-ymin-ymax
- button.screen(mon0)
- button.screen(mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button1()
- button.toggleButton("Licht oben",mon0)
- button.toggleButton("Licht oben",mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button2()
- button.toggleButton("Licht unten",mon0)
- button.toggleButton("Licht unten",mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button3()
- button.toggleButton("Tor", mon0)
- button.toggleButton("Tor", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button4()
- button.toggleButton("Tur", mon0)
- button.toggleButton("Tur", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button5()
- button.toggleButton("Strom", mon0)
- button.toggleButton("Strom", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button6()
- button.toggleButton("ME", mon0)
- button.toggleButton("ME", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button7()
- button.toggleButton("Button7", mon0)
- button.toggleButton("Button7", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button8()
- button.toggleButton("Button8", mon0)
- button.toggleButton("Button8", mon1)
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function button9()
- button.toggleButton("ALARM", mon0)
- button.toggleButton("ALARM", mon1)
- end
- -------------------------------------
- fillTable()
- while true do
- getClickt()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement