Advertisement
BlueMond

keyCard

Aug 14th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. local version = 1.43
  2. os.pullEvent = os.pullEventRaw
  3. local filename = "startup"
  4. local paste = "Z0AsBG4R"
  5.  
  6. local function update()
  7.     local url = "http://pastebin.com/raw.php?i="..paste
  8.     local temp = http.get(url)
  9.     local ver = temp.readLine()
  10.     if tonumber(string.sub(ver, 17)) ~= version then
  11.         fs.delete(filename)
  12.         shell.run("pastebin get "..paste.." "..filename)
  13.         shell.run(filename)
  14.         return true
  15.     end
  16.     return false
  17. end
  18.  
  19. local test = update()
  20. if test == true then
  21.     error()
  22. end
  23.  
  24. local pass = "cubetechlabs"
  25. rs.setOutput("bottom",true)
  26.  
  27. while true do
  28.     event = os.pullEvent()
  29.     if event == "disk" then
  30.         print("Disk inserted")
  31.         if fs.exists("disk/pass") then
  32.             local dir = fs.open("disk/pass","r")
  33.             if dir.readLine() == pass then
  34.                 disk.eject("top")
  35.                 rs.setOutput("bottom",false)
  36.                 sleep(6)
  37.                 rs.setOutput("bottom",true)
  38.             else
  39.                 print("incorrect pass")
  40.             end
  41.            
  42.         end
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement