Skip to content

Commit 11725bc

Browse files
author
Gin
committed
Add num visits option
1 parent 7b51ed0 commit 11725bc

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

SerialPrograms/Scripts/check_detector_regions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@
3333
raw_image = image.copy()
3434

3535

36+
37+
# ==================================================================
38+
# LZA alert eye detector
39+
add_infer_box_to_image(raw_image, 0.485, 0.088, 0.029, 0.034, image)
40+
41+
3642
# ==================================================================
3743
# LZA bench sit button A when running back
38-
add_infer_box_to_image(raw_image, 0.486, 0.477, 0.115, 0.5, image)
44+
# add_infer_box_to_image(raw_image, 0.486, 0.477, 0.115, 0.5, image)
3945

4046

4147
# ==================================================================

SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_WildZoneCafe.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ ShinyHunt_WildZoneCafe::ShinyHunt_WildZoneCafe()
8181
LockMode::LOCK_WHILE_RUNNING,
8282
WildZoneCafe::CAFE_BATAILLE
8383
)
84+
, NUM_VISITS("<b>Number of Visits:</b><br>Stop after this many visits. 0 means no limit.", LockMode::UNLOCK_WHILE_RUNNING, 0)
8485
, SHINY_DETECTED("Shiny Detected", "", "2000 ms", ShinySoundDetectedAction::NOTIFY_ON_FIRST_ONLY)
8586
, NOTIFICATION_STATUS("Status Update", true, false, std::chrono::seconds(3600))
8687
, NOTIFICATIONS({
@@ -93,6 +94,7 @@ ShinyHunt_WildZoneCafe::ShinyHunt_WildZoneCafe()
9394
{
9495
PA_ADD_STATIC(SHINY_REQUIRES_AUDIO);
9596
PA_ADD_OPTION(CAFE);
97+
PA_ADD_OPTION(NUM_VISITS);
9698
PA_ADD_OPTION(SHINY_DETECTED);
9799
PA_ADD_OPTION(NOTIFICATIONS);
98100
}
@@ -309,6 +311,9 @@ void ShinyHunt_WildZoneCafe::program(SingleSwitchProgramEnvironment& env, ProCon
309311
to_max_zoom_level_on_map = false;
310312
stats.visits++;
311313
env.update_stats();
314+
if (NUM_VISITS > 0 && stats.visits >= NUM_VISITS){
315+
break;
316+
}
312317
// No failure. Reset consecutive failure counter.
313318
consecutive_failures = 0;
314319
}catch (OperationFailedException&){

SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_WildZoneCafe.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define PokemonAutomation_PokemonLZA_WildZoneCafe_H
99

1010
#include "Common/Cpp/Options/EnumDropdownOption.h"
11+
#include "Common/Cpp/Options/SimpleIntegerOption.h"
1112
#include "CommonFramework/Notifications/EventNotificationsTable.h"
1213
#include "NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h"
1314
#include "PokemonLA/Options/PokemonLA_ShinyDetectedAction.h"
@@ -35,6 +36,8 @@ class ShinyHunt_WildZoneCafe : public SingleSwitchProgramInstance{
3536
EnumDropdownOption<WildZoneCafe> CAFE;
3637
PokemonLA::ShinyRequiresAudioText SHINY_REQUIRES_AUDIO;
3738

39+
SimpleIntegerOption<uint64_t> NUM_VISITS;
40+
3841
ShinySoundDetectedActionOption SHINY_DETECTED;
3942

4043
EventNotificationOption NOTIFICATION_STATUS;

0 commit comments

Comments
 (0)