Idk if this can be done but please help me

Ask gaming related questions (AHK v1.1 and older)
smuffy
Posts: 2
Joined: 14 Oct 2017, 16:49

Idk if this can be done but please help me

14 Oct 2017, 16:59

hello, i was wondering if i can make from a #ifWinActive to a IfProccesActive , Please help,im kinda new to this this is the thing i need help with :

#IfWinActive, CSGO
#SingleInstance, force
#Persistent

#HotString EndChars `n
#HotString ?

OnExit, freeMemory


gosub getProcessAndModules

gosub vars
gosub arrays
gosub mainmenu
return



getProcessAndModules:
global newPID := getPID("CSGO")

if(newPID)
global hGTA := openProcess(newPID)
else{
MsgBox,CSGO wasn't launched properly, try relaunching the game #BuyScriptBYsmuffy
ExitApp
}
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Idk if this can be done but please help me

14 Oct 2017, 18:43

WinTitle ? You can refer to a process by something like notepad.exe or firefox.exe.
smuffy
Posts: 2
Joined: 14 Oct 2017, 16:49

Re: Idk if this can be done but please help me

16 Oct 2017, 16:33

yeah i want to run a script only if a procces run like csgo.exe can u add that to that script above please?
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Idk if this can be done but please help me

16 Oct 2017, 16:47

I'm not entirely sure what you want. The #If directives affect only hotkeys. You don't have any there.

Instead, try replacing #IfWinActive, CSGO with

Code: Select all

IfWinNotExist, ahk_exe csgo.exe
{
MsgBox CSGO isn't open
ExitApp
}
This will close the Script if it doesn't see CSGO is open.
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Idk if this can be done but please help me

16 Oct 2017, 17:02

Alternatively:

Code: Select all

Process, Exist, csgo.exe
if not (ErrorLevel) {
MsgBox, csgo doesn't exist
ExitApp
}

	
my scripts

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 78 guests