Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Computer 0
- password = "password" --Change it to whatever you want!
- function keycard()
- debug_char = "0"
- term.clear()
- term.setCursorPos(1,1)
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
- print("{ }")
- print("{ }")
- print("{ }")
- print("{ }")
- print("{ }")
- print("{ Keycard System is running! }")
- print("{ }")
- print("{ Please insert your keycard! }")
- print("{ }")
- print("{ Put together by BigSeeProduction }")
- print("{ }")
- print("{ }")
- print("{ }")
- print("{ }")
- print("{ }")
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
- print()
- function mainLoop()
- while(true) do
- event, driveSide = os.pullEventRaw()
- if(event=="disk" and driveSide) then
- path = disk.getMountPath(driveSide)
- if(path) then
- path = path.."/access"
- file = fs.exists(path) and io.open(path, "r") or nil
- end
- disk.eject(driveSide)
- if(file and file:read()==password) then
- timerrunter()
- sleep(7)
- timerrauf()
- end
- if(file) then file:close() file = nil end
- elseif(debug_char and event=="char" and driveSide==debug_char) then return("break") end
- end
- end
- rs.setOutput("left", false)
- repeat
- ok, err, val = pcall(mainLoop)
- if(not ok and err) then
- if(err=="Terminated") then print ("Access denied.")
- else
- print(err)
- end
- end
- until(ok and err=="break")
- end
- function timerrauf()
- redstone.setBundledOutput("back", colors.white)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- sleep(0.8)
- redstone.setBundledOutput("back", colors.white)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- sleep(0.8)
- redstone.setBundledOutput("back", colors.white)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- end
- function timerrunter()
- redstone.setBundledOutput("back", colors.black)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- sleep(0.8)
- redstone.setBundledOutput("back", colors.black)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- sleep(0.8)
- redstone.setBundledOutput("back", colors.black)
- sleep(0.1)
- redstone.setBundledOutput("back", 0)
- end
- keycard()
Advertisement
Add Comment
Please, Sign In to add comment