-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame_Titan_Quest.ahk
107 lines (88 loc) · 2.16 KB
/
Game_Titan_Quest.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#Include <_COMMON_SETTINGS_>
Menu, Tray, Icon
;Reload_AsAdmin()
;SetKeyDelay, 10
;SetMouseDelay, 50
sLeftClickKey := "q"
sMoveAttackKey := "LCtrl"
sStationaryAttackKey := "LShift"
iTimeIdleKeyboard := 200
iTimerDelay := 250
; {HotKey: "FuncName", ...}; () - because we use variables, inside object initialization
oTimers := {(sMoveAttackKey): "MoveAttack", (sStationaryAttackKey): "StationaryAttack"}
GroupAdd, TQ, ahk_exe TQ.exe
if not WinExist("ahk_group TQ")
Run, "F:\GAMES\Titan Quest - Anniversary Edition\TQ.exe" /dx11, F:\GAMES\Titan Quest - Anniversary Edition\
;Make Hotkeys from 0 to 9
Hotkey, IfWinActive, ahk_group TQ
Loop, 10
Hotkey, % A_Index - 1, UseSkill
HotKey, % sLeftClickKey, LeftClick
;Make Hotkeys from oTimers object
for sKeyName, sTimerLabel in oTimers {
oHotKeyFunc := Func("EnableTimer").bind(sTimerLabel)
Hotkey, % sKeyName, % oHotKeyFunc
SetTimer, % sTimerLabel, % iTimerDelay
SetTimer, % sTimerLabel, Off
}
UseSkill() {
;key := 30 + A_ThisHotkey
;Send, {vk%key% Down}
;SendEvent, {vk34 Down}
;Sleep, 250
;Send, {vk%key% Up}
;SendEvent, {vk34 Up}
Send, %A_ThisHotkey%
Sleep, 250
Click
}
EnableTimer(sTargetTimerLabel := "") {
global oTimers
for key, sTimerLabel in oTimers {
if (sTimerLabel == sTargetTimerLabel)
SetTimer, % sTimerLabel, On
else
SetTimer, % sTimerLabel, Off
}
ToolTip
}
Click() {
Click
Sleep, 250
}
LeftClick() {
EnableTimer() ;Disable all timers
Click
}
MoveAttack() {
;ToolTip, % A_ThisFunc
Click
}
StationaryAttack() {
return
;ToolTip, % A_ThisFunc
Send, {vkA0 Down} ;Shift Down
Click()
Send, {vkA0 Up}
}
/*
StopTimersIfAnyKeyPressed:
if (A_TimeIdleKeyboard < iTimeIdleKeyboard && A_TickCount - iTimeClick > iTimeIdleKeyboard + 50)
bAnyKeyPressed := true
else
bAnyKeyPressed := false
return
*/
s::
Click, Right
Sleep, 250
return
#IfWinActive
F1:: ShowHelpWindow("
(LTrim
Q -> ВЫКЛ. все; авто клик левой кнопкой мыши
Ctrl -> ВКЛ. авто движение и атака
Shift -> ВКЛ. авто атака на месте
)")
!z:: Reload
!x:: ExitApp