why this script run outside game?

Ask gaming related questions (AHK v1.1 and older)
maload
Posts: 40
Joined: 05 Mar 2017, 22:13

why this script run outside game?

21 Jan 2018, 23:17

;=== autohotkey.ahk =====


; #Warn

SetWorkingDir %A_ScriptDir%
#HotkeyInterval 20000 ; This is the default value (milliseconds).
#MaxHotkeysPerInterval 20000



#IfWinActive,ahk_class RFG

$q::
{
toggle:=!toggle
if (toggle)
{
sendinput, {w down}{LSHIFT down}
}
else
{
sendinput, {w }{LSHIFT up}
}
}
return



numpad1::Suspend


LButton::
Loop
{
SetMouseDelay 30
Click
If (GetKeyState("LButton","P")=0)
Break
}

return


mButton::domino66Click()



domino66Click(Interval=100){

static Toggler

Toggler := !Toggler

TPer := Toggler ? Interval : "off"

SetTimer, Ck, %TPer%

return

Ck:

Click

return

}


#IfWinActive


-----------------------------------------------------------------------------------------------------------------------

sorry i have very low iq and i try to read doc but i cant understand it.
so please help me write a working script

that ahk_class RFG i got from windows spy so i think thats it .
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: why this script run outside game?

22 Jan 2018, 02:44

When the Ck timer is running it will not stop.
You can do something like this to have clicks only in game.

Code: Select all

Ck:
    if WinActive("ahk_class RFG")
        Click
return
HTH
maload
Posts: 40
Joined: 05 Mar 2017, 22:13

Re: why this script run outside game?

22 Jan 2018, 03:17

thank you so much

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 55 guests