Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("process").info().data.signal = function()end -- Blocking Ctrl+Alt+C
- local event = require('event')
- local term = require('term')
- local gpu = require('component').gpu
- local W, H = gpu.getResolution()
- local color1, color2 = 0x00FF00, 0xFF0000
- local password = '123456789' -- needed hash function, for most security
- event.shouldSoftInterrupt = function() return false end -- blocking Ctrl+C
- gpu.setForeground(color1)
- while true do
- term.clear()
- term.setCursor(W/2-10, H/2)
- term.write('PASSWORD: ')
- local input = tostring(term.read(_,_,_,'*')):sub(1, -2)
- if input == password then
- term.clear()
- term.setCursor(1, 1)
- gpu.setForeground(0xFFFFFF)
- os.exit()
- else
- term.clear()
- gpu.setForeground(color2)
- term.setCursor(W/2-6, H/2)
- term.write('ACCESS DENIED')
- gpu.setForeground(color1)
- os.sleep(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement