Advertisement
Guest User

startup.lua

a guest
Apr 7th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. loop = 1
  2. try = 0
  3. while loop == 1 do
  4.   term.setBackgroundColor(colors.lightBlue)
  5.   paintutils.drawFilledBox(1,1,51,19)
  6.   term.setTextColor(colors.white)
  7.   term.setCursorPos(15,9)
  8.   write("Username: ")
  9.   term.setBackgroundColor(colors.cyan)
  10.   write("          ")
  11.   term.setBackgroundColor(colors.lightBlue)
  12.   term.setCursorPos(15,11)
  13.   write("Password: ")
  14.   term.setBackgroundColor(colors.cyan)
  15.   write("          ")
  16.   if try > 0 then
  17.     term.setCursorPos(15,17)
  18.     term.setBackgroundColor(colors.lightBlue)
  19.     term.setTextColor(colors.red)
  20.     write("Wrong username or password.")
  21.     term.setCursorPos(20,19)
  22.     write(3-try .."tries left")
  23.     term.setTextColor(colors.white)
  24.     term.setBackgroundColor(colors.cyan)
  25.   end
  26.   term.setCursorPos(25,9)
  27.   name = read()
  28.   term.setCursorPos(25,11)
  29.   pass = read("*")
  30.   if name == "Lotuska" and pass == "123457" then
  31.     loop = 0
  32.     term.setBackgroundColor(colors.black)
  33.     shell.run("desktop.lua")
  34.   else
  35.     try = try+1
  36.     if try == 3 then
  37.       time = 3600
  38.       while time > 0 do
  39.         time2 = time/60
  40.         time2 = math.floor(time2 + 0.5)
  41.         term.setCursorPos(18,10)
  42.         term.setBackgroundColor(colors.lightBlue)
  43.         term.setTextColor(colors.red)
  44.         write("Locked for more " ..time2.. " minutes.")
  45.         time = time-1
  46.         sleep(1)
  47.       end
  48.     end
  49.   end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement