forked from nmynarcik/dfscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDFScripts.ahk
279 lines (229 loc) · 5.31 KB
/
DFScripts.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/*
----------------------------------------------------------------------------
AutoHotKey transition from AutoIt
Author: RedSeal
Script Function:
Darkfall Scripts converted from AutoIt script.
-----------------------------------------------------------------------------
*/
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
destination = %A_WorkingDir%\images\splash.jpg
SplashImage, %destination%, , , , DFScripts
SoundPlay, %A_WorkingDir%\audio\WATER.WAV
Sleep, 3000
SplashImage, Off
;Set the number of rays you have here
num_rays = 7
;Variables
potted := false
$PotTimer = -60000
g_cool = false
k_1 = {RShift Down}7{RShift Up} ;Pungent Mist
k_2 = {RShift Down}1{RShift Up} ;Dragon's Breath
k_3 = {RShift Down}3{RShift Up} ;Impale
k_4 = {RShift Down}4{RShift Up} ;Insect Swarm
k_5 = {RShift Down}2{RShift Up} ;Unholy Caress
k_6 = {RShift Down}5{RShift Up} ;Frost Bite
k_7 = {RShift Down}6{RShift Up} ;Lightning Bolt
;Tweak cooldowns here
cd_1 = 16000 ;Pungent Mist
cd_2 = 14000 ;Dragon's Breath
cd_3 = 6500 ;Impale
cd_4 = 13000 ;Insect Swarm
cd_5 = 14000 ;Unholy Caress
cd_6 = 9500 ;Frost Bite
cd_7 = 9000 ;Lightning Bolt
r_1 = 1 ;Pungent Mist
r_2 = 1 ;Dragon's Breath
r_3 = 1 ;Impale
r_4 = 1 ;Insect Swarm
r_5 = 1 ;Unholy Caress
r_6 = 1 ;Frost Bite
r_7 = 1 ;Lightning Bolt
gCool:
g_cool = false
return
;Subroutine group to reset ray cds
1:
2:
3:
4:
5:
6:
7:
r_%A_ThisLabel% = 1
Return
; Quick Loot Setup
IniRead, xdest, %iniFile%, Loot, 1425 ; x destination used for quick looter
IniRead, ydest, %iniFile%, Loot, 627 ; y destination
;****************************************
; Quick loot
; Alt+Right Click - sets the location
; Alt+Left Click - moves item under cursor to set location
;
~$!Lbutton::
MouseGetPos, x1, y1
MouseClickDrag, left, x1, y1, xdest, ydest, 0 ;0 is mouse speed, 0 is instant
MouseMove, x1, y1, 0 ;0 is mouse speed, 0 is instant
Return
;Loot destination setup
~$!Rbutton::
MouseGetPos, xdest, ydest
IniWrite, %xdest%, %iniFile%, Loot, xdest
IniWrite, %ydest%, %iniFile%, Loot, ydest
Return
;hotkey to kill script
End::terminate()
#If !isMouseShown() and #If WinActive("Darkfall Online")
;Set your ray HotKey here (currently set to Mid Mouse Button)
Numpad4::
SetCapsLockState, Off
;Set heavy staff here, if you don't want to use that remove the next send/sleep lines, change sleep suit ping
;MsgBox,,%g_cool%
if g_cool = false
{
cur_ray := RayLogic()
if cur_ray > 0
{
g_cool = true
KeySend(cur_ray)
sleep, 30
SendInput {LButton}
SetTimer, gCool , -1200
r_%cur_ray% = 0
neg_cur_cool := -cd_%cur_ray%
SetTimer , %cur_ray% , %neg_cur_cool%
}else{
SendInput +{Numpad9}
Sleep, 20
SendInput {LButton}
}
}
Return
;Sends the key of the current ray
KeySend(cur_ray)
{
global
SendInput , % k_%cur_ray%
Return
}
RayLogic()
{
global
num = 0
; find the first available ray off cooldown
Loop, 6
{
if (r_%A_Index% = 1)
{
num = %A_Index%
break
}
}
Return num
}
1::whirlwind()
2::powerAttack()
3::knockback()
4::disableParry()
~6::
~7::
~8::
drinkPot()
return
~*v::sword_board()
;****************************************
; Sprint Toggle
;
~*w::F10 ;supposedly this should work
;your gui mode key
~Escape::
GetKeyState, state, F10
if(state == "D") {
Sleep, 100
SendInput {F10 up}
SendInput {F10 down}
}
return
;your autorun key
~UP::
SendInput {F10 down}
return
;****************************************
;
; Functions
whirlwind()
{
SendInput 1
SendInput +q ;gsword ww
SendInput +d ;disable shot
SendInput +e ;knives ww
SendInput !^+q ;pole ww
} ;==>whirlwind
powerAttack()
{
SendInput 2
SendInput ^+q ;gsword power
SendInput ^+e ;knives power
SendInput !^+e ;pole power
} ;==>powerAttack
knockback()
{
SendInput 3
SendInput !+q ;sword knockback
SendInput !+e ;knives knockback
SendInput !^+d ;pole knockback
} ;==>knockback
disableParry()
{
SendInput 4
SendInput !^+l
} ;==>disableParry
sword_board()
{
SendInput N
Sleep, 550
SendInput O
TrayTip, DF Scripts, Sword/Board Ready!, 3, 1
} ;==>sword_board
;Pot functions
drinkPot()
{
global
if (potted = false){
TrayTip, DF Scripts, Drinking Pot!, 5, 2
SoundPlay %A_WorkingDir%\audio\drinkingpot.wma
potted = true
SetTimer, potReady, %$PotTimer%
}
} ;==>drinkPot
;announce pot is ready
potReady:
{
TrayTip, DF Scripts, Pot Ready!, 5, 2
SoundPlay, %A_WorkingDir%\audio\potready.wma
potted := false
return
} ;==>potReady
; GUI check in game
isMouseShown()
{
StructSize := A_PtrSize + 16
VarSetCapacity(InfoStruct, StructSize)
NumPut(StructSize, InfoStruct)
DllCall("GetCursorInfo", UInt, &InfoStruct)
Result := NumGet(InfoStruct, 8)
if Result
return 1
else
return 0
}
;end the script
terminate()
{
SoundPlay, %A_WorkingDir%\audio\soft_whoosh10.wav, WAIT
ExitApp
} ;==>terminate