FOnline: Ashes of Phoenix

Game improvements => Suggestions => Topic started by: paragon on September 11, 2014, 10:43:47 AM

Title: Do not update / backup user modified files [hand-made solution]
Post by: paragon on September 11, 2014, 10:43:47 AM
I can do it manually for sure, but if it's not hard, it could be useful.
hotkeys.ini, NameColorizing.txt, DataFiles.cfg, Fonline.cfg
Title: Re: Do not update / backup user modified files
Post by: paragon on September 13, 2014, 03:27:24 AM
Windows run script for FOnline.exe, put it to the game folder and run from there.

It makes back ups for *.cfg *.ini *.txt *.cmd to the folder AoP-client-config-backup next to the folder it has been run from.
Than it runs update-colorizer.cmd
Than it runs FOnline.exe

Back up is made with date-time so you'll have all copies if there're changes.

Don't forget to set up in properties of shortcut "run minimized" to hide the script window.

https://www.dropbox.com/sh/z9zxk2vn49jbe85/AABp3u5d88r0nxNDrrxBPR9Va?dl=0 (https://www.dropbox.com/sh/z9zxk2vn49jbe85/AABp3u5d88r0nxNDrrxBPR9Va?dl=0)

@REM coding:OEM
SETLOCAL ENABLEEXTENSIONS
SET scriptdir=%~dp0
REM remove trailing backslash
SET scriptdir=%scriptdir:~0,-1%
SET backupsdir=%scriptdir%-config-backup

IF NOT EXIST "%backupsdir%" MKDIR "%backupsdir%"
FOR %%I IN (*.cfg *.ini *.txt *.cmd) DO CALL :copyWithBackup "%%~I"

CALL update-colorizer.cmd
START "" "FOnline.exe"

EXIT /B

:copyWithBackup <source>
    SET dest=%backupsdir%\%~nx1
    IF EXIST "%dest%" (
   FC /B %1 "%dest%" >NUL
   rem 2 = one of files cannot be read
   IF ERRORLEVEL 2 (PAUSE & EXIT)
   rem 1 = different
   IF ERRORLEVEL 1 CALL :renameByDate "%dest%"
   rem 0 = no difference
    )
   
    XCOPY %1 "%backupsdir%" /Y
EXIT /B

:renameByDate <file>
    FOR %%J IN (%1) DO SET datetime=%%~tJ
    SET destname=%1 %datetime::=%
    REN %1 "%destname%"
EXIT /B
Title: Re: Do not update / backup user modified files
Post by: paragon on September 13, 2014, 03:40:58 AM
Downloads colorizing from inputted URL. Don't forget to change it until you want to download mine (:
Put it in the folder you want to have your downloaded file (probably game folder)
Put wget.exe in the folder with the script. For example, http://gnuwin32.sourceforge.net/packages/wget.htm (official)

@REM coding:OEM
REM get wget anywhere, for example http://gnuwin32.sourceforge.net/packages/wget.htm (official)
REM or http://eternallybored.org/misc/wget/ (newer)
wget.exe --no-check-certificate -N https://dl.dropboxusercontent.com/u/100575405/NameColorizing.txt

https://dl.dropboxusercontent.com/u/100575405/colorizer-update.cmd
Title: Re: Do not update / backup user modified files [hand-made solution]
Post by: paragon on September 14, 2014, 07:38:09 AM
update-colorizer.ahk : auto replace some nicks with yours (e.g. if your colorize maker puts his nicknames in special section. AutoHotKey required

https://www.dropbox.com/sh/z9zxk2vn49jbe85/AABp3u5d88r0nxNDrrxBPR9Va?dl=0
Title: Re: Do not update / backup user modified files [hand-made solution]
Post by: FlyWheenRunner on September 14, 2014, 08:45:34 AM
I'd like to +1 that, but here is no way to do so.
Title: Re: Do not update / backup user modified files [hand-made solution]
Post by: paragon on September 14, 2014, 08:59:24 AM
Cus it's yours xD