Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local password = "something random"
- local monitor = peripheral.wrap('top')
- while true do
- os.pullEvent('disk')
- local file = fs.open('disk/key', 'r')
- local content
- if file then
- content = file.readAll()
- file.close()
- end
- disk.eject('back')
- if content == password then
- rs.setOutput('front', true)
- monitor.setBackgroundColor(colors.lime)
- monitor.clear()
- sleep(3)
- else
- monitor.setBackgroundColor(colors.red)
- monitor.clear()
- sleep(1)
- end
- rs.setOutput('front', false)
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement