Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait = 3
- side = "top"
- doorSide = "back"
- scan = peripheral.wrap(side)
- function cut()
- sleep(1.5)
- shell.run("clear")
- sleep(0.5)
- end
- function door()
- rs.setOutput(doorSide, true)
- sleep(wait)
- rs.setOutput(doorSide, false)
- end
- function check()
- if fs.exists("codelist") == true then
- flo = fs.open("codelist", "r")
- count = flo.readAll()
- fs.close()
- if string.match(count) == true then
- pass = true
- else
- print("NO MATCH!")
- swiper()
- end
- print(count .. "Hinzugefügt")
- cut()
- else
- fs.makeDir("codelist")
- check()
- end
- end
- function swiper()
- while true do
- evt, data, side1 = os.pullEvent("mag_swipe")
- check()
- if pass == true then
- door()
- end
- sleep(0.01)
- end
- end
- while true do
- start()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement