Can now customise output 'folder' name

This commit is contained in:
neviyn 2021-11-06 15:21:18 +00:00
parent aa7b52debf
commit 3cf6049c09

View File

@ -2,13 +2,12 @@ import os
echo("Input KSM directory") echo("Input KSM directory")
let mainDir: string = readLine(stdin) let mainDir: string = readLine(stdin)
var playerName: string = ""
echo("If your ingame player name is not 'PLAYER' enter it now (otherwise press enter)") echo("If your ingame player name is not 'PLAYER' enter it now (otherwise press enter)")
playerName = readLine(stdin) let playerName: string = readLine(stdin)
if playerName == "": let userDir: string = mainDir & DirSep & "score" & DirSep & (if len(playerName) > 0: playerName else: "PLAYER")
playerName = "PLAYER" echo("Enter the name of the 'folder' to create (or just leave empty for 'Played')")
let userDir: string = mainDir & DirSep & "score" & DirSep & playerName let dirName: string = readLine(stdin)
let outFileName: string = mainDir & DirSep & "songs" & DirSep & "Played.fav" let outFileName: string = mainDir & DirSep & "songs" & DirSep & (if len(dirName) > 0: dirName & ".fav" else: "Played.fav")
var f: File var f: File
if open(f, outFileName, fmWrite): if open(f, outFileName, fmWrite):
try: try: