Skip to content

Commit c0685e6

Browse files
committed
Fix
1 parent c7da6d7 commit c0685e6

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

SerialPrograms/Source/PokemonSV/Inference/Tera/PokemonSV_TeraRaidSearchDetector.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ class TeraRaidSearchDetector : public StaticScreenDetector{
3737
};
3838
class TeraRaidSearchWatcher : public DetectorToFinder<TeraRaidSearchDetector>{
3939
public:
40-
TeraRaidSearchWatcher(Color color = COLOR_RED)
41-
: DetectorToFinder("TeraRaidSearchWatcher", std::chrono::milliseconds(250), color)
40+
TeraRaidSearchWatcher(
41+
Color color = COLOR_RED,
42+
std::chrono::milliseconds duration = std::chrono::milliseconds(250)
43+
)
44+
: DetectorToFinder("TeraRaidSearchWatcher",duration, color)
4245
{}
4346
};
4447

SerialPrograms/Source/PokemonSV/Programs/TeraRaids/PokemonSV_TeraMultiFarmer.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,11 @@ void TeraMultiFarmer::join_lobby(
329329
// cout << "Joining Lobby" << endl;
330330

331331
bool seen_code_entry = false;
332-
bool seen_dialog = false;
332+
// bool seen_dialog = false;
333333
size_t attempts = 0;
334334
while (true){
335+
// cout << "Looping..." << endl;
336+
335337
if (attempts >= 3){
336338
OperationFailedException::fire(
337339
console, ErrorReport::SEND_ERROR_REPORT,
@@ -341,8 +343,8 @@ void TeraMultiFarmer::join_lobby(
341343

342344
CodeEntryWatcher code_entry(COLOR_GREEN);
343345
TeraLobbyWatcher lobby(console.logger(), env.realtime_dispatcher(), COLOR_RED);
344-
AdvanceDialogWatcher dialog(COLOR_YELLOW, std::chrono::seconds(2));
345-
TeraRaidSearchWatcher raid_search(COLOR_CYAN);
346+
AdvanceDialogWatcher dialog(COLOR_YELLOW);
347+
TeraRaidSearchWatcher raid_search(COLOR_CYAN, std::chrono::seconds(5));
346348
context.wait_for_all_requests();
347349
context.wait_for(std::chrono::seconds(3));
348350
int ret = wait_until(
@@ -376,19 +378,22 @@ void TeraMultiFarmer::join_lobby(
376378
break;
377379
case 2:
378380
console.log("Detected dialog...", COLOR_ORANGE);
379-
seen_dialog = true;
381+
// seen_dialog = true;
380382
pbf_press_button(context, BUTTON_B, 20, 230);
381383
continue;
382384
case 3:
385+
#if 0
383386
if (!seen_dialog){
384387
context.wait_for(std::chrono::seconds(1));
385388
continue;
386389
}
390+
#endif
387391
console.log("Wrong code! Backing out and trying again...", COLOR_RED);
388392
stats.m_errors++;
389393
attempts++;
390-
// pbf_press_button(context, BUTTON_B, 20, 230);
394+
pbf_press_button(context, BUTTON_B, 20, 230);
391395
enter_tera_search(env.program_info(), console, context, HOSTING_MODE == Mode::HOST_ONLINE);
396+
seen_code_entry = false;
392397
continue;
393398
default:
394399
OperationFailedException::fire(
@@ -446,6 +451,9 @@ bool TeraMultiFarmer::run_raid(
446451
);
447452
lobby_start_time = current_time();
448453
std::string code = lobby_reader.raid_code(env.logger(), env.realtime_dispatcher(), host_console.video().snapshot());
454+
455+
// code.back() = '0';
456+
449457
const char* error = normalize_code(lobby_code, code);
450458
if (error){
451459
OperationFailedException::fire(

0 commit comments

Comments
 (0)