diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index a55f2b29f5..65c92eb831 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -1372,8 +1372,12 @@ file(GLOB MAIN_SOURCES Source/PokemonLA/Resources/PokemonLA_PokemonSprites.h Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.cpp Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.h + Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.cpp + Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.h Source/PokemonLGPE/Inference/PokemonLGPE_ShinySymbolDetector.cpp Source/PokemonLGPE/Inference/PokemonLGPE_ShinySymbolDetector.h + Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.cpp + Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.h Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_AlolanTrade.cpp Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_AlolanTrade.h Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp diff --git a/SerialPrograms/SerialPrograms.pro b/SerialPrograms/SerialPrograms.pro index 50d10b4b0f..ed83dfcea4 100644 --- a/SerialPrograms/SerialPrograms.pro +++ b/SerialPrograms/SerialPrograms.pro @@ -674,6 +674,7 @@ SOURCES += \ Source/PokemonLA/Resources/PokemonLA_PokemonSprites.cpp \ Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.cpp \ Source/PokemonLGPE/Inference/PokemonLGPE_ShinySymbolDetector.cpp \ + Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.cpp \ Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_AlolanTrade.cpp \ Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp \ Source/PokemonLGPE/PokemonLGPE_Panels.cpp \ @@ -1864,6 +1865,7 @@ HEADERS += \ Source/PokemonLA/Resources/PokemonLA_PokemonSprites.h \ Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.h \ Source/PokemonLGPE/Inference/PokemonLGPE_ShinySymbolDetector.h \ + Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.h \ Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_AlolanTrade.h \ Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.h \ Source/PokemonLGPE/PokemonLGPE_Panels.h \ diff --git a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp index 7a0c3b46c4..be2f5a5b3f 100644 --- a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp @@ -312,7 +312,44 @@ bool openedgame_to_gamemenu( +void resume_game_from_home( + VideoStream& stream, JoyconContext& context, + bool skip_home_press +){ + if (!skip_home_press){ + pbf_press_button(context, BUTTON_HOME, 20ms, 10ms); + } + context.wait_for_all_requests(); + while (true){ + { + UpdateMenuWatcher update_detector; + int ret = wait_until( + stream, context, + std::chrono::milliseconds(1000), + { update_detector } + ); + if (ret == 0){ + stream.log("Detected update window.", COLOR_RED); + + pbf_move_joystick(context, 128, 0, 10ms, 0ms); + pbf_press_button(context, BUTTON_A, 10ms, 500ms); + context.wait_for_all_requests(); + continue; + } + } + + // In case we failed to enter the game. + HomeWatcher home_detector; + if (home_detector.detect(stream.video().snapshot())){ + stream.log("Failed to re-enter game. Trying again...", COLOR_RED); + pbf_press_button(context, BUTTON_HOME, 20ms, 10ms); + continue; + }else{ + break; + } + } +} void move_to_user(JoyconContext& context, uint8_t user_slot){ if (user_slot != 0){ // Move to correct user. diff --git a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.h b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.h index 8ff307bacb..f29cb1113e 100644 --- a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.h +++ b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.h @@ -35,7 +35,10 @@ bool openedgame_to_gamemenu( ); - +void resume_game_from_home( + VideoStream& stream, JoyconContext& context, + bool skip_home_press = false +); void start_game_from_home_with_inference( VideoStream& stream, JoyconContext& context, uint8_t game_slot, diff --git a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.cpp b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.cpp index 5c7c9b4aff..b3ac1c853f 100644 --- a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.cpp @@ -165,6 +165,66 @@ void home_to_date_time(ProControllerContext& context, bool to_date_change, bool +void home_to_date_time(JoyconContext& context, bool to_date_change){ + Milliseconds tv = context->timing_variation(); + Milliseconds unit = 32ms + tv; + + //From ControllerPerformanceClass::SerialPABotBase_Wireless_ESP32 + //as Joycon will only have that controller type + + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + + // Down twice in case we drop one. + pbf_move_joystick(context, 128, 255, 2*unit, unit); + pbf_move_joystick(context, 128, 255, 2*unit, unit); + + pbf_move_joystick(context, 255, 128, 2*unit, unit); + + // Press A multiple times to make sure one goes through. + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); + + + // Just button mash it. lol + { + auto iterations = Milliseconds(1100) / unit + 1; + do{ + pbf_move_joystick(context, 128, 255, 2*unit, unit); + }while (--iterations); + } + { + auto iterations = Milliseconds(336) / unit + 1; + do{ + pbf_move_joystick(context, 255, 128, 2*unit, unit); + }while (--iterations); + } + + pbf_move_joystick(context, 128, 255, 2*unit, unit); + pbf_move_joystick(context, 128, 255, 2*unit, unit); + pbf_move_joystick(context, 128, 255, 4*unit, unit); + pbf_move_joystick(context, 128, 255, 360ms, 304ms); + pbf_move_joystick(context, 128, 255, 2*unit, unit); + //pbf_move_joystick(context, 128, 255, 2*unit, unit); + + if (!to_date_change){ + ssf_press_button(context, BUTTON_A, 360ms, 2*unit, unit); + return; + } + + ssf_press_button(context, BUTTON_A, unit); + { + auto iterations = Milliseconds(216) / unit + 1; + do{ + pbf_move_joystick(context, 128, 255, 2*unit, unit); + }while (--iterations); + } + pbf_move_joystick(context, 128, 255, 2*unit, 0ms); +} + + + } } diff --git a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.h b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.h index 0ace5dd4a2..fa3518c7ab 100644 --- a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.h +++ b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.h @@ -8,6 +8,7 @@ #define PokemonAutomation_NintendoSwitch_Navigation_H #include "NintendoSwitch/Controllers/NintendoSwitch_ProController.h" +#include "NintendoSwitch/Controllers/NintendoSwitch_Joycon.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -16,6 +17,9 @@ namespace NintendoSwitch{ void home_to_date_time(ProControllerContext& context, bool to_date_change, bool fast); +//Joycon must not be sideways +void home_to_date_time(JoyconContext& context, bool to_date_change); + } diff --git a/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.cpp b/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.cpp new file mode 100644 index 0000000000..7db54212b0 --- /dev/null +++ b/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.cpp @@ -0,0 +1,71 @@ +/* Auto Host Routines + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "ClientSource/Libraries/MessageConverter.h" +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h" +#include "NintendoSwitch/Programs/NintendoSwitch_GameEntry.h" +#include "NintendoSwitch/Programs/NintendoSwitch_Navigation.h" +#include "PokemonLGPE_DateSpam.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonLGPE{ + +void roll_date_forward_1(JoyconContext& context){ + Milliseconds tv = context->timing_variation(); + Milliseconds unit = 34ms + tv; + + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_move_joystick(context, 128, 0, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); + + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_move_joystick(context, 128, 0, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); +} + +void roll_date_backward_N(JoyconContext& context, uint8_t skips){ + if (skips == 0){ + return; + } + + Milliseconds tv = context->timing_variation(); + Milliseconds unit = 32ms + tv; + + pbf_press_button(context, BUTTON_A, 2*unit, unit); + + for (uint8_t c = 0; c < skips - 1; c++){ + pbf_move_joystick(context, 128, 255, 2*unit, unit); + } + + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + + for (uint8_t c = 0; c < skips - 1; c++){ + pbf_move_joystick(context, 128, 255, 2*unit, unit); + } + + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_move_joystick(context, 255, 128, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); + pbf_press_button(context, BUTTON_A, 2*unit, unit); +} + + + + + +} + +} +} + diff --git a/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.h b/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.h new file mode 100644 index 0000000000..f692cdf07f --- /dev/null +++ b/SerialPrograms/Source/PokemonLGPE/Commands/PokemonLGPE_DateSpam.h @@ -0,0 +1,24 @@ +/* Date Spamming Routines + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#ifndef PokemonAutomation_PokemonLGPE_Commands_DateSpam_H +#define PokemonAutomation_PokemonLGPE_Commands_DateSpam_H + +#include "CommonFramework/Tools/VideoStream.h" +#include "NintendoSwitch/Controllers/NintendoSwitch_Joycon.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonLGPE{ + +void roll_date_forward_1 (JoyconContext& context); +void roll_date_backward_N (JoyconContext& context, uint8_t skips); + +} + +} +} +#endif diff --git a/SerialPrograms/Source/PokemonLGPE/PokemonLGPE_Panels.cpp b/SerialPrograms/Source/PokemonLGPE/PokemonLGPE_Panels.cpp index 39b64fd114..4f031207b4 100644 --- a/SerialPrograms/Source/PokemonLGPE/PokemonLGPE_Panels.cpp +++ b/SerialPrograms/Source/PokemonLGPE/PokemonLGPE_Panels.cpp @@ -9,6 +9,7 @@ #include "PokemonLGPE_Panels.h" #include "PokemonLGPE_Settings.h" +#include "Programs/Farming/PokemonLGPE_DailyItemFarmer.h" #include "Programs/ShinyHunting/PokemonLGPE_AlolanTrade.h" namespace PokemonAutomation{ @@ -25,7 +26,8 @@ std::vector PanelListFactory::make_panels() const{ ret.emplace_back("---- Settings ----"); ret.emplace_back(make_settings()); - //ret.emplace_back("---- General ----"); + ret.emplace_back("---- General ----"); + ret.emplace_back(make_single_switch_program()); ret.emplace_back("---- Shiny Hunting ----"); ret.emplace_back(make_single_switch_program()); diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.cpp b/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.cpp new file mode 100644 index 0000000000..8bb7bb6255 --- /dev/null +++ b/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.cpp @@ -0,0 +1,217 @@ +/* LGPE Daily Item Farmer + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "CommonFramework/Exceptions/OperationFailedException.h" +#include "CommonFramework/Notifications/ProgramNotifications.h" +#include "CommonFramework/ProgramStats/StatsTracking.h" +#include "CommonFramework/VideoPipeline/VideoFeed.h" +#include "CommonTools/Async/InferenceRoutines.h" +#include "CommonTools/StartupChecks/VideoResolutionCheck.h" +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "NintendoSwitch/Controllers/NintendoSwitch_Joycon.h" +#include "NintendoSwitch/Programs/NintendoSwitch_GameEntry.h" +#include "NintendoSwitch/Programs/NintendoSwitch_Navigation.h" +#include "NintendoSwitch/NintendoSwitch_Settings.h" +#include "Pokemon/Pokemon_Strings.h" +#include "CommonTools/VisualDetectors/BlackScreenDetector.h" +#include "PokemonLGPE/Commands/PokemonLGPE_DateSpam.h" +#include "PokemonLGPE/Inference/PokemonLGPE_ShinySymbolDetector.h" +#include "PokemonLGPE/Programs/PokemonLGPE_GameEntry.h" +#include "PokemonSwSh/Commands/PokemonSwSh_Commands_DateSpam.h" +#include "PokemonLGPE_DailyItemFarmer.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonLGPE{ + +DailyItemFarmer_Descriptor::DailyItemFarmer_Descriptor() + : SingleSwitchProgramDescriptor( + "PokemonLGPE:DailyItemFarmer", + Pokemon::STRING_POKEMON + " LGPE", "Daily Item Farmer", + "", + "Farm daily item respawns (ex. fossils) by date-skipping.", + FeedbackType::NONE, + AllowCommandsWhenRunning::DISABLE_COMMANDS, + {ControllerFeature::NintendoSwitch_RightJoycon}, + FasterIfTickPrecise::NOT_FASTER + ) +{} + +struct DailyItemFarmer_Descriptor::Stats : public StatsTracker{ + Stats() + : skips(m_stats["Skips"]) + { + m_display_order.emplace_back("Skips"); + } + std::atomic& skips; +}; +std::unique_ptr DailyItemFarmer_Descriptor::make_stats() const{ + return std::unique_ptr(new Stats()); +} + +DailyItemFarmer::DailyItemFarmer() + : ATTEMPTS( + "Number of attempts:", + LockMode::LOCK_WHILE_RUNNING, + 30, 1 + ) + , LINK_CODE( + "Link Code:
The link code used when matching for a trade/battle. This only needs to be changed when running multiple LGPE date-skip programs at the same time.", + { //Combinations of 3 different symbols is possible but 10 choices seems like enough. + {LinkCode::Pikachu, "pikachu", "Pikachu"}, + {LinkCode::Eevee, "eevee", "Eevee"}, + {LinkCode::Bulbasaur, "bulbasaur", "Bulbasaur"}, + {LinkCode::Charmander, "charmander", "Charmander"}, + {LinkCode::Squirtle, "squirtle", "Squirtle"}, + {LinkCode::Pidgey, "pidgey", "Pidgey"}, + {LinkCode::Caterpie, "caterpie", "Caterpie"}, + {LinkCode::Rattata, "rattata", "Rattata"}, + {LinkCode::Jigglypuff, "jigglypuff", "Jigglypuff"}, + {LinkCode::Diglett, "diglett", "Diglett"}, + }, + LockMode::LOCK_WHILE_RUNNING, + LinkCode::Pikachu + ) + , FIX_TIME_WHEN_DONE( + "Fix Time when Done:
Fix the time after the program finishes.", + LockMode::UNLOCK_WHILE_RUNNING, false + ) + , GO_HOME_WHEN_DONE(false) + , NOTIFICATION_STATUS_UPDATE("Status Update", true, false, std::chrono::seconds(3600)) + , NOTIFICATIONS({ + &NOTIFICATION_STATUS_UPDATE, + &NOTIFICATION_PROGRAM_FINISH, + }) +{ + PA_ADD_OPTION(ATTEMPTS); + PA_ADD_OPTION(LINK_CODE); + PA_ADD_OPTION(FIX_TIME_WHEN_DONE); + PA_ADD_OPTION(GO_HOME_WHEN_DONE); + PA_ADD_OPTION(NOTIFICATIONS); +} + +void DailyItemFarmer::program(SingleSwitchProgramEnvironment& env, CancellableScope& scope){ + JoyconContext context(scope, env.console.controller()); + assert_16_9_720p_min(env.logger(), env.console); + DailyItemFarmer_Descriptor::Stats& stats = env.current_stats(); + + /* Stand in front of the fossil spawn near Mewtwo. + * Use a repel to keep wild encounters away. + * Start program in-game. + * 100% daily spawn. Only works near Mewtwo. + * Other cave item spawns are tied to steps taken. + * Should work for other hidden daily items, game corner, mt moon moonstones, etc. + */ + + uint8_t year = MAX_YEAR; + + for (uint32_t count = 0; count < ATTEMPTS; count++) { + //Pick up item + pbf_mash_button(context, BUTTON_A, 4000ms); + context.wait_for_all_requests(); + + //Open Menu -> Communication -> Nearby player -> Local Trade + pbf_press_button(context, BUTTON_X, 200ms, 500ms); + pbf_move_joystick(context, 255, 128, 100ms, 100ms); + pbf_press_button(context, BUTTON_A, 200ms, 1000ms); + pbf_press_button(context, BUTTON_A, 200ms, 1000ms); + pbf_wait(context, 1000ms); //Black screen + context.wait_for_all_requests(); + pbf_press_button(context, BUTTON_A, 200ms, 1000ms); + pbf_press_button(context, BUTTON_A, 200ms, 1000ms); + + //Enter link code + switch(LINK_CODE) { + case LinkCode::Pikachu: + break; + case LinkCode::Eevee: + pbf_move_joystick(context, 255, 128, 100ms, 100ms); + break; + case LinkCode::Bulbasaur: + pbf_move_joystick(context, 255, 128, 100ms, 100ms); + pbf_move_joystick(context, 255, 128, 100ms, 100ms); + break; + case LinkCode::Charmander: + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + break; + case LinkCode::Squirtle: + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + break; + case LinkCode::Pidgey: + pbf_move_joystick(context, 128, 255, 100ms, 100ms); + break; + case LinkCode::Caterpie: + pbf_move_joystick(context, 128, 255, 100ms, 100ms); + pbf_move_joystick(context, 255, 128, 100ms, 100ms); + break; + case LinkCode::Rattata: + pbf_move_joystick(context, 128, 255, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + break; + case LinkCode::Jigglypuff: + pbf_move_joystick(context, 128, 255, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + break; + case LinkCode::Diglett: + pbf_move_joystick(context, 128, 255, 100ms, 100ms); + pbf_move_joystick(context, 0, 128, 100ms, 100ms); + break; + default: + env.log("Invalid link code selection. Defaulting to Pikachu."); + break; + } + //Select symbol three times, then enter link search + pbf_press_button(context, BUTTON_A, 200ms, 100ms); + pbf_press_button(context, BUTTON_A, 200ms, 100ms); + pbf_press_button(context, BUTTON_A, 200ms, 100ms); + pbf_wait(context, 1000ms); //let search start + context.wait_for_all_requests(); + + //Dateskip + pbf_press_button(context, BUTTON_HOME, 160ms, 1000ms); + home_to_date_time(context, true); + if (year >= MAX_YEAR){ + roll_date_backward_N(context, MAX_YEAR); + year = 0; + }else{ + roll_date_forward_1(context); + year++; + } + pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0); + + //Re-enter game and close out link menu + pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0); + pbf_mash_button(context, BUTTON_B, 5000ms); + context.wait_for_all_requests(); + + stats.skips++; + env.update_stats(); + } + + if (FIX_TIME_WHEN_DONE){ + pbf_press_button(context, BUTTON_HOME, 80ms, 1000ms); + home_to_date_time(context, false); + pbf_press_button(context, BUTTON_A, 50ms, 500ms); + pbf_press_button(context, BUTTON_A, 50ms, 500ms); + pbf_wait(context, 100ms); + context.wait_for_all_requests(); + pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0); + resume_game_from_home(env.console, context); + } + + if (GO_HOME_WHEN_DONE) { + pbf_press_button(context, BUTTON_HOME, 200ms, 1000ms); + } + send_program_finished_notification(env, NOTIFICATION_PROGRAM_FINISH); +} + + +} +} +} diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.h b/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.h new file mode 100644 index 0000000000..69aafd4acb --- /dev/null +++ b/SerialPrograms/Source/PokemonLGPE/Programs/Farming/PokemonLGPE_DailyItemFarmer.h @@ -0,0 +1,65 @@ +/* LGPE Daily Item Farmer + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#ifndef PokemonAutomation_PokemonLGPE_DailyItemFarmer_H +#define PokemonAutomation_PokemonLGPE_DailyItemFarmer_H + +#include "NintendoSwitch/Controllers/NintendoSwitch_Joycon.h" +#include "NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h" +#include "NintendoSwitch/Options/NintendoSwitch_GoHomeWhenDoneOption.h" +#include "CommonFramework/Notifications/EventNotificationsTable.h" +#include "Common/Cpp/Options/SimpleIntegerOption.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonLGPE{ + +class DailyItemFarmer_Descriptor : public SingleSwitchProgramDescriptor{ +public: + DailyItemFarmer_Descriptor(); + struct Stats; + virtual std::unique_ptr make_stats() const override; +}; + +class DailyItemFarmer : public SingleSwitchProgramInstance{ +public: + DailyItemFarmer(); + virtual void program(SingleSwitchProgramEnvironment& env, CancellableScope& scope) override; + +private: + SimpleIntegerOption ATTEMPTS; + + enum class LinkCode{ + Pikachu, + Eevee, + Bulbasaur, + Charmander, + Squirtle, + Pidgey, + Caterpie, + Rattata, + Jigglypuff, + Diglett, + }; + EnumDropdownOption LINK_CODE; + + BooleanCheckBoxOption FIX_TIME_WHEN_DONE; + GoHomeWhenDoneOption GO_HOME_WHEN_DONE; + + EventNotificationOption NOTIFICATION_STATUS_UPDATE; + EventNotificationsOption NOTIFICATIONS; +}; + + + + +} +} +} +#endif + + +