Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Recommended Posts

I use an emulator called Teknoparrot it emulates more recent arcade games, but when it launches games even through ahk it launches the teknoparrot gui and a command window called OpenParrotLoader.exe, I want to hide these but haven't been able to. In task manger the windows are called ElfLoader and steamchild. I tried 

WinHide ahk_exe ElfLoader
WinHide ahk_exe SteamChild
WinHide ahk_exe "<My><Path><To>\OpenParrotLoader64.exe"

I also tried adding SetTitleMatchMode, 2 and with Ifwinexists but nothing seems to work although it's very possible I'm doing it incorrectly. 

Link to post
Share on other sites
  • Replies 615
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I want to have a single thread for this so please share your useful and interesting AHK scripts here. Provide a short description of what the script does put the script in the post using the code

In case you want to start Xpadder.exe with an emulator's games and then exit Xpadder when exiting the game, you can add this ahk code to your emulator's AutoHotkey Script tab: Run, C:\Xpadder\Xpad

Was way too fast without any delay but it's perfect with sleep, 100. Thanks again! You guys will both get a shout out in the next release for C64 Dreams  

Posted Images

1 hour ago, Jayinem said:

I use an emulator called Teknoparrot it emulates more recent arcade games....

Why not call TeknoparrotUI directly?

Inside Teknoparrot settings there is an option to hide the console.

Link to post
Share on other sites
11 minutes ago, Headrush69 said:

Why not call TeknoparrotUI directly?

Inside Teknoparrot settings there is an option to hide the console.

I never realized that was an option but I just tried it and still get those windows. Unless there's another setting I checked the box  "hide console windows" saved, even restarted Teknoparrot and tried again, and tried through ahk script. 

 

Untitled.thumb.png.ee3be72f889da9eca0f7ad8e46f138a0.png

Edited by Jayinem
Link to post
Share on other sites
8 minutes ago, Jayinem said:

I never realized that was an option but I just tried it and still get those windows. Unless there's another setting I checked the box  "hide console windows" saved, even restarted Teknoparrot and tried again, and tried through ahk script. 

 

Untitled.thumb.png.ee3be72f889da9eca0f7ad8e46f138a0.png

Are you using LB startup screens as well? If so is Aggressive hiding enabled in startup screen settings in LB?

Is it all Teknoparrot games or just Linux based ones?

I use a mix of starting TeknoparrotUI directly and RocketLauncher for a few Teknoparrot games. I’ll check when I get home my exact settings.

Link to post
Share on other sites
4 minutes ago, Headrush69 said:

Are you using LB startup screens as well? If so is Aggressive hiding enabled in startup screen settings in LB?

Is it all Teknoparrot games or just Linux based ones?

I use a mix of starting TeknoparrotUI directly and RocketLauncher for a few Teknoparrot games. I’ll check when I get home my exact settings.

Nah I don't use any startup screens in Launchbox,  with Teknoparrot I just make an ahk of the game and compile it to exe, and add it to Launchbox. It made no difference running the exe seperate from Launchbox, so it's not really a Launchbox issue at all.  I only have free Launchbox anyway. 

Edited by Jayinem
Link to post
Share on other sites
4 minutes ago, Jayinem said:

with Teknoparrot I just make an ahk of the game and compile it to exe, and add it to Launchbox

Looking at your previous posts, not sure for Teknoparrot why the extra step of running through an AHK. Are you using it to pre or post run apps that aren’t working in LB’s tools for that?

If you could post the AHK you are using to launch a game, that would help as well.

FYI, I learned a lot looking at the AHKs RocketLauncher uses for Teknoparrot games as it uses a more advanced window detection that might help. 
running to work, will look again after.

Link to post
Share on other sites
1 hour ago, Headrush69 said:

Looking at your previous posts, not sure for Teknoparrot why the extra step of running through an AHK. Are you using it to pre or post run apps that aren’t working in LB’s tools for that?

If you could post the AHK you are using to launch a game, that would help as well.

FYI, I learned a lot looking at the AHKs RocketLauncher uses for Teknoparrot games as it uses a more advanced window detection that might help. 
running to work, will look again after.

Nope I just load the entire game that way Just the way I've always done it, The reason was at first I only wanted Lightgun games and they required an app called Demulshooter that only works through scripts. I started collecting other types games but I didn't learn until I was doing it for like a year there was a way to load it as an emulator in Launchbox, and I already had a bunch of scripts loaded in LB so no reason to take the time to redo it all.  You load the game in Teknoparrot and save your settings first and it makes a UserProfile .xml of the game. So 

#SingleInstance Force
SetWorkingDir, <path><to>\Teknoparrot.exe
run TeknoParrotUi.exe --profile=IDZ.xml
exit

But I don't know any of this is relevant unless you tell me loading the emulator into Launchbox prevents the additional windows from coming up, I'm pretty sure the games always launch with those windows regardless of launch method. 

Still asking my original question for a way to hide them. 

 

Edited by Jayinem
Link to post
Share on other sites
9 hours ago, Jayinem said:

But I don't know any of this is relevant unless you tell me loading the emulator into Launchbox prevents the additional windows from coming up, I'm pretty sure the games always launch with those windows regardless of launch method. 

Still asking my original question for a way to hide them. 

Needed to know how you were starting to know what features to suggest.

Make sure you have hide console windows enabled in TeknoparrotUI settings and than also add --startMinimized to your command line options to TeknoparrotUI.exe

I understand that you don't want to change to use LB's pre run Application feature, but if you aren't running Demulshooter and your AHK is just starting TeknoparrotUI.exe, you can use the same command line arguments directly in LB.

e

Link to post
Share on other sites
14 hours ago, Headrush69 said:

Needed to know how you were starting to know what features to suggest.

Make sure you have hide console windows enabled in TeknoparrotUI settings and than also add --startMinimized to your command line options to TeknoparrotUI.exe

I understand that you don't want to change to use LB's pre run Application feature, but if you aren't running Demulshooter and your AHK is just starting TeknoparrotUI.exe, you can use the same command line arguments directly in LB.

e

This does not work for me either even with hide console windows.

Many Teknoparrot games also cannot use the fade screens , e.g. Batman as once game loads it only plays the sound (for me anyway)

Until they fix it within the emulator itself, we are stuck with a messy loading screen.

Also some games like Mario Kart DX take a few minutes to load, so it's useful for screen to show on those games or you would think it was not going to load at all.

Link to post
Share on other sites
56 minutes ago, zugswang said:

This does not work for me either even with hide console windows.

That sucks. These are the worst problems when it works for some but not others. Teknoparrot can be a pain version to version. Only thing I could suggest would check your ParrotData.xml file and make sure you do indeed see <SilentMode>true</SilentMode>

1 hour ago, zugswang said:

Many Teknoparrot games also cannot use the fade screens , e.g. Batman as once game loads it only plays the sound (for me anyway)

Until they fix it within the emulator itself, we are stuck with a messy loading screen.

I've been flipping between using multiple ways to start my Teknoparrot games (haven't decided on my favourite yet), but if you're so inclined, using RocketLauncher with it's loading screens always worked for me. It uses a more active window searching feature.

1 hour ago, zugswang said:

Also some games like Mario Kart DX take a few minutes to load, so it's useful for screen to show on those games or you would think it was not going to load at all.

OMG, that game takes forever to load through Teknoparrot doesn't it. For games that have the option, (like Mario Kart DX), I try to use JConfig, as it loads faster. 

Link to post
Share on other sites
7 minutes ago, Headrush69 said:

That sucks. These are the worst problems when it works for some but not others. Teknoparrot can be a pain version to version. Only thing I could suggest would check your ParrotData.xml file and make sure you do indeed see <SilentMode>true</SilentMode>

I've been flipping between using multiple ways to start my Teknoparrot games (haven't decided on my favourite yet), but if you're so inclined, using RocketLauncher with it's loading screens always worked for me. It uses a more active window searching feature.

OMG, that game takes forever to load through Teknoparrot doesn't it. For games that have the option, (like Mario Kart DX), I try to use JConfig, as it loads faster. 

That is using jconfig 🤣

Link to post
Share on other sites
8 minutes ago, Headrush69 said:

That sucks. These are the worst problems when it works for some but not others. Teknoparrot can be a pain version to version. Only thing I could suggest would check your ParrotData.xml file and make sure you do indeed see <SilentMode>true</SilentMode>

I've been flipping between using multiple ways to start my Teknoparrot games (haven't decided on my favourite yet), but if you're so inclined, using RocketLauncher with it's loading screens always worked for me. It uses a more active window searching feature.

OMG, that game takes forever to load through Teknoparrot doesn't it. For games that have the option, (like Mario Kart DX), I try to use JConfig, as it loads faster. 

Yes, I use RocketLauncher too as I have a huge Hyperspin setup so utilise it with Launchbox when I can't get stuff to load through Launchbox

Link to post
Share on other sites
22 minutes ago, zugswang said:

That is using jconfig 🤣

LOL. I did say faster, not that it was fast. ;)

Best option... play Mario Kart 8 with Cemu instead. :) 

I keep Mario Kart DX in the collection, but personally found it a bit boring and bland and other games that load faster are more fun.

Link to post
Share on other sites
15 hours ago, Headrush69 said:

LOL. I did say faster, not that it was fast. ;)

Best option... play Mario Kart 8 with Cemu instead. :) 

I keep Mario Kart DX in the collection, but personally found it a bit boring and bland and other games that load faster are more fun.

The version with drift is great, but agree that normal version is boring.

Link to post
Share on other sites
  • 2 weeks later...

Hey everybody.  I need a little help with a script.  I use Big Box on an arcade machine and am using an app called Xinput to Xarcade to turn keypresses into xbox controller buttons (couldn't get the ipac xinput thing figured out and this works really well) and I use a nifty little script to auto launch it at the start of a game and close it upon exiting the game.  Some of my PC games, SFV, MKXL, MK11, do not realize the game has quit and LED Blinky doesn't quit the custom game button color animation...I would like to add a command within the script to stop and restart LEDblinky at the when I press escape and exit the game...Can someone give me a hand.  My script is below

$Esc::
{
Process, Close, XArcadeXInput.exe
}

Escape::
Process, Close, StreetFighterV.exe

if WinExist("LaunchBox Game Startup")
{
WinActivate
WinWaitClose, LaunchBox Game Startup
}

if WinExist("LaunchBox")
{
WinActivate
}

if WinExist("LaunchBox Big Box")
{
WinActivate
}

ExitApp
return

Link to post
Share on other sites
  • 2 weeks later...

any pros out there that can help me with the below script? and thank you very much in advance!

 

i found this online and it works great.  it sends keystrokes based on joystick pushes, in this case, arrow keys for directions.  i'd like to modify this so that it is listening for two different joysticks, not just the one.  for the second stick (ID 3), i want it to send keystrokes for up down left right to keys E,D,F,G

i tied adding this to the body of the script but then neither stick was working.  i realize this add is still sending up down left right cursor keys, but i was just testing to see if it would work.

if (3JoyX > 70)
    KeyToHoldDown := "Right"
else if (3JoyX < 30)
    KeyToHoldDown := "Left"
else if (3JoyY > 70)
    KeyToHoldDown := "Down"
else if (3JoyY < 30)
    KeyToHoldDown := "Up"
else
    KeyToHoldDown := ""

 

here is the one stick working script:

#Persistent  ; Keep this script running until the user explicitly exits it.
SetTimer, WatchAxis, 5
return

WatchAxis:
JoyX := GetKeyState("JoyX")  ; Get position of X axis.
JoyY := GetKeyState("JoyY")  ; Get position of Y axis.
KeyToHoldDownPrev := KeyToHoldDown  ; Prev now holds the key that was down before (if any).

if (JoyX > 70)
    KeyToHoldDown := "Right"
else if (JoyX < 30)
    KeyToHoldDown := "Left"
else if (JoyY > 70)
    KeyToHoldDown := "Down"
else if (JoyY < 30)
    KeyToHoldDown := "Up"
else
    KeyToHoldDown := ""

if (KeyToHoldDown = KeyToHoldDownPrev)  ; The correct key is already down (or no key is needed).
    return  ; Do nothing.

; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1  ; Avoid delays between keystrokes.
if KeyToHoldDownPrev   ; There is a previous key to release.
    Send, {%KeyToHoldDownPrev% up}  ; Release it.
if KeyToHoldDown   ; There is a key to press down.
    Send, {%KeyToHoldDown% down}  ; Press it down.
return

$Esc::

{

    Process, Close, {{{StartupEXE}}}

}

Link to post
Share on other sites

Hi @d8thstar

 

Try the following - semi untested - So you might need to move the key bindings around a bit

#Persistent  ; Keep this script running until the user explicitly exits it.
#SingleInstance Force
SetTimer, WatchJoy1, 5
SetTimer, WatchJoy3, 5
return

WatchJoy1:
1JoyX := GetKeyState("1JoyX")  ; Get position of X axis.
1JoyY := GetKeyState("1JoyY")  ; Get position of Y axis.
KeyToHoldDownPrev := KeyToHoldDown  ; Prev now holds the key that was down before (if any).

if (1JoyX > 70)
    KeyToHoldDown := "Right"
else if (1JoyX < 30)
    KeyToHoldDown := "Left"
else if (1JoyY > 70)
    KeyToHoldDown := "Down"
else if (1JoyY < 30)
    KeyToHoldDown := "Up"
else
    KeyToHoldDown := ""

if (KeyToHoldDown = KeyToHoldDownPrev)  ; The correct key is already down (or no key is needed).
	return  ; Do nothing.

; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1  ; Avoid delays between keystrokes.
if KeyToHoldDownPrev   ; There is a previous key to release.
    Send, {%KeyToHoldDownPrev% up}  ; Release it.
if KeyToHoldDown   ; There is a key to press down.
    Send, {%KeyToHoldDown% down}  ; Press it down.
return


WatchJoy3:
3joyX := GetKeyState("3joyX")  ; Get position of X axis.
3joyY := GetKeyState("3joyY")  ; Get position of Y axis.
KeyToHoldDownPrev := KeyToHoldDown  ; Prev now holds the key that was down before (if any).

if (3joyX > 70)
    KeyToHoldDown := "G"
else if (3joyX < 30)
    KeyToHoldDown := "F"
else if (3joyY > 70)
    KeyToHoldDown := "D"
else if (3joyY < 30)
    KeyToHoldDown := "E"
else
    KeyToHoldDown := ""

if (KeyToHoldDown = KeyToHoldDownPrev)  ; The correct key is already down (or no key is needed).
	return  ; Do nothing.

; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1  ; Avoid delays between keystrokes.
if KeyToHoldDownPrev   ; There is a previous key to release.
    Send, {%KeyToHoldDownPrev% up}  ; Release it.
if KeyToHoldDown   ; There is a key to press down.
    Send, {%KeyToHoldDown% down}  ; Press it down.
return

$Esc::

{

    WinClose, ahk_exe {{{StartupEXE}}}

}

I have changed away from Process, Close, as it isn't recommended anymore as it can cause issues, so hopefully this will still close it for you

Link to post
Share on other sites
Posted (edited)
9 minutes ago, d8thstar said:

thanks man.  unfortunately, P1 movement is like the key is being pressed once instead of being held.  haven't tried P2 yet...

Not sure why that is. Using same script as your original one so should in theory work same way as it did before. (ie if it held down the key before it should now)

Just tested it here on two joysticks and worked as if they key was being held in.

Maybe try it as two separate ahks one for each joystick and see if that works before combining them.

 

Edited by Kiinkyfoxx
Link to post
Share on other sites
  • 2 weeks later...

what if I went the other way with this.  i can set up ccs64 to see both joysticks just fine but then it's in joystick mode (not keyset) and listening for joystick buttons.

so, can a AHK script send joystick button presses with a keystroke?

If anyone can help a noob, I would REALLY appreciate it!

FYI, CCS64 sees my sticks as joystick 1 and joystick 3.  For joystick one button 1, I am using the 'n' key.  For joystick 3, button 1, i am using the 'w' key.

 

Link to post
Share on other sites

Join the conversation

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

Guest
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...