-
Notifications
You must be signed in to change notification settings - Fork 17
/
functions.ahk
171 lines (156 loc) · 3.3 KB
/
functions.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
AutoDetonate(){
if auto_detonate_active{
while (GetKeyState("RButton", "P")){
Send {RButton}
Sleep mine_laying_time
Send {d}
Random, rand, 10, 40
Sleep rand
}
}
else{
}
}
Activate_AutoDetonate(){
auto_detonate_active := !auto_detonate_active
if auto_detonate_active{
MsgBox , 0, , Auto Detonate : On, 0.5
}
else{
MsgBox , 0, , Auto Detonate : Off, 0.5
}
return
}
Activate_AutoFlask(){
auto_flask_active := !auto_flask_active
if auto_flask_active{
MsgBox , 0, , Auto flask : On, 0.5
AutoFlask()
}
else{
MsgBox , 0, , Auto flask : Off, 0.5
}
return
}
AutoFlask(){
while auto_flask_active
{
if WinActive("Path of Exile")
{
PixelGetColor, color, low_life_X, low_life_Y
if color != %life_color%
{
QuickFlask(low_life_flask_list)
Sleep 150
}
}
}
return
}
Set_Autoflask(){
MouseGetPos, low_life_X, low_life_Y
PixelGetColor, life_color, %low_life_X%, %low_life_Y%
MsgBox , 0, , Auto Flask reset. X: %low_life_X%. Y: %low_life_Y%. color: %life_color%, 1
return
}
Activate_QuickFlask(){
quick_flask_active := !quick_flask_active
if quick_flask_active{
MsgBox , 0, , Quick flask : On, 0.5
AutoFlask()
}
else{
MsgBox , 0, , Quick flask : Off, 0.5
}
return
}
QuickFlask(list){
Loop, parse, list, -
{
Send {%A_LoopField%}
Sleep 50
}
return
}
QuickEnter(channel){
if channel {
BlockInput On
temp := Clipboard
Clipboard := channel
ClipWait
Send {Enter}
Send ^v
Send {Enter}
Sleep 100
Clipboard := temp
ClipWait
BlockInput Off
}
return
}
CheckMousePos(){
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
MsgBox, x=%MouseX% y=%MouseY% Color=%color%.
return
}
LootBigRegion(){
PixelSearch, Px, Py, 100, 100, A_ScreenWidth-10, A_ScreenHeight-150, lootColor, 5, Fast
if ErrorLevel{
return False
}
else{
Px := Px + 50
Py := Py + 20
Click %Px%, %Py%
return True
}
}
LootSmallRegion(){
PixelSearch, Px, Py, 650, 300, 950, 500, lootColor, 5, Fast
if ErrorLevel{
return False
}
else{
Px := Px + 50
Py := Py + 20
Click %Px%, %Py%
return True
}
}
LootAll(){
while (GetKeyState("LControl", "P") && GetKeyState("a", "P")){
if !LootSmallRegion(){
break
}
Sleep loot_dalay
}
while (GetKeyState("LControl", "P") && GetKeyState("a", "P")){
LootBigRegion()
Sleep 1200
while (GetKeyState("LControl", "P") && GetKeyState("a", "P")){
if !LootSmallRegion(){
break
}
Sleep loot_dalay
}
}
}
OpenPortal(){
BlockInput On
MouseGetPos x, y
Send {i}
Click, %portalX%, %portalY%, right
Send {i}
MouseMove, x, y
BlockInput Off
return
}
QuickSearchItem(){
temp := Clipboard
Clipboard := GetItemName()
if Clipboard !=
SearchItem(url)
Clipboard := temp
return
}