Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- local m = peripheral.wrap("back")
- local mx, my = m.getSize()
- function getClick()
- local event, side, x, y = os.pullEvent()
- if event == "monitor_touch" then
- button.checkxy(x, y)
- end
- end
- function schutz()
- addText()
- --button.toggleButton("Schutz")
- if button.active("Schutz") then
- -- print("now on")
- rs.setOutput("left", false)
- button.standby()
- button.setName("Schutz", "Produktion angehalten ...")
- else
- -- print("now off")
- rs.setOutput("left", true)
- button.standby()
- button.setName("Schutz", "Produktion lÄA4uft ...")
- end
- button.toggleButton("Schutz")
- button.save()
- addText()
- end
- function fillMainTable()
- m.clear()
- addText()
- button.clearTable()
- button.setTable("Schutz", schutz, "", 2, mx-1, 2, my-1, "Haus ungesichert!")
- button.screen()
- end
- function addText()
- local text = "Solarpanelfabrik" local mx, my = m.getSize()
- m.setBackgroundColor(colors.black)
- m.setCursorPos((mx/2-#text/2)+1 , 1)
- m.write(text)
- end
- addText()
- fillMainTable()
- button.load()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement