Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added level, nature, ability and language to detection and json output in Pokemon HOME sorter #528

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

redshift-s
Copy link

No description provided.

@redshift-s redshift-s changed the title Added level to detection and json output Added level to detection and json output in Pokemon HOME sorter Jan 27, 2025
@redshift-s redshift-s changed the title Added level to detection and json output in Pokemon HOME sorter Added level, nature, ability and language to detection and json output in Pokemon HOME sorter Jan 27, 2025
@Mysticial Mysticial requested a review from pifopi January 27, 2025 17:19
@@ -242,6 +253,11 @@ std::ostream& operator<<(std::ostream& os, const std::optional<Pokemon>& pokemon
os << "ball_slug:" << pokemon->ball_slug << " ";
os << "gender:" << gender_to_string(pokemon->gender) << " ";
os << "ot_id:" << pokemon->ot_id << " ";
os << "level:" << pokemon->level << " ";
os << "language:" << pokemon->language << " ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to keep the same order as other locations>

uint32_t level = 0;
std::string origin = "";
std::string language = "";
std::string nature = "";
std::string ability = "";

@@ -384,6 +400,11 @@ void output_boxes_data_json(const std::vector<std::optional<Pokemon>>& boxes_dat
pokemon["ball_slug"] = current_pokemon->ball_slug;
pokemon["gender"] = gender_to_string(current_pokemon->gender);
pokemon["ot_id"] = current_pokemon->ot_id;
pokemon["level"] = current_pokemon->level;
pokemon["language"] = current_pokemon->language;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint32_t level = 0;
std::string origin = "";
std::string language = "";
std::string nature = "";
std::string ability = "";

// level_box
// ot_box
int level = OCR::read_number_waterfill(env.console, extract_box_reference(screen, level_box), 0xff000000, 0xff7f7f7f);
if (level < 0 || level > 100) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<= 0 ?
And have you tried with eggs ? (I forgot what the program does when there is eggsà

env.console.log("Level: " + std::to_string(level), COLOR_GREEN);

// language
std::string language = OCR::ocr_read(Language::English, extract_box_reference(screen, language_box));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raw OCR isn't perfect and it'd be better to have a dictionnary (a list of words it can find, in this case all languages). That way, OCR will be able to correct minor errors while reading. Also check that all languages slugs are written in latin character (otherwise, the language need to be adapted and can't be english all the time)

// nature_box
std::string nature = OCR::ocr_read(Language::English, extract_box_reference(screen, nature_box));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the nature, you should be giving the language used by pokemon home as natures from asiatic languages for example won't be readble using an english OCR (also, it'd be better to use a dictionnary)

// ability_box
std::string ability = OCR::ocr_read(Language::English, extract_box_reference(screen, ability_box));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the ability, you should be giving the language used by pokemon home as abilities from asiatic languages for example won't be readble using an english OCR (also, it'd be better to use a dictionnary)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants