Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Initialisieren
- rednet.open("front")
- mon = peripheral.wrap("top")
- mon.clear()
- mon.setTextScale(1)
- --Boot
- function Boot()
- zeile1 = "+---------------------------+"
- zeile2 = "| |"
- zeile3 = "| Wilkommen Cedricator |"
- zeile4 = "| |"
- zeile5 = "+---------------------------+"
- mon.setCursorPos(1,1)
- mon.write(zeile1)
- mon.setCursorPos(1,2)
- mon.write(zeile2)
- mon.setCursorPos(1,3)
- mon.write(zeile3)
- mon.setCursorPos(1,4)
- mon.write(zeile4)
- mon.setCursorPos(1,5)
- mon.write(zeile5)
- sleep(3)
- end
- Boot()
- rs.setOutput("right", true)
- sleep(1)
- rs.setOutput("back", true)
- sleep(1)
- rs.setOutput("left", true)
- sleep(1)
- function button_ON()
- mon.setBackgroundColor(colors.lime)
- mon.setCursorPos(3,3)
- mon.write(" Power I ")
- mon.setBackgroundColor(colors.black)
- end
- function button_OFF()
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(19,3)
- mon.write(" Power 0 ")
- mon.setBackgroundColor(colors.black)
- end
- function Overlay()
- mon.clear()
- zeile1 = "+---------------------------+"
- zeile2 = "| |"
- zeile3 = "| |"
- zeile4 = "| |"
- zeile5 = "+---------------------------+"
- mon.setCursorPos(1,1)
- mon.write(zeile1)
- mon.setCursorPos(1,2)
- mon.write(zeile2)
- mon.setCursorPos(1,3)
- mon.write(zeile3)
- mon.setCursorPos(1,4)
- mon.write(zeile4)
- mon.setCursorPos(1,5)
- mon.write(zeile5)
- button_ON()
- button_OFF()
- end
- --Overlay
- Overlay()
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 2 and x < 12 and y == 3 then
- rednet.send(401, "Trigger")
- rednet.send(401, "ON")
- end
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 19 and x < 27 and y == 3 then
- rednet.send(401, "Trigger")
- rednet.send(401, "OFF")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement