Advertisement
Guest User

startup

a guest
Jul 29th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. side = "left"
  2. count = 3
  3. i = 60
  4. while 1 == 1 do
  5.   term.clear()
  6.   term.setCursorPos(1,1)
  7.   print("Inserire Password...")
  8.   print("Rimangono ".. count .." tentativi")
  9.   local input = read("*")
  10.   file = fs.open("prova","r")
  11.   if input == file.readLine() then
  12.     term.clear()
  13.     term.setCursorPos(1,1)
  14.     print("Password esatta!")
  15.     rs.setOutput(side, true)
  16.     sleep(3)
  17.     rs.setOutput(side, false)
  18.     count = 3
  19.     file.close()
  20.   else
  21.     file.close()
  22.     print("Password Errata")
  23.     sleep(1)
  24.     count = count - 1
  25.     if count == 0 then
  26.       count = 3
  27.       while i > 0 do
  28.         term.clear()
  29.         term.setCursorPos(18,10)
  30.         print("Attendi ".. i .." secondi")
  31.         sleep(1)
  32.         i = i - 1
  33.       end
  34.       i = 60
  35.     end
  36.   end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement