Advertisement
Guest User

login

a guest
May 30th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.87 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. user = "cyborg"
  4. pass = "cyborgtwins"
  5. lock = 0
  6.  
  7. logicArt = function()
  8. term.clear()
  9.  paintutils.drawFilledBox(1, 1, 51, 19, colors.yellow)
  10.  paintutils.drawFilledBox(6, 4, 45, 15, colors.white)
  11.  paintutils.drawLine(9, 8, 25, 8, colors.gray)
  12.  paintutils.drawLine(9, 11, 25, 11, colors.gray)
  13.  term.setTextColor(colors.blue)
  14.  term.setBackgroundColor(colors.white)
  15.  term.setCursorPos(27,8)
  16.  print("Username")
  17.  term.setCursorPos(27,11)
  18.  print("Password")
  19.  term.setBackgroundColor(colors.gray)
  20.   term.setCursorPos(17,2)
  21.   term.setTextColor(colors.red)
  22.   print(" Welcome to Login! ")
  23. end
  24.  
  25. logicBad = function()
  26.  lock = lock + 1
  27.  term.setTextColor(colors.red)
  28.  term.setCursorPos(15,13)
  29.  print("You are not me master!")
  30.   sleep(1)
  31.   if lock == 3 then
  32.    logicLockdown();
  33.   else
  34.    run();
  35.   end
  36. end
  37.  
  38. logicUser = function()
  39.  term.setCursorPos(9, 11)
  40.  term.setTextColor(colors.yellow)
  41.  term.setBackgroundColor(colors.gray)
  42.  print(">")
  43.  term.setCursorPos(9, 8)
  44.  write(">")
  45.  redOne = read()
  46.   if redOne == user then
  47.    logicPass();
  48.   else
  49.    logicPass();
  50.   end
  51. end
  52.  
  53. logicPass = function()
  54.  term.setCursorPos(9, 11)
  55.  write(">")
  56.  redTwo = read("*")
  57.   if redTwo == pass then
  58.    logicAcess();
  59.   else
  60.    logicBad();
  61.   end  
  62. end
  63.  
  64. logicAcess = function()
  65.  lock = 0
  66.  term.setCursorPos(12, 13)
  67.  term.setTextColor(colors.green)
  68.  print("Welcome", redOne, "to code land!")
  69.  sleep(3)
  70.   term.setBackgroundColor(colors.black)
  71.   term.clear()
  72.   term.setTextColor(colors.white)
  73.   term.setCursorPos(1,1)
  74.   shell.run("shell")
  75. end
  76.  
  77. logicLockdown = function()
  78.   lock = lock - 3
  79.   term.setBackgroundColor(colors.black)
  80.   term.clear()
  81.   term.setTextColor(colors.red)
  82.   term.setCursorPos(1,1)
  83.   for i=1,30 do
  84.    print("BAD")
  85.    sleep(1)
  86.   end
  87.   term.clear()
  88.   run();
  89. end
  90.  
  91. run = function()
  92.  logicArt();
  93.  logicUser();
  94. end
  95.  
  96. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement