forked from ironandstee1/swemu-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ino
152 lines (141 loc) · 3.27 KB
/
main.ino
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
#include "LUFAConfig.h"
#include <LUFA.h>
#include "Joystick.h"
#include "General.h"
#include "PokemonEggHatching.h"
#include "PokemonExtra.h"
#include "SimpleScripting.h"
String incoming = "";
PokemonEggHatching pokemonEggHatching; // Creates an instance of pokemon egg hatching class
PokemonExtra pokemonExtra; // Creates an instance of pokemon extra class
void setup() {
SetupHardware(); // Needed for LUFA
GlobalInterruptEnable(); // Needed for LUFA
Serial1.begin(9600);
pinMode(2, OUTPUT);
}
void loop() {
//pokemonEggHatching.eggHatch(2560);
//pokemonEggHatching.eggHatch(3840);
//pokemonEggHatching.eggHatch(5120);
//pokemonEggHatching.eggHatch(6400);
//pokemonEggHatching.eggHatch(7680);
//pokemonEggHatching.eggHatch(8960);
//pokemonEggHatching.eggHatch(10240);
//pokemonEggHatching.boxHatch(1);
uartScriptSelect();
//pokemonExtra.boxRelease(5);
//pokemonExtra.diggerBrothers();
//pokemonExtra.wattFarming();
//pokemonExtra.fossilPokemon("arctovish", 20);
//pokemonExtra.stowOnSideBargain();
//pokemonExtra.lottoFarm();
//pokemonExtra.evTrain("hp", "spatk");
//pokemonExtra.pokeJobs();
//pokemonExtra.championsCup();
//simpleScript();
}
// For writing simple scripts, use this function and call to it in the main.
void simpleScript() {
using namespace simple;
Left(1000);
Nothing(1000);
Right(1000);
Nothing(1000);
Up(1000);
Nothing(1000);
X(1000);
Nothing(1000);
Y(1000);
Nothing(1000);
A(1000);
Nothing(1000);
B(1000);
Nothing(1000);
}
// Allows the use of a console program to select a script instead of reflashing
void uartScriptSelect() {
while(Serial1.available()) {
incoming = Serial1.readString();
if (incoming == "a") {
while(1) {
pokemonEggHatching.eggHatch(2560);
}
}
else if (incoming == "b"){
while(1) {
pokemonEggHatching.eggHatch(3840);
}
}
else if (incoming == "c"){
while(1) {
pokemonEggHatching.eggHatch(5120);
}
}
else if (incoming == "d"){
while(1) {
pokemonEggHatching.eggHatch(6400);
}
}
else if (incoming == "e"){
while(1) {
pokemonEggHatching.eggHatch(7680);
}
}
else if (incoming == "f"){
while(1) {
pokemonEggHatching.eggHatch(8960);
}
}
else if (incoming == "g"){
while(1) {
pokemonEggHatching.eggHatch(10240);
}
}
else if (incoming == "i") {
while(1) {
pokemonEggHatching.boxHatch(1);
}
}
else if (incoming == "j"){
while(1) {
pokemonExtra.boxRelease(5);
}
}
else if (incoming == "k"){
while(1) {
pokemonExtra.diggerBrothers();
}
}
else if (incoming == "l"){
while(1) {
pokemonExtra.wattFarming();
}
}
else if (incoming == "n"){
while(1) {
pokemonExtra.berryFarm();
}
}
else if (incoming == "o"){
while(1) {
pokemonExtra.stowOnSideBargain();
}
}
else if (incoming == "p"){
while(1) {
pokemonExtra.lottoFarm();
}
}
else if (incoming == "r"){
while(1) {
pokemonExtra.pokeJobs();
}
}
else if (incoming == "s"){
while(1) {
pokemonExtra.championsCup();
}
}
}
}