Glampkoo

LockOS 0.1 [And a hacking floppy disk]

Oct 4th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.14 KB | None | 0 0
  1. --LockOS v0.1--
  2. --Startup of the Computer--
  3. function lock()
  4. os.pullEvent = os.pullEventRaw --Prevents from people using CTRL + T that is shutting down the program, you can only turn off and reboot the computer but still you need to type in the password--
  5.  term.clear()
  6.  term.setCursorPos(1,1)
  7.  sleep(1)
  8.   print("LockOS 0.1")
  9.  sleep(1)
  10.   write("Password: ")
  11.  pass = io.read()
  12.   if pass == "password here" then -- "password here" is the password that you gonna use--
  13.    term.clear()
  14.    term.setCursorPos(1,1)
  15.     textutils.slowPrint("Access granted. You may enter") -- textutils.slowPrint means it will slowly print the line. You can also use .slowWrite--
  16.    rs.setOutput("string side", true) --You put here side you choose for redstone it can be "left","right","front","back","bottom", and "top".--
  17.     sleep(?) --You put here the period of time when the object (door) is opened before it's closed. --
  18.    rs.setOutput("string side", false) --Let's close the door--
  19.    lock() -- restarts to its initial position (ln 3) if the password is correct--
  20.   else
  21.    textutils.slowWrite("Incorrect Password! Restarting")--I added these sleeps and dots to give a feeling that's loading and restarting :) --
  22.    sleep(1)
  23.    write(".")
  24.    sleep(1)
  25.    write(".")
  26.    sleep(1)
  27.    write(".")
  28.    sleep(2)
  29.    lock() --Restarting the proccess. Blip blop blup. --
  30.    end
  31.    end --Now let's close the ifs and whiles! --
  32.    lock() --I don't know why I need this one here but I tested it without this line and it didn't work. --
  33.  
  34. --Optional--
  35. --Hacking Floppy--
  36. --Note that I added these dots and sleeps to pretend that it's a real hacking program.--
  37.  
  38. function logo() -- The logo function --
  39.  term.clear()
  40.  term.setCursorPos(1,1)
  41.  print("AccessAll 0.5") --I named the program like that--
  42. end
  43.  
  44. function dots()
  45.  sleep(1)
  46.  write(".")
  47.  sleep(1)
  48.  write(".")
  49.  sleep(1)
  50.  write(".")
  51.  sleep(1)
  52. end
  53.  
  54. --The program starts here:--
  55.  logo() --Isn't it a lot easier when using function? You don't have to repeat--
  56. write("Hacking")
  57.  dots()
  58.  logo()
  59. write("Cracking")
  60.  dots()
  61.  logo()
  62. write("Loading preferences")
  63.  dots()
  64. print("Done hacking! Enjoy!")
  65.   sleep(2)
  66.  logo()
Add Comment
Please, Sign In to add comment