Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Password for door
- local Pass = '123'
- -- Admin Password Access to edit program
- local aPass = '1234'
- -- If output normaly high or low
- local NormalyOutput = false
- --Side to output (front,back,left,rigt,bottom,top)
- local output = 'back'
- -- Disable CTRL + T
- -- Setting to false requires a reboot
- local DisableTermination = false
- local input
- local Running = true
- if DisableTermination then
- os.pullEvent = os.pullEventRaw
- end
- function NewText()
- term.clear()
- term.setCursorPos(1,1)
- end
- function SetOutput(state)
- if not state then
- redstone.setOutput(output, NormalyOutput)
- else
- if NormalyOutput then
- redstone.setOutput(output, not state)
- else
- redstone.setOutput(output, state)
- end
- end
- end
- while Running do
- SetOutput()
- NewText()
- print('Please Enter Password:')
- input = read('*')
- if input == Pass then
- NewText()
- print('Opening...')
- SetOutput(true)
- sleep(2.5)
- NewText()
- print('Closing...')
- SetOutput(false)
- sleep(1)
- elseif input == aPass then
- NewText()
- print('Welcome Admin')
- Running = false
- else
- NewText()
- print('Wrong Password')
- sleep(2.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement