|
17 | 17 | #include "Pokemon/Pokemon_Strings.h" |
18 | 18 | #include "PokemonSwSh/PokemonSwSh_Settings.h" |
19 | 19 | #include "PokemonSwSh/Commands/PokemonSwSh_Commands_DateSpam.h" |
| 20 | +#include "PokemonSwSh/Inference/PokemonSwSh_DialogTriangleDetector.h" |
20 | 21 | #include "PokemonSwSh/Inference/PokemonSwSh_SelectionArrowFinder.h" |
21 | 22 | #include "PokemonSwSh/Programs/PokemonSwSh_MenuNavigation.h" |
22 | 23 | #include "PokemonSwSh/Programs/RNG/PokemonSwSh_BasicRNG.h" |
@@ -138,7 +139,18 @@ DailyHighlightRNG::DailyHighlightRNG() |
138 | 139 | void DailyHighlightRNG::move_to_trader(SingleSwitchProgramEnvironment& env, BotBaseContext& context) { |
139 | 140 | pbf_move_left_joystick(context, 207, 1, 160, 10); // Magic numbers to barely reach the trader |
140 | 141 | pbf_press_button(context, BUTTON_A, 20, 20); |
141 | | - // TODO: check if NPC was reached -> DialogArrow |
| 142 | + |
| 143 | + //Check if NPC was reached |
| 144 | + DialogTriangleDetector dialog_detector(env.console, ImageFloatBox(0.465, 0.195, 0.054, 0.57)); |
| 145 | + dialog_detector.make_overlays(boxes); |
| 146 | + |
| 147 | + int ret = wait_until(env.console, context, Milliseconds(3000), { dialog_detector }); |
| 148 | + if (ret < 0) { |
| 149 | + OperationFailedException::fire( |
| 150 | + env.console, ErrorReport::SEND_ERROR_REPORT, |
| 151 | + "Failed to talk to the trader." |
| 152 | + ); |
| 153 | + } |
142 | 154 | } |
143 | 155 |
|
144 | 156 | void DailyHighlightRNG::navigate_to_party(SingleSwitchProgramEnvironment& env, BotBaseContext& context){ |
|
0 commit comments