Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SEPERATOR = "======================================="
- local SYMBOL = "§"
- local PATTERN = "&"
- local REMOVE = "Â"
- function clear() shell.run("clear"); end
- function say(...) print(...); end
- function MAIN()
- clear()
- say("Finding disk drive...")
- local drive = peripheral.find("drive")
- assert(drive,"No disk drive.")
- --//////////////////////////////////////////////////////
- clear()
- say(SEPERATOR)
- say("Welcome to AdvancedFloppyRename!")
- say("Use the pattern '"..PATTERN.."C' to add color to labels.")
- say(SEPERATOR)
- say("Enter your new label text:")
- local labelText = PATTERN.."f"..io.read() --// resets the default italic
- labelText = string.gsub(labelText,PATTERN,SYMBOL)
- labelText = string.gsub(labelText,REMOVE,"")
- say(SEPERATOR.."\n")
- local renameSuccess = drive.setDiskLabel(labelText)
- assert((renameSuccess ~= true),"Disk cannot be renamed.")
- say("Renamed disk to \""..labelText.."\".\nEnd.\n")
- drive.ejectDisk()
- say(SEPERATOR)
- end
- MAIN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement