-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoH2-Rebinder.ahk
86 lines (78 loc) · 1.76 KB
/
CoH2-Rebinder.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
85
86
; Company of Heroes 2 Rebinder
; Version 1.2
; Scripted by Tamer
#CommentFlag //
#SingleInstance
#IfWinActive, Company Of Heroes 2
{
// Always disable capslock;
SetCapsLockState, AlwaysOff
// Keys used to suspend the script;
~Enter::Suspend
+~Enter::Suspend
~NumpadEnter::Suspend
+~NumpadEnter::Suspend
NumpadSub::Suspend On
~Esc::Suspend Off
// Togle on/off behaviour;
\::
F1::
Suspend
if (A_IsSuspended) {
//Overlay("disabled")
SoundPlay, %A_WinDir%\Media\Speech Off.wav
} else {
//Overlay("enabled")
SoundPlay, %A_WinDir%\Media\Speech On.wav
}
return
// Some keys to send messages;
F2::Send {Enter}Hey, what is the plan{?}{Enter}
F3::Send +{Enter}GL HF{!}{Enter}
// Rebind arrow keys to WASD;
w::up
a::left
s::down
d::right
// Additional rebinds here;
//g::g
//r::r
m::Send {b}{m}
c::s
z::u
f::e
q::t
e::d
t::h
`::^a
}
// Custom code to show a nice overlay in game;
// Update: This does not work anymore in the x64 version of CoH2;
Overlay(action)
{
global
Gui MyRebinder: New
Gui MyRebinder: +LastFound -Caption +ToolWindow +AlwaysOnTop
Gui MyRebinder: Font, s24, Arial q4
Gui MyRebinder: Color, 000000
if (action = "enabled")
{
Gui MyRebinder: Add, Text, x30 y15 vStatus cLime, REBINDER ENABLED!
}
else if (action = "disabled")
{
Gui MyRebinder: Add, Text, x30 y15 vStatus cRed, REBINDER DISABLED!
}
Gui MyRebinder: Font, s12 Arial q4 bold
Gui MyRebinder: Add, Text, x30 y50 vCredits cAqua, SCRIPTED BY TAMERCIAGA
WinSet, TransColor, 000000 255
Gui MyRebinder: Show, x0 y400 NoActivate, MyRebinder
// Some fancy code to show the GUI async, because it does not work with sleep;
SetTimer, AsyncCloseOverlay, 2000
return
AsyncCloseOverlay:
Gui MyRebinder: Destroy
SetTimer, AsyncCloseOverlay, Off
return
return
}