Page 1 of 1

Please Help... <3

Posted: 09 Jul 2018, 01:47
by Jpnzprodigy
:!: 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

Re: Please Help... <3

Posted: 09 Jul 2018, 07:35
by Qysh
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

Re: Please Help... <3

Posted: 09 Jul 2018, 08:48
by jprodigylazy2login
nice well it works but just wondering what are the things u added in and what to they do?

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

Posted: 09 Jul 2018, 09:53
by Qysh
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

Re: Please Help... <3

Posted: 12 Jul 2018, 11:12
by jpnzprodigyislazy
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

Re: Please Help... <3

Posted: 13 Jul 2018, 05:49
by Qysh

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