help

Ask gaming related questions (AHK v1.1 and older)
bryantan179
Posts: 74
Joined: 29 Mar 2017, 01:55

help

20 Jan 2018, 11:47

i want to bind a certain script to a certain hotkey . by using a 2nd script , the 1st script is looped together with other buttons of my choice . for example , i bind 1st script to the LShift hotkey , and in the 2nd script when i click or hold capslock , it will loop the buttons that i want together with the LShift (1st script ). is this possible ??

1st script :

#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000

$*LShift::
Loop
{
if not GetKeyState("LShift","P")
break
Send {Space down}
Send {Space up}
Send {s down}
Send {Space down}
Send {s up}
Send {Space up}
}


2nd script :
#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000

$*capslock::
Loop
{
if not GetKeyState("capslock","P")
break
Send {2 down}
Send {2 up}
Send {LShift down}
Send {d down}
Send {LShift up}
Send {d up}
}
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: help

21 Jan 2018, 05:19

Hallo,
not on this method! The 1st script uses GetKeyState("LShift","P").
"P" retrieves the physical state.
The 2st script can not physically press LShift!
Try:

Code: Select all

#Persistent
Loop
	If GetKeyState("q")
		Send k
and

Code: Select all

capslock::
While GetKeyState("capslock","P")
{
	Send {q down}
	Sleep, 200
	Send {q up}
	Sleep, 1000
}
bryantan179
Posts: 74
Joined: 29 Mar 2017, 01:55

Re: help

23 Jan 2018, 05:11

the first script doesnt work .when i click q , it spams q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q instead of what i want.it should spam something like 2s a 2s a 2s a 2s a 2s a when both scripts are used.

1st script :
#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000
#Persistent
Loop
While GetKeyState("q")
Send {Space down}
Send {Space up}
Send {s down}
Send {Space down}
Send {s up}
Send {Space up}

2nd script :
#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000

$*capslock::
While GetKeyState("capslock","P")
{
Send {2 down}
Send {2 up}
Send {RButton down}
Send {q down}
Send {a down}
Send {q up}
Send {a up}
}
Send {RButton up}
keywait ,capslock
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: help

23 Jan 2018, 12:07

Hallo,
instead of the problematic modifier hotkeys, this with q and w.
Try:

Code: Select all

#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000
$*w::SetTimer,Timer,10
$*w Up::SetTimer,Timer,Off
Timer:
Send {Space down}
Send {Space up}
Send {s down}
Send {Space down}
Send {s up}
Send {Space up}
Return
and

Code: Select all

#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000
$*q::
SendLevel,1
While GetKeyState("q","P")
{
	Send {2 down}
	Send {2 up}
	Send {w down}
	Send {d down}
	Send {w up}
	Send {d up}
}
when i click q , it spams
2 ds 2d 2s d2d s 2d s2 d 2s d2d s2 d s 2d s2 d s 2 ds2 d s 2d s 2d s2 d s
bryantan179
Posts: 74
Joined: 29 Mar 2017, 01:55

Re: help

23 Jan 2018, 12:32

this works but can u make it more the sequence of the macro more consistent ?? sometime like this 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d 2s d
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: help

24 Jan 2018, 01:29

Hallo,
the easiest way is, of course, if you only use one script:

Code: Select all

#MaxHotkeysPerInterval 9900000000000
#HotkeyInterval 9900000000000
$*q::
While GetKeyState("q","P")
{
	Send 2s{Space}
	Send d{Space}
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 95 guests