-
Notifications
You must be signed in to change notification settings - Fork 2
/
auto_fisher.ahk
75 lines (64 loc) · 1.5 KB
/
auto_fisher.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
SearchForLetter(x, y) {
PixelSearch, px, py, x, y, x, y, 0xFFFFFF, 3, Fast
return !ErrorLevel ; returns 1 if found, 0 otherwise
}
SearchForEasyLetters() {
key_coordinates := { q : { x_coord: 1180, y_coord: 1020 }
, w: { x_coord: 1210, y_coord: 865 }
, a: { x_coord: 1162, y_coord: 970 }
, x: { x_coord: 1191, y_coord: 862 }
, d: { x_coord: 1192, y_coord: 934 } }
For key, coords in key_coordinates
{
result := SearchForLetter(coords.x_coord, coords.y_coord)
if result
return %key%
}
}
; TODO: Consolidate these
SearchForS(){
if SearchForLetter(1168, 857) && SearchForLetter(1169, 921)
return "s"
}
SearchForZ(){
if SearchForLetter(1184, 861) && SearchForLetter(1158, 979)
return "z"
}
SearchForC(){
if SearchForLetter(1168, 857) && SearchForLetter(1143, 940) && !SearchForLetter(1182, 915)
return "c"
}
SearchForE(){
if SearchForLetter(1164, 865) && SearchForLetter(1158, 939) && SearchForLetter(1163, 995)
return "e"
}
CastLine(){
PixelSearch, px, py, 942, 538, 942, 538, 0x33C1BB, 3, Fast RGB
if !ErrorLevel
Click
}
F2::
enabled = 0
return
F3::
enabled = 1
while enabled
{
search_functions := ["SearchForEasyLetters"
, "SearchForS"
, "SearchForZ"
, "SearchForC"
, "SearchForE"]
for _, function in search_functions{
key := %function%()
if key
{
SendInput %key%
FileAppend, Pressed %key% `n, fishing_log.txt
Sleep 1000 ; Allow the text on screen to change
break
}
}
CastLine()
}
return