Jump to content
LaunchBox Community Forums

Autohotkey script to Open/Close BetterJoy


otavioraposojr

Recommended Posts

3 minutes ago, Koroth said:

I'll post my autohotkey script that I use in the running autohotkey tab for Rscp3. This script only works for me because it's specific to my situation:


SetTitleMatchMode, 2
SendMode Input
SetWorkingDir %A_ScriptDir%\..\..
Run, %A_WorkingDir%\Opstarten\DS4WinTaskkill.lnk
Loop
{
     if WinExist("Building SPU cache...")
     If (ErrorLevel = 0 )
          {
          WinActivate, Building
          WinMaximize, Building
          WinSet, AlwaysOnTop,
          Break
          }
     Else
     Sleep 1000
     Continue
}
WinWait, FPS ahk_class Qt5QWindowIcon
WinActivate,
Sleep 500
Send, !{Enter down}
Sleep 200
Send, !{Enter up} 
Sleep 500
MouseMove, 3840, -2160, 0

$Esc::
{
Send, {Esc down}
Sleep 100
Send, {Esc up}
Sleep 500
Send ^{p down}
Sleep 100
Send ^{p up}
Sleep 500
Send, {Esc down}
Sleep 100
Send, {Esc up}
Sleep 500
Send ^{s down}
Sleep 100
Send ^{s up}
Sleep 1000
Process, Close, rpcs3.exe
Run, "\LaunchBox\Opstarten\DS4Windows.lnk"
}

 

Wow, above my head, TY for posting it, maybe I can figure it out.  Again, thanks

Link to comment
Share on other sites

Unless I missed it in an earlier post, there's the ticket in the 2nd to last line [above].

@Wanderer189 Create a shortcut to your .bat file [that works to do this] that kills the DS4... process.  Right click the shortcut, select Properties, then select the "Shortcut" tab.  Click "Advanced" and check Run as Administrator".  Click OK.... OK.

Now in your Running AutoHotkey Script tab, in the $ESC sequence, have it   

Run, "full/path/to/KillDS4.lnk"

Of course changing the path and filename, respectively (too lazy to look back a page. lol).  (It'll be similar to what you had before but ".lnk" instead of ".bat")  

NOTE: that's an "L", not an "I" (eye) in .lnk [.LNK].

Link to comment
Share on other sites

57 minutes ago, JoeViking245 said:

Unless I missed it in an earlier post, there's the ticket in the 2nd to last line [above].

@Wanderer189 Create a shortcut to your .bat file [that works to do this] that kills the DS4... process.  Right click the shortcut, select Properties, then select the "Shortcut" tab.  Click "Advanced" and check Run as Administrator".  Click OK.... OK.

Now in your Running AutoHotkey Script tab, in the $ESC sequence, have it   

Run, "full/path/to/KillDS4.lnk"

Of course changing the path and filename, respectively (too lazy to look back a page. lol).  (It'll be similar to what you had before but ".lnk" instead of ".bat")  

NOTE: that's an "L", not an "I" (eye) in .lnk [.LNK].

Hey Joe, this just doesn't make any sense to me (not your reply, the results I get).

I am able to accomplish what @Koroth was doing with RPCS3 with a script like this rather than the compile and script he is using:

Run, "D:\Gaming\DS4W Off.bat"

$Esc::
{
WinClose, ahk_exe rpcs3.exe
Run, "D:\Gaming\DS4Windows"
}

I can add the same script to Yuzu and it works the same, but the goal was to do the opposite. 

However, if I simply reverse the order of the 2 "Run" lines, it won't execute the 2nd "Run".

Run, "D:\Gaming\DS4Windows"

$Esc::
{
Run, "D:\Gaming\DS4W Off.lnk"
WinClose, ahk_exe yuzu.exe
}

It will start DS4 but just won't stop it.????

UPDATE: It has to have something to do with Yuzu, it works just fine with other emulators.

Edited by Wanderer189
Link to comment
Share on other sites

Can I ask what you do to test closing DS4Windows? I'll probably kick in an open door, but those scripts only work if you close an emulator by pressing the escape key or using controller automation (which sends a virtual press of the escape key.) If you manually close an emulator the lines below $Esc:: won't get triggered. Just making sure.

Link to comment
Share on other sites

12 minutes ago, Koroth said:

Can I ask what you do to test closing DS4Windows? I'll probably kick in an open door, but those scripts only work if you close an emulator by pressing the escape key or using controller automation (which sends a virtual press of the escape key.) If you manually close an emulator the lines below $Esc:: won't get triggered. Just making sure.

I am using the <ESC> on keyboard & <ESC> via controller automation. I use a lot of home automation stuff. So when I game, I give Alexa a couple commands and it switches PC video and audio output to Bigscreen 4k hanging over the gaming PC, launches BB, etc.. After that I really need to use the controller as much as possible.

Edited by Wanderer189
Link to comment
Share on other sites

  • 6 months later...
On 12/17/2020 at 2:09 PM, Wanderer189 said:

What did you use for this part:? 

" (All this via the Running Autohotkey tab for Rpcs3.)"

For exiting rpcs3 in Launchbox - paste this in and it will exit the game and rpcs3 with the GUIDE button on your xbox controller....

vk07sc000::
    $ESC::
{   
     Process, Close, {{{StartupEXE}}}
}

 

 

 

 

Link to comment
Share on other sites

4 hours ago, NicoDirkfan said:

For exiting rpcs3 in Launchbox - paste this in and it will exit the game and rpcs3 with the GUIDE button on your xbox controller....

The easiest way to exit Rpcs3 when exiting a game is to open Rpcs3 > Config > Emulator > Tick "Exit RPCS3 when process finishes". (If you have per game custom configs you must apply this setting to all custom configs.)

2092109361_Schermopname(35).thumb.jpg.8474c6f64389386a9d5510d6106fa283.jpg

Normally I would advice against using "Process, Close" in an exit script and use "WinClose, ahk_exe rpcs3.exe" instead. (Because it is a safer way to close a window/program). But because Rpcs3 works best with a cpu with 6+ threads, rpccs3 would sometimes hangs when exiting on my 4 thread cpu. So I have to force close rpsc3.

 

 

Link to comment
Share on other sites

On 7/3/2021 at 1:21 AM, Koroth said:

The easiest way to exit Rpcs3 when exiting a game is to open Rpcs3 > Config > Emulator > Tick "Exit RPCS3 when process finishes". (If you have per game custom configs you must apply this setting to all custom configs.)

2092109361_Schermopname(35).thumb.jpg.8474c6f64389386a9d5510d6106fa283.jpg

Normally I would advice against using "Process, Close" in an exit script and use "WinClose, ahk_exe rpcs3.exe" instead. (Because it is a safer way to close a window/program). But because Rpcs3 works best with a cpu with 6+ threads, rpccs3 would sometimes hangs when exiting on my 4 thread cpu. So I have to force close rpsc3.

 

 

Thanks for your help!

Link to comment
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
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...