Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkDisk()
- local result = false
- if disk.isPresent("left") or disk.isPresent("right") then
- result = true
- end
- return result
- end
- print("Please insert a disk into the drive")
- while true do
- local event, diskSide = os.pullEvent("disk")
- if checkDisk() then
- local mountPath = disk.getMountPath(diskSide)
- if fs.exists(mountPath .. "/user_id.txt") then
- print("Found user_id.txt")
- print("Found at " .. mountPath)
- local file = fs.open(mountPath .. "/user_id.txt", "r")
- -- Read the contents of the file
- local admin_user_id = file.readAll()
- -- Close the file
- file.close()
- else
- print("user_id.txt not found")
- end
- break
- end
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement