Code: Select all
~*q::
If (AltLmb == 0)
{
AltLmb := 1
a := 3
}
Gosub Update
cooling2(hk) {
Static wait := QAbilityCD
now := A_TickCount
If cooling2.HasKey(hk) && cooling2[hk] > now
Return True
cooling2[hk] := now + wait
}
LmbCD := 100
return
#If !cooling(A_ThisHotkey)
~*LButton::
If (AltLmb = 0)
a++
If (AltLmb = 1)
Gosub Reset
Gosub AltCheck
Gosub Update
cooling(hk) {
Static wait := LmbCD
now := A_TickCount
If cooling.HasKey(hk) && cooling[hk] > now
Return True
cooling[hk] := now + wait
}
SendInput, {LButton}
KeyWait, LButton, D
Settimer, Clik, % LmbCD
KeyWait, LButton, U
SetTimer Clik, Off
Sleep 10
LmbCD := (CooldownOfLmb*1000)
Return
Also here's the entire code:
Code: Select all
#SingleInstance
#MaxThreadsPerHotkey 5
#UseHook
Suspend on
Global cooling := {}
Global cooling1 := {}
Global cooling2 := {}
;-------Settings-------
MouseOffSet := 100 ;Mouse coordinate offset before spinning 180
TurnRange := 100 ;Range spin
Fast := 0 ;Speed of the turn
MonitorResolution := 1920 ;Resolution of the monitor
;-Cooldown-
CooldownOfLmb := 0.5 ;Lmb cooldown in seconds
CooldownOfQ := 5 ;Q cooldown in seconds
;-------End_of_Settings-------
a := 0
AltLmb := 0
LmbCD := (CooldownOfLmb*1000)
QAbilityCD := (CooldownOfQ*1000)
HalfOfMonitorResolution := (MonitorResolution / 2)
LeftSpin := (-1*TurnRange)
LeftBack := ((-1*CenterCoordinateZero)+TurnRange)
RightBack := (-1*(CenterCoordinateZero+TurnRange))
NegMouseOffSet := (MouseOffSet*(-1))
AimOffSet:
MouseGetPos, xpos
CenterCoordinateZero := (xpos-HalfOfMonitorResolution)
Return
\::
Suspend
return
Gosub Reset
u::
Gosub AimOffSet
ToolTip % "X = " CenterCoordinateZero
Return
Update:
ToolTip % "AltLmb = " AltLmb "`n"
. "a = " a "`n"
Return
AltCheck:
If (a = 3)
AltLmb := 1
ALmb := True
If (a > 3)
Gosub Reset
return
Reset:
AltLmb := a := 0
ALmb := False
Return
Clik:
SendInput,{LButton}
a++
Gosub AltCheck
Gosub Update
Return
#If !cooling1(A_ThisHotkey)
~*f::
Send, f
If (AltLmb == 0)
{
Sleep 200
SendInput, {LButton}
a++
}
Gosub AltCheck
Gosub Update
cooling1(hk) {
Static wait := 300
now := A_TickCount
If cooling1.HasKey(hk) && cooling1[hk] > now
Return True
cooling1[hk] := now + wait
}
return
#if ALmb
~s & LButton::
Sleep 200
Gosub AimOffSet
LeftSpin := (-1*TurnRange)
LeftBack := ((-1*CenterCoordinateZero)+TurnRange)
RightBack := (-1*(CenterCoordinateZero+TurnRange))
If (CenterCoordinateZero >= MouseOffSet)
{
MouseMove TurnRange, 0, Fast, R
Sleep 10
SendInput, {LButton}
a++
Sleep 100
MouseMove RightBack, 0, Fast, R
}
If (CenterCoordinateZero <= NegMouseOffSet)
{
MouseMove LeftSpin, 0, Fast, R
Sleep 10
SendInput, {LButton}
a++
Sleep 100
MouseMove LeftBack, 0, Fast, R
}
Gosub AltCheck
Gosub Update
return
#If !cooling2(A_ThisHotkey)
~*q::
If (AltLmb == 0)
{
AltLmb := 1
a := 3
}
Gosub Update
cooling2(hk) {
Static wait := QAbilityCD
now := A_TickCount
If cooling2.HasKey(hk) && cooling2[hk] > now
Return True
cooling2[hk] := now + wait
}
LmbCD := 100
return
#If !cooling(A_ThisHotkey)
~*LButton::
If (AltLmb = 0)
a++
If (AltLmb = 1)
Gosub Reset
Gosub AltCheck
Gosub Update
cooling(hk) {
Static wait := LmbCD
now := A_TickCount
If cooling.HasKey(hk) && cooling[hk] > now
Return True
cooling[hk] := now + wait
}
SendInput, {LButton}
KeyWait, LButton, D
Settimer, Clik, % LmbCD
KeyWait, LButton, U
SetTimer Clik, Off
Sleep 10
LmbCD := (CooldownOfLmb*1000)
Return