Author Topic: [Help] Display Favorites  (Read 4093 times)

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
[Help] Display Favorites
« on: August 26, 2018, 07:33:47 AM »
Hello everyone, I'm working on the Favorites screen, but I'm not getting AM to read all the .tag files that are inside the "romlist" directory, for the new screen it only gives me the option to select a single screen to display the favorite files, my question is how do I make AM read all the .tag files of favorites and show them all in just one screen?
PS: Arcade.tag, nes.tag, atari.tag -----> in just one screen.




iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [Help] Display Favorites
« Reply #1 on: August 26, 2018, 07:37:47 AM »
Try this:

Code: [Select]

@echo off
setlocal EnableDelayedExpansion EnableExtensions
rem ================================================================================
rem This script basically does the same thing as DM's favorites romlist generator
rem but on Windows [Shouts to him for the pi version ;)].
rem How it works:
rem It grabs all the (tagged) favorites from every tag file, searches for them
rem through all the romlists, then generates a romlist called Favorites.txt
rem Written by Steve Sherrod, 05/20/17, as part of project HyperPie Expanded
rem ================================================================================

rem Default path (on windows). This should point to your attract modes romlists dir
cd "C:\HyperArcade\romlists\"

echo ==========================================================
echo     AM favorites romlist generator script for Windows
echo ==========================================================

sleep 1

echo - Backing up old Favorites.txt file

rem remove the old Favorites.txt and create the backup
if exist Favorites.txt (
move /y Favorites.txt Favorites.txt.backup
)

echo - Gathering list of favorites (tag files)

set /a numfavorites=0
set /a romlist=0

rem loop through each tag file
for %%f in (*.tag) do (
echo - Processing tag file: %%~nf.tag
set /a numtagfiles=numtagfiles+1

rem loop through favorites stored in tag file
for /f "tokens=*" %%a in ('type "%%~nf.tag"') do (

set /a numfavorites=numfavorites+1
set favorite=%%a

echo - Searching rom list: %%~nf.txt for rom: %%a

rem loop through each rom file and parse favorited (tagged) roms
for /f "tokens=*" %%s in ('type "%%~nf.txt"') do (
set /a romlist=romlist+1
set str=%%s
rem Search current line (for current favorite substring) and if found, append it to Favorites.txt
echo."!str!" | findstr /C:%%a>nul && (
echo "!str!">>"Favorites.txt"
)
)
)

echo - Favorites.txt romlist generated. !numtagfiles! romlists read, !numfavorites! favorites written to disk
echo - Done
echo.
echo Add a display in Attract Mode and set its romlist to the newly created Favorites.txt
)
Nacer a los 15 años Una novela de iOtero

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [Help] Display Favorites
« Reply #2 on: August 26, 2018, 08:01:24 AM »
Thanks!!! iOtero. to MAME I had a good success but for the other systems do not create list in Favorites.txt the bat file of a message that could not be located



Try this:

Code: [Select]

@echo off
setlocal EnableDelayedExpansion EnableExtensions
rem ================================================================================
rem This script basically does the same thing as DM's favorites romlist generator
rem but on Windows [Shouts to him for the pi version ;)].
rem How it works:
rem It grabs all the (tagged) favorites from every tag file, searches for them
rem through all the romlists, then generates a romlist called Favorites.txt
rem Written by Steve Sherrod, 05/20/17, as part of project HyperPie Expanded
rem ================================================================================

rem Default path (on windows). This should point to your attract modes romlists dir
cd "C:\HyperArcade\romlists\"

echo ==========================================================
echo     AM favorites romlist generator script for Windows
echo ==========================================================

sleep 1

echo - Backing up old Favorites.txt file

rem remove the old Favorites.txt and create the backup
if exist Favorites.txt (
move /y Favorites.txt Favorites.txt.backup
)

echo - Gathering list of favorites (tag files)

set /a numfavorites=0
set /a romlist=0

rem loop through each tag file
for %%f in (*.tag) do (
echo - Processing tag file: %%~nf.tag
set /a numtagfiles=numtagfiles+1

rem loop through favorites stored in tag file
for /f "tokens=*" %%a in ('type "%%~nf.tag"') do (

set /a numfavorites=numfavorites+1
set favorite=%%a

echo - Searching rom list: %%~nf.txt for rom: %%a

rem loop through each rom file and parse favorited (tagged) roms
for /f "tokens=*" %%s in ('type "%%~nf.txt"') do (
set /a romlist=romlist+1
set str=%%s
rem Search current line (for current favorite substring) and if found, append it to Favorites.txt
echo."!str!" | findstr /C:%%a>nul && (
echo "!str!">>"Favorites.txt"
)
)
)

echo - Favorites.txt romlist generated. !numtagfiles! romlists read, !numfavorites! favorites written to disk
echo - Done
echo.
echo Add a display in Attract Mode and set its romlist to the newly created Favorites.txt
)
« Last Edit: August 26, 2018, 09:15:10 AM by arthurvalenca »

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [Help] Display Favorites
« Reply #3 on: August 26, 2018, 10:19:14 AM »
Change this path in batch file C:\HyperArcade\romlists\ for your path.  8)
Nacer a los 15 años Una novela de iOtero

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [Help] Display Favorites
« Reply #4 on: August 26, 2018, 12:17:49 PM »
Change this path in batch file C:\HyperArcade\romlists\ for your path.  8)


yes I changed the path, but I get error in other favorites, when the names of the files contain space, the program does not read, it simply gives this message.

test please:

http://www.mediafire.com/file/fwhaxfskc9niz14/Desktop.rar/file


iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [Help] Display Favorites
« Reply #5 on: August 26, 2018, 12:24:47 PM »
Check that the files are not read only. Check the permissions of the files. And run the batch as administrator. I do not have any problem.

And if you're working on disk C: I advise you to change from disk, to D:, for example, with a new partition or another disk.
Nacer a los 15 años Una novela de iOtero

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [Help] Display Favorites
« Reply #6 on: August 26, 2018, 03:31:09 PM »
Check that the files are not read only. Check the permissions of the files. And run the batch as administrator. I do not have any problem.

And if you're working on disk C: I advise you to change from disk, to D:, for example, with a new partition or another disk.


thank you! I tried in all ways but it does not work for me, just like disc, C :, D:, E: and F: no directory, it does the work for MAME games but when it arrives on other console it gives the image error above.

gioppi

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [Help] Display Favorites
« Reply #7 on: January 11, 2021, 03:02:46 PM »
Try this:

Code: [Select]

@echo off
setlocal EnableDelayedExpansion EnableExtensions
rem ================================================================================
rem This script basically does the same thing as DM's favorites romlist generator
rem but on Windows [Shouts to him for the pi version ;)].
rem How it works:
rem It grabs all the (tagged) favorites from every tag file, searches for them
rem through all the romlists, then generates a romlist called Favorites.txt
rem Written by Steve Sherrod, 05/20/17, as part of project HyperPie Expanded
rem ================================================================================

rem Default path (on windows). This should point to your attract modes romlists dir
cd "C:\HyperArcade\romlists\"

echo ==========================================================
echo     AM favorites romlist generator script for Windows
echo ==========================================================

sleep 1

echo - Backing up old Favorites.txt file

rem remove the old Favorites.txt and create the backup
if exist Favorites.txt (
move /y Favorites.txt Favorites.txt.backup
)

echo - Gathering list of favorites (tag files)

set /a numfavorites=0
set /a romlist=0

rem loop through each tag file
for %%f in (*.tag) do (
echo - Processing tag file: %%~nf.tag
set /a numtagfiles=numtagfiles+1

rem loop through favorites stored in tag file
for /f "tokens=*" %%a in ('type "%%~nf.tag"') do (

set /a numfavorites=numfavorites+1
set favorite=%%a

echo - Searching rom list: %%~nf.txt for rom: %%a

rem loop through each rom file and parse favorited (tagged) roms
for /f "tokens=*" %%s in ('type "%%~nf.txt"') do (
set /a romlist=romlist+1
set str=%%s
rem Search current line (for current favorite substring) and if found, append it to Favorites.txt
echo."!str!" | findstr /C:%%a>nul && (
echo "!str!">>"Favorites.txt"
)
)
)

echo - Favorites.txt romlist generated. !numtagfiles! romlists read, !numfavorites! favorites written to disk
echo - Done
echo.
echo Add a display in Attract Mode and set its romlist to the newly created Favorites.txt
)

Hi, I tried to use this script to create my favorites list, but when I try to insert a game with multiple names separated by space for example Tetris (Japan)
 of a .tag list the script does not find the word (Japan) giving error FINDSTR: CANNOT OPEN FILE (Japan) and does not create the list, then if I insert a game like sf2 it inserts all the games of the same list starting with sf2 for example
sf2; sf2; CPS1 ;;;;;;;;;;;;;;
sf2ce; sf2ce; CPS1 ;;;;;;;;;;;;;;
sf2hf; sf2hf; CPS1 ;;;;;;;;;;;;;;
How to solve?