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