-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHuntingLoops.h
More file actions
247 lines (240 loc) · 5.88 KB
/
HuntingLoops.h
File metadata and controls
247 lines (240 loc) · 5.88 KB
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
//=========================HUNTING LOOPS=========================//
/*
* repeatedly runs horde encounters
* assumes you have a pokemon with sweet scent in the third slot in your party
* your first slot pokemon has no critical ability
* the target pokemon has no critical ability
*/
void horde_default() {
x();
a();
delay(1600);
down();
a();
down();
a();
a();
delay(8000);
float startR, startG, startB;
measureLight(&startR, &startG, &startB);
delay(10500); //8500 for less laggy, bit of an issue, 9100 for laggier like vulpix
//10200 for oras
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (!detectTransition(startR, startG, startB, endR, endG, endB)) {
onShinyFound();
}
left();
right();
a();
delay(8000); //6500 for lower levels, implement run away pokemon, 8500 for laaag
}
void horde_new() {
double loopTime = 0;
double timeTaken;
x();
a();
delay(200);
//Serial.print("Entering X menu: ");
timeTaken = getTransition(3000);
loopTime += timeTaken;
//Serial.println(timeTaken); //1.15
down();
a();
down();
a();
a();
delay(200);
//Serial.print("Sweet scent: ");
timeTaken = getTransition(3000);
loopTime += timeTaken;
//Serial.println(timeTaken);
delay(200);
//Serial.print("SS animation: ");
timeTaken = getBlackScreen(8000);
loopTime += timeTaken;
//Serial.println(timeTaken);
delay(200);
//Serial.print("Shiny measurement: ");
timeTaken = getTransition(30000, 2, true);
loopTime += timeTaken;
Serial.println(timeTaken);
if (timeBuckets.add(timeTaken)) {
onShinyFound();
}
left();
right();
a();
delay(400);
//Serial.print("Run fuzzy screen: ");
timeTaken = getBlackScreen(8000);
loopTime += timeTaken;
//Serial.println(timeTaken);
delay(200);
//Serial.print("Run black screen: ");
timeTaken = getTransition(4000);
loopTime += timeTaken;
//Serial.println(timeTaken);
delay(200);
//Serial.print("Main menu fuzzy: ");
timeTaken = getTransition(2000, 1);
loopTime += timeTaken;
//Serial.println(timeTaken);
//Serial.print("> Total Loop Time: "); Serial.println(loopTime);
}
/*
* repeatedly interacts with whatever is in front of it, then runs from the encounter if no shiny is detected
* assumes you are standing in front of a stationary pookemon who will still be there if you run from the encounter
* your first slot pokemon has no critical ability
* the target pokemon has no critical ability
*/
void roam_default() {
a();
delay(1500);
a();
delay(500);
float startR, startG, startB;
measureLight(&startR, &startG, &startB);
delay(8500); //9000 for latios
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (!detectTransition(startR, startG, startB, endR, endG, endB)) {
onShinyFound();
}
left();
right();
a();
delay(6500); // 7000 for latios
a();
}
/* //IN DEVELOPMENT//
* repeatedly moves player back and forth until an encounter is detected, will run away from encounter if no shiny detected
* assumes that the player is in a large enough patch of grass or other pokemon generating area
* your first slot pokemon has no critical ability
* the target pokemon has no critical ability
*/
void grass_default() {
float startR, startG, startB;
measureLight(&startR, &startG, &startB);
while(true) {
left();
right();
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (detectTransition(startR, startG, startB, endR, endG, endB)) {
break;
}
}
delay(500);
startR, startG, startB;
measureLight(&startR, &startG, &startB);
delay(8500); //9000 for latios
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (!detectTransition(startR, startG, startB, endR, endG, endB)) {
onShinyFound();
}
left();
right();
a();
delay(6500); // 7000 for latios
a();
}
/*
* repeatedly interacts with whatever is in front of it, then soft resets if no shiny is detected
* assumes you are standing in front of a hyperspace hole or other pokemon which will not be there if you run from it
* your first slot pokemon has no critical ability
* the target pokemon has no critical ability
* approx 13.84 hrs per shiny
*/
void hyperspace_default() {
a();
delay(1000);
a();
delay(100);
a();
delay(100);
a();
delay(2000);
float startR, startG, startB;
measureLight(&startR, &startG, &startB);
delay(9750); //8500 for faster
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (!detectTransition(startR, startG, startB, endR, endG, endB)) {
onShinyFound();
}
softReset();
delay(12500);
a();
delay(2250);
a();
delay(4250);
a();
delay(5500);
}
/*
* repeatedly interacts with whatever is in front of it, then soft resets if no shiny is detected
* assumes you are standing in front of a hyperspace hole or other pokemon which will not be there if you run from it
* your first slot pokemon has no critical ability
* the target pokemon does have a critical ability
* approx 13.84 hrs per shiny
*/
void hyperspace_ability() {
a();
delay(2250);
a();
delay(4250);
a();
delay(5500);
a();
delay(800);
a();
delay(75);
a();
delay(75);
a();
delay(2000);
float startR, startG, startB;
measureLight(&startR, &startG, &startB);
delay(12500);
float endR, endG, endB;
measureLight(&endR, &endG, &endB);
if (!detectTransition(startR, startG, startB, endR, endG, endB)) {
onShinyFound();
}
softReset();
delay(12500);
}
/*optional helper function that switches the pokemon in slot 1 with the pokemon in slot 2 of your party
*assumes you have a shiny in slot 2 with the same ability time as your slot 1
*/
void switchToTester() {
waitForStart();
a();
delay(2250);
a();
delay(4250);
a();
delay(4750);
x();
delay(1500);
a();
delay(1500);
a();
up();
up();
a();
right();
a();
b();
delay(2500);
// up();
// a();
// delay(2000);
// a();
// delay(8000);
// softReset();
b();
delay(1500);
}