Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("right")
- monitor = peripheral.wrap("left")
- m.clear()
- function gotoln()
- local x, y = monitor.getCursorPos()
- if y1 == y then
- monitor.scroll(1)
- monitor.setCursorPos(1, y)
- else
- monitor.setCursorPos(1, y+1)
- end
- end
- function button1() button.toggleButton("porte")
- monitor.write("porte ouvert !")
- redstone.setOutput("bottom", true)
- sleep(0.1)
- redstone.setOutput("bottom", false)
- gotoln()
- sleep(1)
- button.toggleButton("Poulailler")
- end
- function button2() button.toggleButton("lumiere")
- monitor.write("lumiere allumer !")
- redstone.setOutput("back", true)
- sleep(0.1)
- redstone.setOutput("back", false)
- gotoln()
- sleep(1)
- button.toggleButton("Alarme")
- end
- function button3() button.toggleButton("Champs")
- monitor.write("Champs changer !")
- redstone.setOutput("top", true)
- sleep(0.1)
- redstone.setOutput("top", false)
- gotoln()
- sleep(1)
- button.toggleButton("Champs")
- end
- function ecran()
- button.setTable("Poulailler",button1,8,25,3,3)
- button.setTable("lumiere",button2,8,25,6,6)
- button.setTable("Champs",button3,8,25,9,9)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- ecran()
- while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement