Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Config
- local securityLevel = 9
- local keyPartLength = 10
- local sRsOutput = "bottom"
- local diskSide = "right"
- local iOpenTime = 3
- -- End of config
- term.clear()
- term.setCursorPos(1,1)
- -- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
- local sMKey = "B1SOK60PSX04GNUPTLCO5LHKJG54R3551HJL4ACIQHOLRPNK3DF21XLKI1NV6P2TMV4ZOJ5MAY7UYCWEAVJ067VGPJ"
- local stationKey = string.sub(sMKey, 1, securityLevel*keyPartLength)
- os.pullEvent = os.pullEventRaw
- while (true) do
- if (disk.isPresent(diskSide)) then
- if fs.exists("disk/key") then
- shell.run("disk/key")
- if (string.len(key) >= string.len(stationKey)) then
- key = string.sub(key, 1, securityLevel*keyPartLength)
- if (key == stationKey) then
- disk.eject(diskSide)
- rs.setOutput(sRsOutput, true)
- sleep(iOpenTime)
- rs.setOutput(sRsOutput, false)
- end
- else
- disk.eject(diskSide)
- end
- else
- disk.eject(diskSide)
- end
- end
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment