RETROBAT Official Board
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Create a per-game script

3 posters

Go down

Create a per-game script Empty Create a per-game script

Post by melin 11/08/24, 08:42 pm

Is it possible to creat a "per-game" script.
For instance I would like to have an invisble script running that waits for thirty seconds and then activates a certain window?

I (and Chat-GPT) can make the script myself, but is there any way to execute a script with a specific game?

Thanks
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by getupor 11/08/24, 09:46 pm

Hello
You should make a search on "script" or "event" on this forum to find some examples.
Or in the pixelcade topic, which use it also


Create a per-game script Modo
getupor
getupor
Admin

Messages : 1388
Date d'inscription : 2020-10-04

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by melin 11/08/24, 10:03 pm

getupor wrote:Hello
You should make a search on "script" or "event" on this forum to find some examples.
Or in the pixelcade topic, which use it also

Thanks, but I have already tried that. I can find a lot of people writing about their specific problems, but not touching my general issues.

I want to run a script when I run the PC game Forza Horizon 5?

Where do I place the script? What formats does it take? How should the script be named etc.
I haven't found the answers to these questions, neither in the documentation or in the different threats.


I need an answer like:

"If your windows game's shortcut is called "xxx", then you should place your script xxx.yyy (valid formats are aaa, bbb and ccc) in the folder zzz and everything will be great".
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by getupor 11/08/24, 10:27 pm

But what do you want that your script does ?


Create a per-game script Modo
getupor
getupor
Admin

Messages : 1388
Date d'inscription : 2020-10-04

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by melin 11/08/24, 10:39 pm

I want my script to wait and the focus on the windows I decided it should focus on (or maybe do alt+tab).

My issue is that some games are not in focus when I start them. For instance Forza Horizon 5 - rumble does not work until I alt+tab to get the window in focus (even though no other windows exists and the joypad works, apart from the rumle). Other games don't play music until I alt+tab.

And no, I can't just alt+tab. The idea is to be able to operate the machine with joypad only.
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Aynshe 11/08/24, 11:20 pm

melin wrote:Is it possible to creat a "per-game" script.
For instance I would like to have an invisble script running that waits for thirty seconds and then activates a certain window?

I (and Chat-GPT) can make the script myself, but is there any way to execute a script with a specific game?

Thanks

There are already topics on scripts.

The folders RetroBat\emulationstation\.emulationstation\scripts\game-start or game-end and

If not, you can hijack my script pack and clean it of what you don't need to add the systems and games you want to run autohotkeys that can launch keyboard commands or others

https://archive.org/details/retrobat-script-demulshooter-packes-custom-nixx.-7z


Create a per-game script Modo
Aynshe
Aynshe

Messages : 432
Date d'inscription : 2022-03-18

getupor likes this post

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by melin 12/08/24, 11:09 am

Aynshe wrote:
melin wrote:Is it possible to creat a "per-game" script.
For instance I would like to have an invisble script running that waits for thirty seconds and then activates a certain window?

I (and Chat-GPT) can make the script myself, but is there any way to execute a script with a specific game?

Thanks

There are already topics on scripts.

The folders RetroBat\emulationstation\.emulationstation\scripts\game-start or game-end and

If not, you can hijack my script pack and clean it of what you don't need to add the systems and games you want to run autohotkeys that can launch keyboard commands or others

https://archive.org/details/retrobat-script-demulshooter-packes-custom-nixx.-7z

Thank you for this. I am not sure it is helping me with what I need. The script I can do myself, but how to ensure that the scripts are picked up is what I don't get. For instance: In the game-start you have a batch script that does stuff. How is it picked up? Is it picked up with the launch of every game? I need something that is picked up when launching a particular game. For the time being, never mind the contents of the script - Chat-GPT will solve that problem for me, but how are these scripts being picked up? I don't get it. Please help me with understanding this.
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Aynshe 12/08/24, 11:35 am

melin wrote:
Aynshe wrote:
melin wrote:Is it possible to creat a "per-game" script.
For instance I would like to have an invisble script running that waits for thirty seconds and then activates a certain window?

I (and Chat-GPT) can make the script myself, but is there any way to execute a script with a specific game?

Thanks

There are already topics on scripts.

The folders RetroBat\emulationstation\.emulationstation\scripts\game-start or game-end and

If not, you can hijack my script pack and clean it of what you don't need to add the systems and games you want to run autohotkeys that can launch keyboard commands or others

https://archive.org/details/retrobat-script-demulshooter-packes-custom-nixx.-7z

Thank you for this. I am not sure it is helping me with what I need. The script I can do myself, but how to ensure that the scripts are picked up is what I don't get. For instance: In the game-start you have a batch script that does stuff. How is it picked up? Is it picked up with the launch of every game? I need something that is picked up when launching a particular game. For the time being, never mind the contents of the script - Chat-GPT will solve that problem for me, but how are these scripts being picked up? I don't get it. Please help me with understanding this.

My program does what you ask. *It allows to detect the execution of the name of a game for a system and whose name is indicated in the list then to execute a dedicated code that you write in addition in autohotkey.

I do not know of a tutorial, so you have to do some research if you want to have the basis of the operation. Otherwise if you dissect my code whose source is available on GitHub you will understand.


Create a per-game script Modo
Aynshe
Aynshe

Messages : 432
Date d'inscription : 2022-03-18

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Aynshe 12/08/24, 01:46 pm

here is a focus test, here I do the opposite for the test...I focus emulationstation after launching the game given that the game is in the foreground. The test code waits 5 seconds before focusing.

Code:
#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%

partialWindowTitle := "EmulationStation"
processName := "maldita_castilla_arcade_cabinet.exe"

Sleep, 5000
WinActivate, %partialWindowTitle%
Sleep, 100
WinSet, Top,, %partialWindowTitle%

Loop
{
    Process, Exist, %processName%
    if (ErrorLevel = 0)
    {
        ExitApp
    }
    Sleep, 1000
}

ExitApp



Create a per-game script Modo
Aynshe
Aynshe

Messages : 432
Date d'inscription : 2022-03-18

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by melin 12/08/24, 08:32 pm

Thank you for providing me the info. It was REALLY difficult to see what was going on with the really small fonts, low res and my 48-year old eyes LOL. Furthermore the tool could also use a little bit of a usability touch-up, but nevertheless with the help of the tool and Chat-GPT I have apparently created a Forza Horizon 5_ahk.exe which is my "script". How do I get it to execute with the game?
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Aynshe 12/08/24, 08:41 pm

melin wrote:Thank you for providing me the info. It was REALLY difficult to see what was going on with the really small fonts, low res and my 48-year old eyes LOL. Furthermore the tool could also use a little bit of a usability touch-up, but nevertheless with the help of the tool and Chat-GPT I have apparently created a Forza Horizon 5_ahk.exe which is my "script". How do I get it to execute with the game?

indeed, the encoding of the site is excessive....

Important, you have to place the arg.bat file in RetroBat\emulationstation\.emulationstation\scripts\game-start\

Here is another link in YT :



The interface Edit_LsTRoms.exe is basic, I did it as best I could. I'm not a developer, and I didn't want to make another version of it.

The main code is in ScriptPush.exe


Create a per-game script Modo
Aynshe
Aynshe

Messages : 432
Date d'inscription : 2022-03-18

getupor likes this post

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by melin 12/08/24, 09:41 pm

Aynshe wrote:
melin wrote:Thank you for providing me the info. It was REALLY difficult to see what was going on with the really small fonts, low res and my 48-year old eyes LOL. Furthermore the tool could also use a little bit of a usability touch-up, but nevertheless with the help of the tool and Chat-GPT I have apparently created a Forza Horizon 5_ahk.exe which is my "script". How do I get it to execute with the game?

indeed, the encoding of the site is excessive....

Important, you have to place the arg.bat file in RetroBat\emulationstation\.emulationstation\scripts\game-start\

Here is another link in YT :



The interface Edit_LsTRoms.exe is basic, I did it as best I could. I'm not a developer, and I didn't want to make another version of it.

The main code is in ScriptPush.exe


I am thankful for the tool. I guess you get used to it. I will probably never get used to it starting off screen, but nevertheless. I probably need to look into everything again. I don't get bat-files but exefiles. Too late for more today. Have to get up early in the morning. I will probably get it at some point. Thanks for all the help.
melin
melin

Messages : 35
Date d'inscription : 2024-07-27

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Aynshe 12/08/24, 09:55 pm

melin wrote:
Aynshe wrote:
melin wrote:Thank you for providing me the info. It was REALLY difficult to see what was going on with the really small fonts, low res and my 48-year old eyes LOL. Furthermore the tool could also use a little bit of a usability touch-up, but nevertheless with the help of the tool and Chat-GPT I have apparently created a Forza Horizon 5_ahk.exe which is my "script". How do I get it to execute with the game?

indeed, the encoding of the site is excessive....

Important, you have to place the arg.bat file in RetroBat\emulationstation\.emulationstation\scripts\game-start\

Here is another link in YT :



The interface Edit_LsTRoms.exe is basic, I did it as best I could. I'm not a developer, and I didn't want to make another version of it.

The main code is in ScriptPush.exe


I am thankful for the tool. I guess you get used to it. I will probably never get used to it starting off screen, but nevertheless. I probably need to look into everything again. I don't get bat-files but exefiles. Too late for more today. Have to get up early in the morning. I will probably get it at some point. Thanks for all the help.

everything is in the archive "RETROBAT_script_demulshooterPack+es-custom_Nixx.7z", the archive paths are the paths where the files go in retrobat.


Create a per-game script Modo
Aynshe
Aynshe

Messages : 432
Date d'inscription : 2022-03-18

Back to top Go down

Create a per-game script Empty Re: Create a per-game script

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum