Guest User

securePasswordMaker

a guest
Jul 21st, 2015
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. output = {}
  2. fakeInput = {"l","o","l"," ","i","t","'","s"," ","n","o","t"," ","w","o","r","k","i","n","g"}
  3. charCount = 0
  4.  
  5. shell.run("clear")
  6. sleep(1)
  7. term.setCursorBlink(true)
  8.  
  9. while true do
  10.   event = nil
  11.   key = nil
  12.  
  13.   while event ~= "char" and key ~= 14 and key ~= 28 do
  14.     event, key = os.pullEvent()
  15.   end
  16.  
  17.   if key ~= 14 and key ~= 28 then
  18.     table.insert(output, key)
  19.     charCount = charCount + 1
  20.   elseif key == 14 then
  21.     table.remove(output, #output)
  22.     charCount = charCount - 1
  23.     sleep(.2)
  24.   else
  25.     break
  26.   end
  27.  
  28.   shell.run("clear")
  29.   for i=1,#output do if fakeInput[i] ~= nil then term.write(fakeInput[i]) end end
  30.  
  31.   term.setCursorBlink(true)
  32. end
  33.  
  34. term.setCursorPos(1,3)
  35. term.setTextColor(colors.green)
  36. for j=1,#output do term.write(output[j]) end
  37. term.setCursorPos(1,4)
Advertisement
Add Comment
Please, Sign In to add comment