Skip to content

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
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 = "";

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)

env.console.log("Detected Language: " + language, COLOR_GREEN);
}
// 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)

@Mysticial
Copy link
Collaborator

This has been sitting for a while. Please rebase and address the review comments if you want to continue this PR.

@Koi-3088 Koi-3088 closed this Sep 6, 2025
@Koi-3088
Copy link
Member

Koi-3088 commented Sep 6, 2025

Closed due to no activity and communication.

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.

4 participants