Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require('component')
- local gpu = com.gpu
- local term = require('term')
- local computer = require('computer')
- --Переменные:
- --Пароль
- local pass = '1234'
- --Максимальное кол-во попыток
- local max = 1
- --Текущий номер попытки
- local pop = 1
- --Что говорить, если пароль введен верно
- local str = {'CHECKING PASSWORD................................','UNLOCKING....WAIT.............................................................'}
- --Ставьте в функциях что-то,нужное вам
- --Если успешно введен пароль
- function ok()
- gpu.setForeground(0x006400)
- print('UNLOCK DONE!!')
- end
- --Если неуспешно введен пароль
- function no()
- end
- --Не трогать
- function unlock(str)
- for i = 1, #str do
- io.write(str:sub(i,i)) os.sleep(0.1)
- end
- end
- function info()
- term.clear()
- gpu.setForeground(0xFFFF00)
- print([[
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- [SNAKE SEC]
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- [CONTROL]
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ]])
- gpu.setForeground(0xFFFFFF)
- end
- while true do
- info()
- gpu.setForeground(0xFF0000)
- print('Попыток: [' .. pop .. '/' .. max .. ']')
- print('Введите код разблокировки:')
- io.write('>>')
- local v,s = pcall(io.read)
- if s == pass then
- for i = 1, #str do
- gpu.setForeground(0xFFFFFF)
- print(unlock(str[i]))
- end
- ok()
- gpu.setForeground(0xFFFFFF)
- break
- else
- no()
- print('WRONG PASSWORD!!!')
- computer.beep(1900,0.1)
- if pop < max then
- print('Try again!')
- os.sleep(1)
- pop = pop + 1
- else
- print('HASTA LA VISTA!')
- os.sleep(0.5)
- computer.shutdown(true)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement