when key 1 is press, then press 2 and 3?

Ask gaming related questions (AHK v1.1 and older)
chiqchui
Posts: 2
Joined: 21 Jul 2021, 19:31

when key 1 is press, then press 2 and 3?

28 Jul 2021, 09:21

can someone help me
i dont wanna use hotkey feature ::
because it disable my button in-game when i use hotkey
but gaves me bunch of error i hope someone can help me. thank so much

heres the rest of the code:

Code: Select all

#NoEnv  
SendMode Input 
SetWorkingDir %A_ScriptDir%
#SingleInstance ,force


home::
WinGet, AhkPID, PID, A
WinGetClass, Ragnarok, ahk_pid %AhkPID%
IniWrite, %AhkPID%, sight.ini, process, ahk_pid
IniRead, ahk_pid, sight.ini, process, ahk_pid
SplashTextOn,,, sight PID:%AhkPID% is now ACTIVATED
Sleep 2000
SplashTextOff
Sight()


Sight(){
  While GetKeyState("1","P") 
{
ControlSend, ahk_parent, 2, ahk_pid %AhkPID%
sleep 50
ControlSend, ahk_parent, 3, ahk_pid %AhkPID%
sleep 50
}





end::exitapp
Rohwedder
Posts: 7611
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: when key 1 is press, then press 2 and 3?

28 Jul 2021, 09:47

Hallo,
perhaps:

Code: Select all

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance ,force

home::
WinGet, AhkPID, PID, A
WinGetClass, Ragnarok, ahk_pid %AhkPID%
IniWrite, %AhkPID%, sight.ini, process, ahk_pid
IniRead, ahk_pid, sight.ini, process, ahk_pid
SplashTextOn,,, sight PID:%AhkPID% is now ACTIVATED
Sleep 2000
SplashTextOff
Sight()
Return
Sight()
{
	While GetKeyState("1","P")
	{
		ControlSend, ahk_parent, 2, ahk_pid %AhkPID%
		sleep 50
		ControlSend, ahk_parent, 3, ahk_pid %AhkPID%
		sleep 50
	}
}
end::exitapp
By the way: Tilde: ~ prefix when the hotkey fires, its key's native function will not be blocked.

Code: Select all

#InputLevel, 1
~1::2
#InputLevel, 0
~2::3

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 53 guests