Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local event = require("event")
- local gpu = component.gpu
- local term = require("term")
- local rs = component.redstone
- -- Config
- local delay = 5
- while true do
- -- GUI
- term.clear()
- gpu.setForeground(0x00FF00)
- print("--------------------------- ToNELvision MICROSYTEMS ---------------------------\n")
- gpu.setForeground(0xFFFFFF)
- print("Welcome. Please enter one of the displayed commands. It may take a few seconds for the command to be interpreted.\n")
- gpu.setForeground(0xE6AB38)
- print("Open")
- print("Close")
- gpu.setForeground(0xFFFFFF)
- term.setCursor(1,9)
- local input=io.read()
- if input == "Open" then
- rs.setOutput(side.right, 15)
- os.sleep(delay)
- rs.setOutput(side.right, 0)
- else
- wrong = true
- end
- -- Motion Sensor
- local id, _, x, y, entityName = event.pull("motion")
- rs.setOutput(sides.right, 15)
- os.sleep(delay)
- rs.setOutput(sides.right, 0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement