Jump to content
LaunchBox Community Forums

Recommended Posts

Posted

No idea why but had to make it controller first then ESC key, works perfectly now, thanks again JoeViking245 😎 you've owned a 🍺or 🍺🍺🍺

Run, C:\Users\Retro-pc\Desktop\LaunchBox\0-UTILS\0-myscripts\kill-Lichtknarre.ahk

Process,Wait,Dolphin.exe
While WinExist("ahk_exe Dolphin.exe")
   Sleep 700

2Joy5::
If GetkeyState("Joy8") 
{
   run "C:\Users\Retro-pc\Desktop\Lichtknarre.exe - Shortcut.lnk"
   WinClose, ahk_exe Dolphin.exe
}

$Esc::
{
   run "C:\Users\Retro-pc\Desktop\Lichtknarre.exe - Shortcut.lnk"
   WinClose, ahk_exe Dolphin.exe
}

 

  • Game On 1
  • 2 months later...
Posted (edited)

Hi, 

I dont have a grasp of hot key script or any coding to be honest but i've given it a red hot go with this problem. 

I have a fork of flycast.exe that i'm specifcally using to run Ferrari F355 Challenge on Sega Noami - a bit hit or miss on launch but works pretty good when it can launch.

The flycast.exe launches two windows for the rom of which one is utilised for the main screen and another a slave screen. I suspect this is due to a dual cab arcade format. I can't seem to get a service screen within the rom that will stop the additional window opening,  it just seems like that's how it operates and all the game action is on the slave window. 

The two window titles are as follows:

Flycast - multiboard slave 1

Flycast - ferrari f355 challenge (deluxe, no link)

Running through launch box, "Flycast - multiboard slave 1" window is layered on top of "Flycast - ferrari f355 challenge (deluxe, no link) window. This layering order is ideal as "Flycast - multiboard slave 1" has the game detail running, so alt + enter will maximise the correct screen and its perfectly viewable. 

However, the problem, in launching the game through BigBox is it switches between both windows on launch and ultimatley runs "Flycast - ferrari f355 challenge (deluxe, no link)" window layrered on top and "Flycast - multiboard slave 1" on bottom. Therefore i can't see the game play. 

I've tried many scripts, i've found on the forum and throughout google. I've messed with the startup checkboxes for the emultaor settings in launchbox but i'm not getting any closer to what i'm trying to achieve which is to always have "Flycast - multiboard slave 1" window on top no matter the circumatance, i.e. Hide "Flycast - ferrari f355 challenge (deluxe, no link)" window.

Is there anyone that could make a runnings script suggestion?

 

Edited by Elmo80
Posted
10 hours ago, Elmo80 said:

I've tried many scripts, i've found on the forum and throughout google. I've messed with the startup checkboxes for the emultaor settings in launchbox but i'm not getting any closer to what i'm trying to achieve which is to always have "Flycast - multiboard slave 1" window on top no matter the circumatance, i.e. Hide "Flycast - ferrari f355 challenge (deluxe, no link)" window.

Is there anyone that could make a runnings script suggestion?

It'd be nice to know what scripts you actually tried so we don't create duplicative efforts. The fork you use might have been helpful also.

 

Since you didn't mention the fork you were using, I tested with the 'regular' flycast.exe.

First thing I did was to edit the file emu.cfg and set fullscreen = yes.  This alleviates any need for Alt+Enter.

'Regular' Flycast doesn't discern window titles between the 2 windows.  They're both simply titled Flycast. So in that regards, you're better off using the fork.

For BigBox, I tested using a sleep timer then sending Alt+Tab and that worked perfect.  But breaks in LaunchBox because when launched from there, there's not the focus issue and it changes it the screen we don't want.  Since your version distinguishes the window titles, you can use WinActivate.

At least with the 'regular' version, when exiting this particular game from LB or BB, you need to exit twice. Once for each window.  Maybe it's different with your fork.

Based on the information you provided, here's what I came up with.

Sleep, 5000
WinActivate Flycast - multiboard slave 1

$Esc::
{
    WinClose, ahk_exe flycast.exe
    WinClose, ahk_exe flycast.exe
}

You can adjust the 5 second sleep timer as necessary.

For WinActivate, the window title used is case sEnSitiVE.  It can also be truncated to just enough where it will distinguish it from another window's Title.  i.e. Flycast - m would work.

 

Posted

Thanks for investigating this issue - much appreciated. 

The fork i'm using is this one https://flyinghead.github.io/flycast-builds/  - Flycast CI build.  Retroarch's FlyCast Naomi wouldn't run F355 Challenge. 

The code i have tried has been discarded each time but it was along the line of WinSet, AlwaysOnTop...... but i was butchering the code language. 

I'll give your suggestion a try when i get home. 

Thanks again. 

  • Like 1
Posted

Hello I need help. I don’t know if I need a . Bat file or .AHK script. I’m trying to run Dice with joytokey but the emulator opens on my windows bar. I guessing joytokey and Dice are trying to open at the same time, because if I run Dice by itself it opens up normally. So I don’t know if I need Dice to wait or do I need joytokey to wait?  Thanks 

Posted
8 hours ago, Yoyo 90 said:

Hello I need help. I don’t know if I need a . Bat file or .AHK script. I’m trying to run Dice with joytokey but the emulator opens on my windows bar. I guessing joytokey and Dice are trying to open at the same time, because if I run Dice by itself it opens up normally. So I don’t know if I need Dice to wait or do I need joytokey to wait?  Thanks 

My guess is that you have 'Attempt to hide console window on startup/shutdown' checked.  Do you have Dice set to start fullscreen?  Whether you run a batch file or an AHK script shouldn't matter.  They're essentially the same thing.  How are you running them "at the same time"? 

When running your batch file (or script) and Dice outside of LaunchBox, do they 'play nice" with each other?

Have you tried running JoyToKey as an Additional App to the games and set it to Run Before Main Application? You should be able to run that directly without the need of a batch file or script.

Posted
7 hours ago, JoeViking245 said:

My guess is that you have 'Attempt to hide console window on startup/shutdown' checked.  Do you have Dice set to start fullscreen?  Whether you run a batch file or an AHK script shouldn't matter.  They're essentially the same thing.  How are you running them "at the same time"? 

When running your batch file (or script) and Dice outside of LaunchBox, do they 'play nice" with each other?

Have you tried running JoyToKey as an Additional App to the games and set it to Run Before Main Application? You should be able to run that directly without the need of a batch file or script.

Hey thanks

I’m pretty sure I don’t have attempt to hide console checked. I have Dice opening in fullscreen in LB. I’m ruining Joytokey as an Additional App. I’m not running a script outside of LB. I don’t know how to do that. I did try to run a bat file but I didn’t get it to work outside of LB. So if I run Dice without joytokey it works minus the joy the key part. I did try to run a script and got an error message but it works the only thing is now I have an error message in front. Thanks again for the help. 

Posted
1 hour ago, Yoyo 90 said:

Hey thanks

I’m pretty sure I don’t have attempt to hide console checked. I have Dice opening in fullscreen in LB. I’m ruining Joytokey as an Additional App. I’m not running a script outside of LB. I don’t know how to do that. I did try to run a bat file but I didn’t get it to work outside of LB. So if I run Dice without joytokey it works minus the joy the key part. I did try to run a script and got an error message but it works the only thing is now I have an error message in front. Thanks again for the help. 

All scripts aside, you say you have JoyToKey set as an Additional App. Is it set to Run Before Main Application?  Can you share a screenshot of this Additional App?

And when you launch a game that has this Additional App set to Run Before Main Application, the game launches minimized? BUT, if you remove the Additional App, the game launches fullscreen?  That doesn't make sense.

 

Now back to scripts... Your script that's giving you an error message, "but it works", where/how exactly are you running this script? As an Additional App? In the Running Script section of the emulator? Are you running it as well as the above Additional App? Or just the script?  When you say "it works", are you saying it launches JoyToKey and the Dice game opens fullscreen? What is the error message? What does the script look like? If you click OK on the error message, does it go away and "everything works"?

With as much information you've given us, you really haven't given us anything to be able to help you.

Posted
1 hour ago, JoeViking245 said:

All scripts aside, you say you have JoyToKey set as an Additional App. Is it set to Run Before Main Application?  Can you share a screenshot of this Additional App?

And when you launch a game that has this Additional App set to Run Before Main Application, the game launches minimized? BUT, if you remove the Additional App, the game launches fullscreen?  That doesn't make sense.

 

Now back to scripts... Your script that's giving you an error message, "but it works", where/how exactly are you running this script? As an Additional App? In the Running Script section of the emulator? Are you running it as well as the above Additional App? Or just the script?  When you say "it works", are you saying it launches JoyToKey and the Dice game opens fullscreen? What is the error message? What does the script look like? If you click OK on the error message, does it go away and "everything works"?

With as much information you've given us, you really haven't given us anything to be able to help you.

Hi sorry about not giving you the info you need to help. I will add pictures of my additional app. yes I add the script in running scripts and yes I’m running both additional app and running scripts. Yes it launches joytokey and Dice fullscreen. The error message is “Error at line 2 line text: yo error: this line does not contain a recognized action. 
the program will exit” after I click ok everything works. Thanks again 



 

Posted
53 minutes ago, Yoyo 90 said:

Hi sorry about not giving you the info you need to help. I will add pictures of my additional app. yes I add the script in running scripts and yes I’m running both additional app and running scripts. Yes it launches joytokey and Dice fullscreen. The error message is “Error at line 2 line text: yo error: this line does not contain a recognized action. 
the program will exit” after I click ok everything works. Thanks again 

The Additional Apps look fine.  What happens if you remove the erroneous script from the Running Script section?  What is the Running Script you have supposed to do? Why is it erroring?  What's the action it's not recognizing?  What does the whole script look like?  It's not supposed to start JoyToKey is it?  If so, why are you starting it twice (via the Running script AND Additional App)? If you fix the error in the script, can you remove the Additional App?

Sorry so many questions.  My mind reading skills have been on the fritz lately.

Posted

Hello yes if I remove the erroneous script Dice will launch but in the windows bar at the bottom. Originally the script was to have joytokey wait or sleep for 5 sec. Before it did its thing but because I don’t know what I’m doing I discovered that “everything working” error. If I recall it was something like “timeout /t 5 / no break” ( like I said I have no clue because that’s for a bat file) In the example I sent you all I did was write yo in run script and it did the same thing. Launches full screen joytokey works, but the error message shows up. 

Posted
53 minutes ago, Yoyo 90 said:

In the example I sent you all I did was write yo in run script

Looking through in your previous posts, I still haven't seen any actual script.   Maybe when you're at your computer, you can take a moment and share what you actually have there.  

Unless what you're saying is that your Running Script actually consists of just yo. And nothing else.  Then of course it's going to error.  Not sure where you'd get that yo is actually a command of sorts.

Posted
23 minutes ago, JoeViking245 said:

Looking through in your previous posts, I still haven't seen any actual script.   Maybe when you're at your computer, you can take a moment and share what you actually have there.  

Unless what you're saying is that your Running Script actually consists of just yo. And nothing else.  Then of course it's going to error.  Not sure where you'd get that yo is actually a command of sorts.

Yeah Just “Yo” ( my nickname) I know it’s not an actual script but I knew it would error because the other time I used

“Timeout /t 5 / nobreak”

that errored and you asked what the error said so instead of writing  timeout /t 5 / nobreak I just type in YO and the other thing I tried was

“sleep 5000”

but that did nothing. 
thanks for helping 

Posted
13 hours ago, retroviking said:

I'm looking for a script to exit MAME, I basically want the keys, '1' and '5' pressed simultaneously to = Esc to shutdown MAME from the gun. 

Thanks in advance.

Here, you'll need to press [and hold] "1" FIRST, then press "5".

1 & 5::
   Send {Esc}
   Return
1::1

 

Posted (edited)
5 hours ago, JoeViking245 said:
1 & 5::
   Send {Esc}
   Return
1::1

Thanks for the reply. unfortunately that didn't work. Im using the Gun4Ir setup if that helps. and have 2 buttons mapped as 1 & 5

Edited by retroviking
Posted
16 minutes ago, retroviking said:

Thanks for the reply. unfortunately that didn't work. Im using the Gun4Ir setup if that helps. and have 2 buttons mapped as 1 & 5

It doesn't help [me] since I don't own one.  When you say "mapped as 1 & 5", I assume you mean 'keyboard' 1 and 5 (vs a 'controller button' 1 and 5).

It's been a while since I did much scripting and forgot MAME needs a key delay.

SetKeyDelay, 0, 50

1 & 5::
   Send {Esc}
   Return
1::1

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...