-
Notifications
You must be signed in to change notification settings - Fork 1
/
nocturneOctavia.ahk
84 lines (70 loc) · 1.49 KB
/
nocturneOctavia.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%
/*
Keybinds:
Go to https://autohotkey.com/docs/KeyList.htm to find the list of controls
Modifiers are listed here : https://autohotkey.com/docs/Hotkeys.htm#Symbols
*/
crouchKey := "LCtrl"
metronomeKey := "3"
forceNocturneKey := "XButton2"
enableKey := "6"
;Octavia Stats
abilityDuration := 100
;Crouch tuning
nbCrouch := 8
;Internal Variables
metronomeDuration_ms := ((3/4 * 20 * abilityDuration / 100) - 1) * 1000
nocturneDuration_ms := ((3/4 * 15 * abilityDuration / 100) - 1) * 1000
pressTime_ms := 10
crouchInterval_ms := (1000 / (4 * 125 / 60)) - pressTime_ms
disabled := true
;Setup
Hotkey, *%forceNocturneKey%, procNocturne
Hotkey, *%enableKey%, toggleEn
return
procNocturne:
Loop, %nbCrouch%
{
Send, {%crouchKey% down}
Sleep, %pressTime_ms%
Send, {%crouchKey% up}
Sleep, %crouchInterval_ms%
}
return
bleepNocturne:
gosub procNocturne
SoundBeep, 660, 100
sleep, 50
SoundBeep, 660, 100
return
refreshMetronome:
Send %metronomeKey%
return
bleepMetronome:
gosub refreshMetronome
SoundBeep, 440, 100
return
toggleEn:
if (disabled){
disabled := false
SoundBeep, 400, 100
sleep, 50
SoundBeep, 440, 100
SetTimer, bleepMetronome, %metronomeDuration_ms%
SetTimer, bleepNocturne, %nocturneDuration_ms%
gosub refreshMetronome
Sleep 500
gosub procNocturne
}
else{
disabled := true
SoundBeep, 440, 100
sleep, 50
SoundBeep, 400, 100
SetTimer, bleepMetronome, Off
SetTimer, bleepNocturne, Off
}
return