-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.ahk
85 lines (84 loc) · 2 KB
/
Main.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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Pixel
attackCount = 0
Loop {
Send, {Tab down}
Send, {Tab up}
PixelGetColor, color, 255, 76
;MsgBox %color%
if (color = "0x00C600" && stuck < 2) { ;Enemy Found
stuck += 1
PixelGetColor, range, 60, 612
While(range = "0x1A1AFF") { ;Continue walking if out of range
Random, rand, 19, 34
Send, {w down}
Sleep, rand
Send, {w up}
PixelGetColor, range, 60, 612
}
PixelGetColor, color2, 205, 76
Send, {3 down} ;Cast Frostbolt
Send, {3 up}
attacksSent = 0
while(color2 = "0x00A100") { ;While Enemy is alive, cast Fireballs
Random, rand, 300, 1000
Send, {2 down}
Sleep, rand
Send, {2 up}
attacksSent +=1
if (attacksSent > 25) {
Random, rand, 110, 190
Send, {w down}
Sleep, rand
Send, {w up}
attacksSent = 0
}
PixelGetColor, color2, 205, 76
}
MouseMove, 408, 364
PixelGetColor, mana, 97, 86
if(mana != "0xA50000") { ;Drink water
Sleep, 50
Send, {7 down}
Sleep, 89
Send, {7 up}
Sleep, 18000
}
PixelGetColor, health, 123, 76
if (health != "0x00C600") { ;Eat Food
Sleep, 50
Send, {8 down}
Sleep, 89
Send, {8 up}
Sleep, 18000
}
Send, +{RButton}
} else { ;Continue looking for enemy
stuck = 0
Random, rand, 100, 217
Send, {w down}
Sleep, rand
Send, {w up}
Random, leftRight, 1 , 2
Random, rand, 50, 112
if(leftRight == 1) {
Send, {a down}
Sleep, rand
Send, {a up}
} else {
Send, {d down}
Sleep, rand
Send, {d up}
}
Random, rand, 100, 213
Send, {w down}
Sleep, rand
Send, {w up}
}
}
Escape::
ExitApp
Return