Skip to content

Commit 253b9ec

Browse files
committed
Clear more programs for SBB.
1 parent aa9cfbb commit 253b9ec

File tree

7 files changed

+87
-78
lines changed

7 files changed

+87
-78
lines changed

SerialPrograms/Source/PokemonHome/Programs/PokemonHome_GenerateNameOCR.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ GenerateNameOCRData_Descriptor::GenerateNameOCRData_Descriptor()
3030
"Generate " + STRING_POKEMON + " Name OCR data by iterating the National " + STRING_POKEDEX + ".",
3131
FeedbackType::REQUIRED,
3232
AllowCommandsWhenRunning::DISABLE_COMMANDS,
33-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
33+
{ControllerFeature::NintendoSwitch_ProController},
34+
FasterIfTickPrecise::NOT_FASTER
3435
)
3536
{}
3637

SerialPrograms/Source/PokemonHome/Programs/PokemonHome_PageSwap.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ PageSwap_Descriptor::PageSwap_Descriptor()
2424
"Swap 30 boxes (1 page) in " + STRING_POKEMON + " Home.",
2525
FeedbackType::NONE,
2626
AllowCommandsWhenRunning::DISABLE_COMMANDS,
27-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
27+
{ControllerFeature::NintendoSwitch_ProController},
28+
FasterIfTickPrecise::NOT_FASTER
2829
)
2930
{}
3031

SerialPrograms/Source/PokemonSwSh/Programs/NonShinyHunting/PokemonSwSh_StatsReset-Calyrex.cpp

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "CommonFramework/VideoPipeline/VideoFeed.h"
1010
#include "CommonTools/Async/InferenceRoutines.h"
1111
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
12+
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
1213
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1314
#include "Pokemon/Pokemon_Strings.h"
1415
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -31,7 +32,8 @@ StatsResetCalyrex_Descriptor::StatsResetCalyrex_Descriptor()
3132
"Repeatedly catch calyrex (and its horse) until you get the stats you want.",
3233
FeedbackType::REQUIRED,
3334
AllowCommandsWhenRunning::DISABLE_COMMANDS,
34-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
35+
{ControllerFeature::NintendoSwitch_ProController},
36+
FasterIfTickPrecise::NOT_FASTER
3537
)
3638
{}
3739
struct StatsResetCalyrex_Descriptor::Stats : public StatsTracker{
@@ -162,18 +164,18 @@ void StatsResetCalyrex::program(SingleSwitchProgramEnvironment& env, ProControll
162164
env.console, context,
163165
[](ProControllerContext& context){
164166
while (true){
165-
pbf_press_button(context, BUTTON_A, 10, 1 * TICKS_PER_SECOND);
167+
pbf_press_button(context, BUTTON_A, 80ms, 1000ms);
166168
}
167169
},
168170
{{fight_detector}}
169171
);
170172
if (result == 0){
171173
env.log("New fight detected, let's begin to throw balls.", COLOR_PURPLE);
172-
pbf_mash_button(context, BUTTON_B, 1 * TICKS_PER_SECOND);
174+
pbf_mash_button(context, BUTTON_B, 1000ms);
173175
}
174176
}
175177

176-
pbf_mash_button(context, BUTTON_B, 1 * TICKS_PER_SECOND);
178+
pbf_mash_button(context, BUTTON_B, 1000ms);
177179
CatchResults result = basic_catcher(env.console, context, LANGUAGE, BALL_SELECT.slug(), 999);
178180
switch (result.result){
179181
case CatchResult::POKEMON_CAUGHT:
@@ -211,7 +213,7 @@ void StatsResetCalyrex::program(SingleSwitchProgramEnvironment& env, ProControll
211213
}
212214

213215
if (!calyrex_caught){
214-
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
216+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
215217
reset_game_from_home_with_inference(
216218
env.console, context,
217219
ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST
@@ -221,32 +223,32 @@ void StatsResetCalyrex::program(SingleSwitchProgramEnvironment& env, ProControll
221223

222224
env.log("Unfuse calyrex.", COLOR_PURPLE);
223225
for (int i = 0; i < 40; i++){
224-
pbf_press_button(context, BUTTON_A, 10, 1 * TICKS_PER_SECOND);
226+
pbf_press_button(context, BUTTON_A, 80ms, 1000ms);
225227
}
226-
pbf_press_button(context, BUTTON_X , 10, (uint16_t)(1.5 * TICKS_PER_SECOND));
227-
pbf_press_dpad (context, DPAD_RIGHT, 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
228-
pbf_press_dpad (context, DPAD_RIGHT, 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
229-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
230-
pbf_press_dpad (context, DPAD_LEFT , 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
231-
pbf_press_dpad (context, DPAD_UP , 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
232-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
233-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
234-
pbf_press_dpad (context, DPAD_UP , 10, 2 * TICKS_PER_SECOND);
235-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
236-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
228+
pbf_press_button(context, BUTTON_X , 80ms, 1500ms);
229+
pbf_press_dpad (context, DPAD_RIGHT, 80ms, 500ms);
230+
pbf_press_dpad (context, DPAD_RIGHT, 80ms, 500ms);
231+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
232+
pbf_press_dpad (context, DPAD_LEFT , 80ms, 500ms);
233+
pbf_press_dpad (context, DPAD_UP , 80ms, 500ms);
234+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
235+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
236+
pbf_press_dpad (context, DPAD_UP , 80ms, 2000ms);
237+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
238+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
237239
context.wait_for_all_requests();
238240

239241
env.log("Check the stats.", COLOR_PURPLE);
240242
for (int i = 0; i < 10; i++){
241-
pbf_press_button(context, BUTTON_B, 10, 1 * TICKS_PER_SECOND);
243+
pbf_press_button(context, BUTTON_B, 80ms, 1000ms);
242244
}
243-
pbf_press_button(context, BUTTON_X , 10, 2 * TICKS_PER_SECOND);
244-
pbf_press_dpad (context, DPAD_LEFT, 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
245-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
246-
pbf_press_button(context, BUTTON_R , 10, 3 * TICKS_PER_SECOND);
247-
pbf_press_dpad (context, DPAD_LEFT, 10, 1 * TICKS_PER_SECOND);
248-
pbf_press_dpad (context, DPAD_UP , 10, 1 * TICKS_PER_SECOND);
249-
pbf_press_dpad (context, DPAD_UP , 10, 1 * TICKS_PER_SECOND);
245+
pbf_press_button(context, BUTTON_X , 80ms, 2000ms);
246+
pbf_press_dpad (context, DPAD_LEFT, 80ms, 500ms);
247+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
248+
pbf_press_button(context, BUTTON_R , 80ms, 3000ms);
249+
pbf_press_dpad (context, DPAD_LEFT, 80ms, 1000ms);
250+
pbf_press_dpad (context, DPAD_UP , 80ms, 1000ms);
251+
pbf_press_dpad (context, DPAD_UP , 80ms, 1000ms);
250252

251253
if (CHECK_HORSE_STATS){
252254
context.wait_for_all_requests();
@@ -264,7 +266,7 @@ void StatsResetCalyrex::program(SingleSwitchProgramEnvironment& env, ProControll
264266
}
265267
}
266268
if (CHECK_CALYREX_STATS){
267-
pbf_press_dpad(context, DPAD_UP, 10, 1 * TICKS_PER_SECOND);
269+
pbf_press_dpad(context, DPAD_UP, 80ms, 1000ms);
268270
context.wait_for_all_requests();
269271

270272
IvJudgeReaderScope reader(env.console, LANGUAGE);
@@ -281,7 +283,7 @@ void StatsResetCalyrex::program(SingleSwitchProgramEnvironment& env, ProControll
281283
}
282284
}
283285
if (!match_found){
284-
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
286+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
285287
reset_game_from_home_with_inference(
286288
env.console, context,
287289
ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST

SerialPrograms/Source/PokemonSwSh/Programs/NonShinyHunting/PokemonSwSh_StatsReset-Moltres.cpp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "CommonFramework/VideoPipeline/VideoFeed.h"
1111
#include "CommonTools/Async/InferenceRoutines.h"
1212
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
13+
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
1314
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1415
#include "Pokemon/Pokemon_Strings.h"
1516
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -34,7 +35,8 @@ StatsResetMoltres_Descriptor::StatsResetMoltres_Descriptor()
3435
"Repeatedly catch moltres until you get the stats you want.",
3536
FeedbackType::REQUIRED,
3637
AllowCommandsWhenRunning::DISABLE_COMMANDS,
37-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
38+
{ControllerFeature::NintendoSwitch_ProController},
39+
FasterIfTickPrecise::NOT_FASTER
3840
)
3941
{}
4042
struct StatsResetMoltres_Descriptor::Stats : public StatsTracker{
@@ -113,14 +115,14 @@ void StatsResetMoltres::program(SingleSwitchProgramEnvironment& env, ProControll
113115
env.console, context,
114116
[](ProControllerContext& context){
115117
while (true){
116-
pbf_wait(context, 1 * TICKS_PER_SECOND);
118+
pbf_wait(context, 1000ms);
117119
}
118120
},
119121
{{fight_detector}}
120122
);
121123
if (result == 0){
122124
env.log("New fight detected.", COLOR_PURPLE);
123-
pbf_mash_button(context, BUTTON_B, 1 * TICKS_PER_SECOND);
125+
pbf_mash_button(context, BUTTON_B, 1000ms);
124126
}
125127
}
126128

@@ -137,7 +139,7 @@ void StatsResetMoltres::program(SingleSwitchProgramEnvironment& env, ProControll
137139
context.wait_for_all_requests();
138140
env.log("Exit the fight.", COLOR_PURPLE);
139141
for (int i = 0; i < 20; i++){
140-
pbf_press_button(context, BUTTON_B, 10, 1 * TICKS_PER_SECOND);
142+
pbf_press_button(context, BUTTON_B, 80ms, 1000ms);
141143
}
142144

143145
context.wait_for_all_requests();
@@ -166,7 +168,7 @@ void StatsResetMoltres::program(SingleSwitchProgramEnvironment& env, ProControll
166168
}else{
167169
stats.resets++;
168170
env.update_stats();
169-
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
171+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
170172
reset_game_from_home_with_inference(
171173
env.console, context,
172174
ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST
@@ -180,38 +182,38 @@ void StatsResetMoltres::program(SingleSwitchProgramEnvironment& env, ProControll
180182
env.console, context,
181183
[](ProControllerContext& context){
182184
while (true){
183-
pbf_wait(context, 1 * TICKS_PER_SECOND);
185+
pbf_wait(context, 1000ms);
184186
}
185187
},
186188
{{fight_detector}}
187189
);
188190
if (ret == 0){
189191
env.log("New fight detected.", COLOR_PURPLE);
190-
pbf_mash_button(context, BUTTON_B, 1 * TICKS_PER_SECOND);
191-
pbf_press_dpad(context, DPAD_UP , 10, 1 * TICKS_PER_SECOND);
192-
pbf_press_button(context, BUTTON_A, 10, 1 * TICKS_PER_SECOND);
192+
pbf_mash_button(context, BUTTON_B, 1000ms);
193+
pbf_press_dpad(context, DPAD_UP , 80ms, 1000ms);
194+
pbf_press_button(context, BUTTON_A, 80ms, 1000ms);
193195
}
194196
}
195197
for (int i = 0; i < 10; i++){
196-
pbf_press_button(context, BUTTON_B, 10, 1 * TICKS_PER_SECOND);
198+
pbf_press_button(context, BUTTON_B, 80ms, 1000ms);
197199
}
198200

199201
context.wait_for_all_requests();
200202
env.log("Let's camp.", COLOR_PURPLE);
201203
pbf_press_button(context, BUTTON_X , 80ms, GameSettings::instance().OVERWORLD_TO_MENU_DELAY0);
202-
pbf_press_dpad (context, DPAD_RIGHT, 10, 1 * TICKS_PER_SECOND);
203-
pbf_press_dpad (context, DPAD_DOWN , 10, 1 * TICKS_PER_SECOND);
204-
pbf_press_button(context, BUTTON_A , 10, 8 * TICKS_PER_SECOND);
205-
pbf_press_button(context, BUTTON_X , 10, 1 * TICKS_PER_SECOND);
206-
pbf_press_dpad (context, DPAD_LEFT , 10, 1 * TICKS_PER_SECOND);
207-
pbf_press_button(context, BUTTON_A , 10, 7 * TICKS_PER_SECOND);
204+
pbf_press_dpad (context, DPAD_RIGHT, 80ms, 1000ms);
205+
pbf_press_dpad (context, DPAD_DOWN , 80ms, 1000ms);
206+
pbf_press_button(context, BUTTON_A , 80ms, 8000ms);
207+
pbf_press_button(context, BUTTON_X , 80ms, 1000ms);
208+
pbf_press_dpad (context, DPAD_LEFT , 80ms, 1000ms);
209+
pbf_press_button(context, BUTTON_A , 80ms, 7000ms);
208210

209211
context.wait_for_all_requests();
210212
env.log("Let's save.", COLOR_PURPLE);
211213
pbf_press_button(context, BUTTON_X , 80ms, GameSettings::instance().OVERWORLD_TO_MENU_DELAY0);
212-
pbf_press_button(context, BUTTON_R , 10, 1 * TICKS_PER_SECOND);
213-
pbf_press_button(context, BUTTON_A , 10, 1 * TICKS_PER_SECOND);
214-
pbf_press_button(context, BUTTON_A , 10, 1 * TICKS_PER_SECOND);
214+
pbf_press_button(context, BUTTON_R , 80ms, 1000ms);
215+
pbf_press_button(context, BUTTON_A , 80ms, 1000ms);
216+
pbf_press_button(context, BUTTON_A , 80ms, 1000ms);
215217
}
216218
}
217219

SerialPrograms/Source/PokemonSwSh/Programs/NonShinyHunting/PokemonSwSh_StatsReset-Regi.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "CommonFramework/VideoPipeline/VideoFeed.h"
1010
#include "CommonTools/Async/InferenceRoutines.h"
1111
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
12+
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
1213
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1314
#include "Pokemon/Pokemon_Strings.h"
1415
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -31,7 +32,8 @@ StatsResetRegi_Descriptor::StatsResetRegi_Descriptor()
3132
"Repeatedly catch regi until you get the stats you want.",
3233
FeedbackType::REQUIRED,
3334
AllowCommandsWhenRunning::DISABLE_COMMANDS,
34-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
35+
{ControllerFeature::NintendoSwitch_ProController},
36+
FasterIfTickPrecise::NOT_FASTER
3537
)
3638
{}
3739
struct StatsResetRegi_Descriptor::Stats : public StatsTracker{
@@ -135,14 +137,14 @@ void StatsResetRegi::program(SingleSwitchProgramEnvironment& env, ProControllerC
135137
env.console, context,
136138
[](ProControllerContext& context){
137139
while (true){
138-
pbf_press_button(context, BUTTON_A, 10, 1 * TICKS_PER_SECOND);
140+
pbf_press_button(context, BUTTON_A, 80ms, 1000ms);
139141
}
140142
},
141143
{{fight_detector}}
142144
);
143145
if (result == 0){
144146
env.log("New fight detected, let's begin to throw balls.", COLOR_PURPLE);
145-
pbf_mash_button(context, BUTTON_B, 1 * TICKS_PER_SECOND);
147+
pbf_mash_button(context, BUTTON_B, 1000ms);
146148
}
147149
}
148150

@@ -184,7 +186,7 @@ void StatsResetRegi::program(SingleSwitchProgramEnvironment& env, ProControllerC
184186
}
185187

186188
if (!regi_caught){
187-
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
189+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
188190
reset_game_from_home_with_inference(
189191
env.console, context,
190192
ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST
@@ -194,15 +196,15 @@ void StatsResetRegi::program(SingleSwitchProgramEnvironment& env, ProControllerC
194196

195197
env.log("Check the stats.", COLOR_PURPLE);
196198
for (int i = 0; i < 20; i++){
197-
pbf_press_button(context, BUTTON_B, 10, 1 * TICKS_PER_SECOND);
199+
pbf_press_button(context, BUTTON_B, 80ms, 1000ms);
198200
}
199-
pbf_press_button(context, BUTTON_X , 10, 2 * TICKS_PER_SECOND);
200-
pbf_press_dpad (context, DPAD_RIGHT, 10, (uint16_t)(0.5 * TICKS_PER_SECOND));
201-
pbf_press_button(context, BUTTON_A , 10, 2 * TICKS_PER_SECOND);
202-
pbf_press_button(context, BUTTON_R , 10, 3 * TICKS_PER_SECOND);
203-
pbf_press_dpad (context, DPAD_LEFT , 10, 1 * TICKS_PER_SECOND);
204-
pbf_press_dpad (context, DPAD_UP , 10, 1 * TICKS_PER_SECOND);
205-
pbf_press_dpad (context, DPAD_UP , 10, 1 * TICKS_PER_SECOND);
201+
pbf_press_button(context, BUTTON_X , 80ms, 2000ms);
202+
pbf_press_dpad (context, DPAD_RIGHT, 80ms, 500ms);
203+
pbf_press_button(context, BUTTON_A , 80ms, 2000ms);
204+
pbf_press_button(context, BUTTON_R , 80ms, 3000ms);
205+
pbf_press_dpad (context, DPAD_LEFT , 80ms, 1000ms);
206+
pbf_press_dpad (context, DPAD_UP , 80ms, 1000ms);
207+
pbf_press_dpad (context, DPAD_UP , 80ms, 1000ms);
206208

207209
context.wait_for_all_requests();
208210
IvJudgeReaderScope reader(env.console, LANGUAGE);
@@ -218,7 +220,7 @@ void StatsResetRegi::program(SingleSwitchProgramEnvironment& env, ProControllerC
218220
match_found = ok;
219221

220222
if (!match_found){
221-
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
223+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
222224
reset_game_from_home_with_inference(
223225
env.console, context,
224226
ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST

0 commit comments

Comments
 (0)