help with Script! Topic is solved

Ask gaming related questions (AHK v1.1 and older)
unpablin001
Posts: 13
Joined: 05 May 2021, 08:01

help with Script!

09 May 2021, 07:46

Hello!! I have this script, which works well for me, and I want it to run only as long as the RButton is held down.
I tried GetKeyState an IF but I don't know the structure of conditionals well. Greetings and thanks!

Code: Select all

~d::
    while GetKeyState("d")
  {
     send {e down}
		sleep 15
         }
send {e up}
return

~a::
    while GetKeyState("a")
  {
        send {q down}
	sleep 15
         }
send {q up}
return
[Mod edit: [code][/code] tags added.]
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: help with Script!  Topic is solved

09 May 2021, 08:09

Code: Select all

#If GetKeyState("RButton", "P")
~d::
Send {e down}
While GetKeyState("d", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {e up}
Return

~a::
Send {q down}
While GetKeyState("a", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {q up}
Return
#If
unpablin001
Posts: 13
Joined: 05 May 2021, 08:01

Re: help with Script!

09 May 2021, 08:33

mikeyww wrote:
09 May 2021, 08:09

Code: Select all

#If GetKeyState("RButton", "P")
~d::
Send {e down}
While GetKeyState("d", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {e up}
Return

~a::
Send {q down}
While GetKeyState("a", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {q up}
Return
#If
mikeyww WORKS PERFECT !!
I really appreciate your time and the speed with which you helped me,
thanks a lot!!
unpablin001
Posts: 13
Joined: 05 May 2021, 08:01

Re: help with Script!

09 May 2021, 08:34

mikeyww wrote:
09 May 2021, 08:09

Code: Select all

#If GetKeyState("RButton", "P")
~d::
Send {e down}
While GetKeyState("d", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {e up}
Return

~a::
Send {q down}
While GetKeyState("a", "P") & GetKeyState("RButton", "P")
 Sleep, 15
Send {q up}
Return
#If
mikeyww WORKS PERFECT !!
I really appreciate your time and the speed with which you helped me,
thanks a lot!!
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: help with Script!

09 May 2021, 09:55

You are welcome x2. :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 130 guests