Code: Select all
@echo off
SET HISCORE=
SET ROM=
if "%1"=="" goto help
:: Find best score of a game
:: check /ROM option (it doesn't mind if you typed /rom , /RoM ,...)
echo ' %1 ' | find " /ROM " /i > NUL
if not errorlevel 1 SET ROM=1
if not "%ROM%"=="" goto rom
echo ' %2 ' | find " /ROM " /i > NUL
if not errorlevel 1 SET ROM=2
if not "%ROM%"=="" goto rom
:game
:: Find hiscore by name of the game (last column)
if not "%HISCORE%"=="" SET HISCORE=%HISCORE% %1
if "%HISCORE%"=="" SET HISCORE=%1
shift
if not "%1"=="" goto game
find /i " : %HISCORE%" scores.htm | more
goto finish
:rom
:: Find hiscore by name of the ROM (first column)
IF "%ROM%"=="1" set HISCORE=%2
IF "%ROM%"=="2" set HISCORE=%1
if "%HISCORE%"=="" echo You didn't type the ROM.
if "%HISCORE%"=="" goto fin
find /i " %HISCORE% :" scores.htm | more
goto finish
:help
:: The help
echo You can use this to search the best scores. If you don't search
echo by ROM, you can get several games (example: Space Invaders).
echo.
echo HISCORE game_name
echo HISCORE /ROM rom_name
echo HISCORE rom_name /ROM
echo.
echo Options:
echo /ROM : You search by rom name instead of game name.
echo.
echo Examples:
echo HISCORE /ROM strhoop
echo HISCORE strhoop /ROM
echo HISCORE street hoop
echo HISCORE donkey kong
echo HISCORE PACMAN /rom
echo.
goto finish
:finish
SET HISCORE=
SET ROM=
