Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Functions
- function topTime()
- while true do
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(11,2)
- print(textutils.formatTime(os.time(),true))
- sleep(0.1)
- end
- end
- function buttonToHomeSecurity()
- startX = 2
- startY = 4
- endX = 16
- endY = 6
- paintutils.drawFilledBox(startX,startY,endX,endY,colors.green)
- term.setCursorPos(startX + 1,startY + 1)
- print("Home Security")
- while true do
- event, button, x, y = os.pullEvent("mouse_click")
- if x > startX - 1 and y > startY - 1 and x < endX + 1 and y < endY + 1 and button == 1 then
- paintutils.drawFilledBox(startX,startY,endX,endY,colors.red)
- term.setCursorPos(startX + 1,startY + 1)
- print("Home Security")
- sleep(0.2)
- term.setCursorPos(7,1)
- print("Home Security")
- paintutils.drawFilledBox(13,4,16,6)
- parallel.waitForAll(buttonToOpenDoor)
- end
- end
- end
- function buttonToOpenDoor()
- startX = 2
- startY = 4
- endX = 12
- endY = 6
- paintutils.drawFilledBox(startX,startY,endX,endY,colors.green)
- term.setCursorPos(startX + 1,startY + 1)
- print("Open Door")
- while true do
- event, button, x, y = os.pullEvent("mouse_click")
- if x > startX - 1 and y > startY - 1 and x < endX + 1 and y < endY + 1 and button == 1 then
- paintutils.drawFilledBox(startX,startY,endX,endY,colors.red)
- term.setCursorPos(startX + 1,startY + 1)
- print("Open Door")
- rednet.send("1337",8)
- end
- end
- end
- --Code
- term.setBackgroundColor(colors.lightBlue)
- term.clear()
- term.setCursorPos(10,1)
- print("JardiOS")
- parallel.waitForAll(buttonToHomeSecurity,topTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement