help meee

Ask gaming related questions
bryantan179
Posts: 72
Joined: 29 Mar 2017, 01:55

help meee

01 May 2017, 01:02

sometimes this script gives error , which is sometimes when i click capslock , it will spam the script without stopping.how can i solve this problem ??


#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process, Priority, , H
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input


$*Capslock::
{ SendInput, {RButton Down}
SetTimer, Spam, 0 ;1000 = 1sec.
KeyWait, Capslock ;Wait for b up first, then Right Mouse will come up.
SetTimer, Spam, OFF
SendInput, {RButton Up}
}
return


Spam:
Send {3 Down}
Sleep 1
Loop
{
if not GetKeyState("Capslock","P")
break
Send {3 Up}
Sleep 1
Send {Space Down}
Sleep 1
Send {Space Up}
Sleep 1
Send {d down}
Sleep 1
Send {Space Down}
Sleep 1
Send {d Up}
Sleep 1
Send {Space Up}
Sleep 1
Send {3 Up}
Sleep 1
}
return
User avatar
Almost_there
Posts: 404
Joined: 30 Sep 2014, 10:32

Re: help meee

02 May 2017, 15:35

Because I beleive that KeyWait cannot run/wait properly while another timer is alreadyy running.

I would consider using "SetTimer, Spam, OFF" along with Break in your loop to be sure it doesn't "misfire".
bryantan179
Posts: 72
Joined: 29 Mar 2017, 01:55

Re: help meee

03 May 2017, 02:44

what do u mean by I would consider using "SetTimer, Spam, OFF" along with Break in your loop to be sure it doesn't "misfire". ??
The "SetTimer, Spam, OFF" is already in the script , so where should i put it ? also sometimes when i click the button ''capslock'' the words that i type out is in capital letter , what should i add so that ''capslock'' only function as the macro key and not as a button to send capital letter ?

you mean this ?
$*Capslock::
Loop, 1
{
if not GetKeyState("Capslock","P")
break
{ SendInput, {RButton Down}
SetTimer, Spam, 0 ;1000 = 1sec.
KeyWait, Capslock ;Wait for b up first, then Right Mouse will come up.
SetTimer, Spam, OFF
SendInput, {RButton Up}
}
return
}

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 15 guests