этот текст нужно скопировать в файл с расширением bat, в эту же папку скопировать логи combat.log и game.log. или батник скопировать к ним. результатом будет сводка по логам в файле battle.log
ECHO off
COLOR 02
TITLE STAR-CONFLICT
CLS
ECHO This program cr. for calculeted results of game Star-conflict. It use files game.log and combat.log in. All files must be in folder. Results saves in battle.log
IF EXIST battle.log DEL battle.log
SETLOCAL enabledelayedexpansion
REM Short combat.log
COPY combat.log c0.log
ECHO Deleting spawn…
FIND /v “Spawn” c0.log > c1.log
ECHO Deleting apply…
FIND /v “Apply” c1.log > c2.log
ECHO Deleting reward…
FIND /v “Reward” c2.log > c3.log
ECHO Deleting cancel…
FIND /v “Cancel” c3.log >c4.log
ECHO Deleting spell…
FIND /v “Spell” c4.log > c5.log
ECHO Deleting damage…
FIND /v “Damage” c5.log > c6.log
ECHO Deleting heal…
FIND /v “Heal” c6.log > c7.log
ECHO Deleting rocket…
FIND /v “Rocket” c7.log > c8.log
ECHO Deleting set stage…
FIND /v “Set stage” c8.log > c9.log
ECHO Deleting addStack…
FIND /v “AddStack” c9.log > c10.log
ECHO Creating short log
IF EXIST c11.log DEL c11.log
::deleting void string in combat and game.log
FOR /f “tokens=*” %%a IN (c10.log) DO ECHO %%a>>c11.log
FOR /f “tokens=*” %%a IN (game.log) DO ECHO %%a>>g11.log
REM end short
REM separate combat.log and game.log by battles
ECHO Separate log by battles
:: writing labels in combat.log
FIND /n “Start gameplay” c11.log>la.t
IF EXIST labels.t DEL labels.t
FOR /f “delims=[]” %%q IN (la.t) DO (
SET lastnum=%%q
ECHO %%q>>labels.t
)
DEL la.t
SET /a lastnum=%lastnum%+1
ECHO %lastnum%>>labels.t
:: writed labels
:: create combats parts
SET /a numstr=0
SET /a sepstr=0
SET /a ext=0
DEL combat_part.*
FOR /f “tokens=*” %%o IN (c11.log) DO (
SET /a numstr=!numstr!+1
IF !numstr! GEQ !sepstr! (
SET /a vl=0
FOR /f “eol=- tokens=*” %%r IN (labels.t) DO (
IF !sepstr! LSS %%r (
IF !vl!==0 (
SET /a sepstr=%%r
IF !ext! LSS 10 (SET filename=combat_part.0!ext!) ELSE (SET filename=combat_part.!ext!)
ECHO Create !filename!
SET /a vl=1
SET /a ext=!ext!+1
)
)
)
)
ECHO %%o>>!filename!
)
DEL c??.log
:: end combats parts
:: create players part
:: writing labels in games.log
FIND /n “starting level: ‘levels\mainmenu\mm_alidium’” g11.log>la.t
IF EXIST labels.t DEL labels.t
FOR /f “delims=[]” %%q IN (la.t) DO (
SET lastnum=%%q
ECHO %%q>>labels.t
)
DEL la.t
SET /a lastnum=%lastnum%+1
ECHO %lastnum%>>labels.t
:: writed labels
:: create players parts
SET /a numstr=0
SET /a sepstr=0
SET /a ext=0
DEL player_part.*
FOR /f “tokens=*” %%o IN (g11.log) DO (
SET /a numstr=!numstr!+1
IF !numstr! GEQ !sepstr! (
SET /a vl=0
FOR /f “eol=- tokens=*” %%r IN (labels.t) DO (
IF !sepstr! LSS %%r (
IF !vl!==0 (
SET /a sepstr=%%r
IF !ext! LSS 10 (SET filename=player_part.0!ext!) ELSE (SET filename=player_part.!ext!)
ECHO Create !filename!
SET /a vl=1
SET /a ext=!ext!+1
)
)
)
)
ECHO %%o>>!filename!
)
DEL g11.log
DEL labels.t
:: end players parts
::add combat + players
COPY combat_part.*+player_part.* combat_.*
ECHO Separated
REM clean trash
DEL combat_part.*
DEL player_part.*
REM end saparating block
IF EXIST purecombat.log DEL purecombat.log
FOR /f “usebackq tokens=*” %%f IN (DIR /b/od combat_.*
) DO (
REM begin block players
SET currentfile=%%f
IF EXIST plr.t2 DEL plr.t2
FOR /f “usebackq tokens=2 delims=(,” %%i IN (FIND "ADD_PLAYER" %%f
) DO ECHO %%i >> plr2.t
FIND /V “[]” plr2.t > plr.t
IF EXIST plr2.t DEL plr2.t
SORT plr.t /o plr.t
IF EXIST playerslist.log DEL playerslist.log
FOR /f “usebackq skip=2 delims=;” %%i IN (plr.t) DO (
IF NOT %%i==!j! (ECHO %%i>>playerslist.log)
SET j=%%i
)
IF EXIST plr.t DEL plr.t
REM end block players
REM begin kill block
SET nf=%%f
ECHO Start !nf!
FOR /f "usebackq tokens=3,4,5,6,7,8 delims= | " %%a IN (FIND "Killed" !nf!
) DO (
IF “%%a” == “Killed” (SET kd=%%b)
IF “%%b” == “Killed” (SET kd=%%c)
IF “%%c” == “Killed” (SET kd=%%d)
IF “%%d” == “Killed” (SET kd=%%e)
IF “%%e” == “Killed” (SET kd=%%f)
IF “%%a” == “killer” (SET kr=%%b)
IF “%%b” == “killer” (SET kr=%%c)
IF “%%c” == “killer” (SET kr=%%d)
IF “%%d” == “killer” (SET kr=%%e)
IF “%%e” == “killer” (SET kr=%%f)
FIND “!kd!” playerslist.log
IF !ERRORLEVEL!==0 (SET /a killedtrue=1) ELSE (SET /a killedtrue=0)
FIND “!kr!” playerslist.log
IF !ERRORLEVEL!==0 (SET /a killertrue=1) ELSE (SET /a killertrue=0)
SET /a k1ll=!killertrue!+!killedtrue!
IF !k1ll!==2 (ECHO !kr! !kd! >> purecombat.log)
)
IF EXIST purecombat.log (
REM end kill block
REM begin listing block
ECHO —BATTLE—
REM head string
::get name game
SET /a ns=0
FOR /f “tokens=*” %%S IN (!currentfile!) DO (
IF !ns!==0 (ECHO %%S>>battle.log
ECHO %%S
SET /a ns=1
)
)
SET str0=NAME TAG KILLS DIES
ECHO NAME TAG KILLS DIES
FOR /f “tokens=1” %%l IN (playerslist.log) DO SET str0=!str0! %%l
ECHO !str0!>>battle.log
REM end head
FOR /f “tokens=1,2” %%m IN (playerslist.log) DO (
SET str1=
SET /a totkil=0
REM cycle for kills
FOR /f “tokens=1” %%o IN (playerslist.log) DO (
FIND /c “%%m %%o” purecombat.log > num.t
FOR /f “tokens=3” %%I IN (num.t) DO (SET str1=!str1! %%I & SET /a totkil=!totkil!+%%I)
)
REM cycle for dies
SET /a totdi=0
FOR /f “tokens=1” %%p IN (playerslist.log) DO (
FIND /c “%%p %%m” purecombat.log > num.t
FOR /f “tokens=3” %%P IN (num.t) DO (SET /a totdi=!totdi!+%%P)
)
ECHO %%m %%n !totkil! !totdi! !str1!>>battle.log
ECHO %%m %%n !totkil! !totdi!
)
ECHO ===== End battle =====>>battle.log
REM end listing block
IF EXIST num.t DEL num.t
IF EXIST purecombat.log DEL purecombat.log
)
)
IF EXIST playerslist.log DEL playerslist.log
REM clean trash
DEL combat_.*
REM end program
ECHO Press key for finish. Data saves to battle.log
PAUSE
COLOR
ENDLOCAL