Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tscp = term.setCursorPos -- set cursor pos
- local tcl = term.clearLine -- clear line
- local tw = term.write -- write
- local tc = term.clear -- clear
- local tgs = term.getSize -- get size
- local tstc = term.setTextColor
- local tsbc = term.setBackgroundColor
- tc()
- tscp(1,1)
- print("Please enter the password to access sending files")
- print("To return to main menu, type `back`")
- print("===================================================")
- local input = read("*")
- local w, h = tgs()
- local red = colors.red
- local green = colors.green
- local white = colors.white
- local black = colors.black
- local function displayAccessGranted()
- tc()
- local message = "Access Granted"
- local x, y = math.floor(w / 2) - math.floor(string.len(message) / 2), math.floor(h / 2)
- tsbc(green)
- for i = 1, h do
- tscp(1, i)
- tw(" ")
- end
- tscp(x, y)
- tstc(black)
- print(message)
- sleep(1)
- tsbc(black)
- tc()
- tscp(1,1)
- end
- local function displayAccessDenied()
- sleep(0.2)
- term.clear()
- local message = "Access Denied"
- local x, y = math.floor(w / 2) - math.floor(string.len(message) / 2), math.floor(h / 2)
- tsbc(red)
- for i = 1, h do
- tscp(1, i)
- tw(" ")
- end
- tscp(x, y)
- tstc(black)
- print(message)
- sleep(1)
- tsbc(black)
- tc()
- shell.run(".menu")
- end
- if input == "124" then
- sleep(0.2)
- displayAccessGranted()
- sleep(0.2)
- tstc(white)
- shell.run("ios/.sendfile")
- elseif input == "back" then
- shell.run(".menu")
- else
- displayAccessDenied()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement