Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- KAS2 Disk Maker
- print("KAS2 Disk Maker")
- local disks = {}
- for i, v in pairs(peripheral.getNames()) do
- if peripheral.getType(v) == "drive" then
- if disk.isPresent(v) then
- table.insert(disks,v)
- end
- end
- end
- write("Disk Name: ")
- local name = read()
- local file = "**"
- while true do
- write("Game Executable File: ")
- file = read()
- if fs.exists(file) then
- break
- end
- end
- if #disks == 0 then
- error("No disks present.",0)
- elseif #disks == 1 then
- diskz = disks[1]
- else
- while true do
- for i, v in pairs(disks) do
- print(i..". "..v)
- end
- local choice = 0
- choice = tonumber(read())
- if choice > 0 and choice <= #disks then
- diskz = disks[choice]
- break
- end
- end
- end
- local list = fs.list(disk.getMountPath(diskz))
- for i, v in pairs(list) do
- fs.delete(disk.getMountPath(diskz).."/"..v)
- end
- disk.setLabel(diskz,name)
- local filez = fs.open(disk.getMountPath(diskz).."/kas2info","w")
- filez.write(textutils.serialize(({["name"] = name})))
- filez.close()
- fs.copy(file,disk.getMountPath(diskz).."/kas2game")
Advertisement
Add Comment
Please, Sign In to add comment