Script for specific window only

Ask gaming related questions (AHK v1.1 and older)
Knewbee
Posts: 2
Joined: 18 Aug 2017, 00:24

Script for specific window only

18 Aug 2017, 00:31

Hi,

Can any one help me, this is what i want to do, i want to run the script only in that window so i can go on facebook or youtube and relax
can you pls help me thank you.
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: Script for specific window only

18 Aug 2017, 08:40

It's hard to help when we have no idea what it is that your script is doing =P

you may want to look at ControlSend

If you still need help please post your code or explain more thoroughly.
Knewbee
Posts: 2
Joined: 18 Aug 2017, 00:24

Re: Script for specific window only

19 Aug 2017, 00:25

im trying to run this sscript.

$f2::
Loop
{
Send, {f2}
Sleep, 250
MouseClick, left, 406, 327
Sleep, 250
Send, {f5}
Sleep, 250
Send, {Enter Down}
Sleep, 250
Send, {Enter Up}

if GetKeyState("f2", "P")
break
}
Return

Esc::
Pause
return
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: Script for specific window only

19 Aug 2017, 12:01

Hello again, you are looking for ControlSend and ControlClick

an example:

Code: Select all

f1::
ControlSend,,123, ahk_exe calc.exe ;using the exe name, can find in task manager
ControlSend,,456, Calculator ;or using the Title name, exact match, can use SetTitleMatchMode for other matching options
sleep 1000
ControlClick, x156 y291, ahk_exe calc.exe ;click at 156,291, + sign
sleep 50
ControlClick, x176 y291, ahk_exe calc.exe ;click at 156,291, = sign
;result = 246912 on Calculator
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 54 guests