I really like this feature and thought I would document it here in case anyone is interested. It works perfectly so far, very fast and completely silent.
I find sometimes when people are over someone might ask "Hey, do you have anymore football games?" or Horse-Racing or always something I don't seem to have in my 'favorites' list. I like to keep the Master list hidden and the number of permanent lists manageable so to have one for every category is not for me. What the following does is let that guest select an existing game in your favorites list and instantly generate a new list containing all other games; including clones, that match that same catver category.
As of Mamewah 1.6b6 it is possible to pass any of several flags on the command line to an external app. See Mamewah ini.txt for a complete description of each but for this example I use only the [category] flag.
All this does is replace a string called 'var1' in your sql with the [category] from Mamewah to create a gamelist and also name that list based on the [category] flag (example: Action, Puzzle, etc.)
There are a few pieces to this process mainly because I am no programmer and rely upon my own bat files; basic sql knowledge and borrowed vbs scripts.
You will need:
1. Buddabing's latest Listgen utility which is bundled with his Movie Maker utility; see the movie maker thread.
2. SearchAndReplace.vbs by Eric Phelps, from
www.ericphelps.com http://www.ericphelps.com/scripting/samples/3. My file called list99.bat, contents below.
4. My gamelist99.sql for use with Buddabing's listgen, see below.
5. Mamewah 1.6b6 or better installed.
To implement:
**Backup any affected ini or lst files because the changes this script will make are not reversible; make sure you edit any file or pathnames shown below. If you want to test the output use dummy paths.
- Create list99.bat and gamelist99.sql in your listgen directory using the code towards the bottom of this post
- Unzip SearchAndReplace.vbs into your listgen directory
I
- in your Mamewah\ini directory decide what list number you want to populate with this script and make sure there is an ini file for it (copy an existing one and rename it). I use 1-mame-7.ini for mine.
- Copy this ini file (1-Mame-7.ini) to your listgen directory; make sure the list title is "Category" as this will be updated by the script later, as follows:
list_title Category
- Backup your 1-mame.ini (or whatever yours is called) and make sure the following is specified for external app 2 (update paths)
app_2_executable c:\arcade\utilities\listgen\list99.bat
app_2_commandline_format "[category]"{nodosbox}
- Make sure in listgen.ini your FRONTEND is specified as MAMEWAH
You should now be able to run Mamewah and execute the script by first highlighting a game on an existing gamelist and then pressing whatever button you have specified to launch external app 2 and then navigate to your new gamelist. This process takes only a few seconds though you will not see any indication of either its activity or completion.
** Note as of Mamewah 1.6b7 you can only pass a category while viewing your Master list (1-Mame-0.lst) or any other list labelled as either "Favourites", "Most_Played" or "Longest_Played" in the appropriate 1-mame-x.ini file.
list99.bat (edit paths and Mamewah list name as appropriate then copy the following into notepad and save as list99.bat into same directory as listgen.exe)
-----begin list99.bat-------
@--rem this creates gamelist 7 on-the-fly based on the category flag passed from Mamewah
echo off
@--rem listgen needs to use filter.sql
@copy /y gamelist99.sql filter.sql
@--rem this inserts the category parameter into filter.sql
@start /min SearchAndReplace.vbs filter.sql var1 %1
@--rem edit this to be the appropriate path and Mamewah .lst filename
@start /min listgen -output "c:\Program Files\Mamewah\files\1-mame-7.lst"
@--rem this should also change the name that appears in Mamewah on this list - edit paths and filenames as appropriate
@copy /y 1-Mame-7.ini "c:\Program Files\Mamewah\ini\1-Mame-7.ini"
@start /min SearchAndReplace.vbs "c:\program files\mamewah\ini\1-Mame-7.ini" Category %1
-----end list99.bat---------------
gamelist99.sql (use any sql you like or use this one - copy into notepad and save as gamelist99.sql in your listgen directory - make sure you have 'var1' in there somewhere)
-----begin gamelist99.sql---------
select * from gamedata where status not in ('preliminary','imperfect') and catver_category like '%var1%' and full_desc not like '%PlayChoice%' and full_desc not like '%cassette%'
order by full_desc;-----end gamelist99.sql---------
Again, this will work very well but back up your ini files if you are not sure what you are doing because the changes are not reversible basically gamelist 1-mame-x.lst is destroyed and recreated everytime you run this script as is 1-mame-x.ini