Skip to content

Commit 2fd5bb0

Browse files
committed
Added Number of Battles to run and discord notifications.
1 parent a4ea399 commit 2fd5bb0

File tree

2 files changed

+7
-34
lines changed

2 files changed

+7
-34
lines changed

SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_RestaurantFarmer.cpp

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ RestaurantFarmer::RestaurantFarmer()
7171
100,
7272
0
7373
)
74-
, GO_HOME_WHEN_DONE(false)
75-
, NOTIFICATION_STATUS_UPDATE("Status Update", true, false, std::chrono::seconds(3600)),
76-
NOTIFICATIONS({
77-
&NOTIFICATION_STATUS_UPDATE,
78-
&NOTIFICATION_PROGRAM_FINISH,
79-
&NOTIFICATION_ERROR_FATAL,
80-
}),
81-
MOVE_AI(
74+
, MOVE_AI(
8275
"<b>Move Selection AI:</b><br>"
8376
"If enabled, it will be smarter with move selection.<br>"
8477
"However, this adds a split-second delay which may cause the opponent attacks to land first.",
@@ -91,35 +84,14 @@ RestaurantFarmer::RestaurantFarmer()
9184
"However, this adds a 320ms delay which may cause the opponent attacks to land first.",
9285
LockMode::UNLOCK_WHILE_RUNNING,
9386
false
94-
) {
95-
, MOVE_AI(
96-
"<b>Move Selection AI:</b><br>"
97-
"If enabled, it will be smarter with move selection.<br>"
98-
"However, this adds a split-second delay which may cause opponent attacks to land first.",
99-
LockMode::UNLOCK_WHILE_RUNNING,
100-
true
101-
)
102-
, USE_PLUS_MOVES(
103-
"<b>Use Plus Moves:</b><br>"
104-
"If enabled, it will attempt to use plus moves.<br>"
105-
"However, this adds a 320ms delay which may cause opponent attacks to land first.",
106-
LockMode::UNLOCK_WHILE_RUNNING,
107-
false
108-
)
109-
, NUM_ROUNDS(
110-
"<b>Number of Battles to run:</b><br>Zero will run until 'Stop after Current Battle' is pressed.</b>",
111-
LockMode::UNLOCK_WHILE_RUNNING,
112-
100,
113-
0
114-
),
115-
GO_HOME_WHEN_DONE(false),
87+
)
88+
, GO_HOME_WHEN_DONE(false),
11689
NOTIFICATION_STATUS_UPDATE("Status Update", true, false, std::chrono::seconds(3600)),
11790
NOTIFICATIONS({
11891
&NOTIFICATION_STATUS_UPDATE,
11992
&NOTIFICATION_PROGRAM_FINISH,
12093
&NOTIFICATION_ERROR_FATAL,
12194
}) {
122-
}) {
12395
PA_ADD_OPTION(STOP_AFTER_CURRENT);
12496
PA_ADD_OPTION(MOVE_AI);
12597
PA_ADD_OPTION(USE_PLUS_MOVES);
@@ -405,6 +377,7 @@ void RestaurantFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
405377

406378
// auto lobby = env.console.video().snapshot();
407379

380+
uint32_t current_round = 0;
408381
while (true){
409382
send_program_status_notification(env, NOTIFICATION_STATUS_UPDATE);
410383
if (NUM_ROUNDS != 0 && stats.battles >= NUM_ROUNDS) {
@@ -415,6 +388,7 @@ void RestaurantFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
415388
break;
416389
}
417390
run_battle(env, context);
391+
current_round++;
418392
}
419393

420394
send_program_finished_notification(env, NOTIFICATION_PROGRAM_FINISH);

SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_RestaurantFarmer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ class RestaurantFarmer : public SingleSwitchProgramInstance, public ButtonListen
6161
std::atomic<bool> m_stop_after_current;
6262
StopButton STOP_AFTER_CURRENT;
6363
SimpleIntegerOption<uint32_t> NUM_ROUNDS;
64+
BooleanCheckBoxOption MOVE_AI;
65+
BooleanCheckBoxOption USE_PLUS_MOVES;
6466
GoHomeWhenDoneOption GO_HOME_WHEN_DONE;
6567
EventNotificationOption NOTIFICATION_STATUS_UPDATE;
6668
EventNotificationsOption NOTIFICATIONS;
67-
68-
BooleanCheckBoxOption MOVE_AI;
69-
BooleanCheckBoxOption USE_PLUS_MOVES;
7069
};
7170

7271

0 commit comments

Comments
 (0)