Please Help... <3 Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Jpnzprodigy
Posts: 2
Joined: 14 Nov 2017, 20:20

Please Help... <3

09 Jul 2018, 01:47

:!: Switching my script from a hold down spam to a Toggler :!:

#ifWinActive World of Warcraft ; Only run if window 'World of Warcraft' is active
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1


{
; The following script is run when the user presses the '1' key
; and will loop until the 1 key is no longer pressed, sending
; 1 over and over every delay miliseconds. To use a different
; key, replace all three 1s with the key you want repeated.

delay:=95

$1::
Loop
{
if not GetKeyState("1", "P")
break
Send 1
Sleep delay
}
return


:) please and thank you
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Please Help... <3

09 Jul 2018, 07:35

Try:

Code: Select all

#ifWinActive World of Warcraft ; Only run if window 'World of Warcraft' is active
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1


; The following script is run when the user presses the '1' key
; and will loop until the 1 key is no longer pressed, sending
; 1 over and over every delay miliseconds. To use a different
; key, replace all three 1s with the key you want repeated.
delay:=95

$1::
KeyWait, 1
Loop 
{
if GetKeyState("1", "p")
break
Send 1 
Sleep % delay / 2 
if GetKeyState("1", "p")
break
Sleep % delay / 2
}
return
jprodigylazy2login

Re: Please Help... <3

09 Jul 2018, 08:48

nice well it works but just wondering what are the things u added in and what to they do?
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Please Help... <3  Topic is solved

09 Jul 2018, 09:53

jprodigylazy2login wrote:nice well it works but just wondering what are the things u added in and what to they do?

Code: Select all

#ifWinActive World of Warcraft ; Only run if window 'World of Warcraft' is active
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1


; The following script is run when the user presses the '1' key
; and will loop until the 1 key is no longer pressed, sending
; 1 over and over every delay miliseconds. To use a different
; key, replace all three 1s with the key you want repeated.
delay:=95

$1::
KeyWait, 1 ; Wait until "1" is released
Loop 
{
if GetKeyState("1", "p") ; if "1" is pressed break the loop #### you can't just use "GetKeyState("1", "t")" because "Send 1" will "untoggle" it
break
Send 1 
Sleep % delay / 2 ; Half the sleep delay to check the KeyState more frequently
if GetKeyState("1", "p") ; if "1" is pressed break the loop 
break
Sleep % delay / 2
}
return
jpnzprodigyislazy

Re: Please Help... <3

12 Jul 2018, 11:12

Alright thanks a bunch man :) apppreciate the help one last thing tho :x i love the script works perfectly problem i have tho is when i try to talk it just spams 1 when i press 1 is there a way to make it like start the toggle after i hold it down for more then X amount of seconds. lets say X = 3 secs
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Please Help... <3

13 Jul 2018, 05:49

Code: Select all

;#ifWinActive World of Warcraft ; Only run if window 'World of Warcraft' is active
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1


; The following script is run when the user presses the '1' key
; and will loop until the 1 key is no longer pressed, sending
; 1 over and over every delay miliseconds. To use a different
; key, replace all three 1s with the key you want repeated.
delay:=95
toggle_after := 1000

~$*1::
Loop, 4
{
	if(!GetKeyState("1", "p")) ; if "1" isn't pressed return
	{
		return
	}
	Sleep, % toggle_after / 4
}

Loop
{
if GetKeyState("1", "p") ; if "1" is pressed break the loop #### you can't just use "GetKeyState("1", "t")" because "Send 1" will untoggle it
break
Send 1 
Sleep % delay / 2 ; Half the sleep delay to check the KeyState more frequently
if GetKeyState("1", "p") ; if "1" is pressed break the loop 
break
Sleep % delay / 2
}
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 33 guests