Jump to content
LaunchBox Community Forums

AHK script to start KOF XIII and close cryptserver.exe on exit


Recommended Posts

IfExist, .\NesysService.exe
Run, NesysService.exe -app
Sleep, 5000
IfExist, .\cryptserver.exe
Run, cryptserver.exe
Sleep, 10000
IfExist, .\RFIDGod_inject.exe
Sleep, 5000
Run, RFIDGod_inject.exe
Escape::
Process,close,NesysService.exe
Process,close,RFIDGod_inject.exe
Process,close,Game.exe
Process,close,cryptserver.exe
Process,close,Start_Game.exe
Process,WaitClose,NesysService.exe
Process,WaitClose,RFIDGod_inject.exe
return

 

Save script as Save_Game.exe. Compile with AutoHotScript so end results is Save_Game.exe.

It's not much but I hope it helps.

Edited by GamerWithGlasses
Link to comment
Share on other sites

On 2/12/2017 at 11:29 PM, GamerWithGlasses said:

IfExist, .\NesysService.exe
Run, NesysService.exe -app
Sleep, 5000
IfExist, .\cryptserver.exe
Run, cryptserver.exe
Sleep, 10000
IfExist, .\RFIDGod_inject.exe
Sleep, 5000
Run, RFIDGod_inject.exe
Escape::
Process,close,NesysService.exe
Process,close,RFIDGod_inject.exe
Process,close,Game.exe
Process,close,cryptserver.exe
Process,close,Start_Game.exe
Process,WaitClose,NesysService.exe
Process,WaitClose,RFIDGod_inject.exe
return

 

Save script as Save_Game.exe. Compile with AutoHotScript so end results is Save_Game.exe.

It's not much but I hope it helps.

New Update. in case you are not aware, KOF 98 NesicaXLive and KOF 2002 both, at least on my computer, require the 5.1 audio channel to be switch to stereo before running the game or the game will not run correclty. To do this, automatically, I had to create two separate AHK scripts.

THe first one runs the game, makes the appropriate checks, launches another AHK script where it changes the audio to stereo then loads the game. ESC shuts down all process and also switches the audio back to 5.1. This is handy in case you have a HTPC setup like I do and need to make changes for these two titles.

 

Called for KOF 98 Start_Game_kof.exe. So the AHK would be saved as Start_Game_kof98.ahk

IfExist, .\NesysService.exe
Run, NesysService.exe -app
Sleep, 5000
IfExist, .\cryptserver.exe
Run, cryptserver.exe
Sleep, 10000
Run, D:\Documents\AutoHotKey Scripts\Audio_Channel_Switcher1.1.exe
Sleep, 500
send {F1}
Sleep, 1000
IfExist, .\game kof98.exe
Sleep, 2000
Run, game kof98.exe
Escape::
Process,close,NesysService.exe
Process,close,game kof98.exe
Process,close,cryptserver.exe
Sleep, 1000
Process,WaitClose,NesysService.exe
Process,WaitClose,Game kof98.exe
Sleep 1000
send {F2}
Sleep, 1000
Process,Close,Audio_Channel_Switcher1.1.exe
sleep 500
Process,Close,Start_Game_kof.exe
return

the second code is where the magic happens for the switching. This only works in the instance where your default audio device is listed first.

F1::
	Run,Mmsys.cpl
	WinWait,Sound
	Send,{down}{tab}{enter}
	WinWait,Speaker Setup
	send {Up 4}{Tab 2}{Enter 3}
	Process,close,mmsys.cpl
	send {tab}{tab}{Enter 1}
return
F2::
	Run,Mmsys.cpl
	WinWait,Sound
	Send,{down}{tab}{enter}
	WinWait,Speaker Setup
	send {down 4}{tab}{tab}{Enter 4}
	send {tab}{tab}{tab}{Enter 1}
return

Called Audio_Channel_Switcher1.1.exe

 

Hope it helps.

 

You may have to edit depending on file location, file names and system audio configuration.

Edited by GamerWithGlasses
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...