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

[Custom Code Extension]: Encounter Automation (Pivot Hunter) #471

Open
jciii91 opened this issue Jun 4, 2024 · 4 comments
Open

[Custom Code Extension]: Encounter Automation (Pivot Hunter) #471

jciii91 opened this issue Jun 4, 2024 · 4 comments
Labels
Custom Code Extension Custom Code Extension ideas/submissions

Comments

@jciii91
Copy link

jciii91 commented Jun 4, 2024

Are you submitting an extension, or an idea?

Extension

Tell us about your extension / idea

My extension is for automating wild encounter hunting. The player can set the name and/or level of the encounter they want, hit the start button, and the game will autopilot through encounters until one starts that matches the search criteria.

Link to extension

https://github.com/jciii91/ironmon-encounter-automation

Additional Information

"Crosshair" Button on InfoScreen
image

Extension Screen with Popup
image

@jciii91 jciii91 added the Custom Code Extension Custom Code Extension ideas/submissions label Jun 4, 2024
@UTDZac
Copy link
Collaborator

UTDZac commented Nov 10, 2024

Hi, thank you for the extension submission. Sorry it took this long for me to get around to a reply.

I'd like to add this to our Custom Code Extension library in the wiki, but would like a few adjustments made to the extension if that's okay. All very simple ones:

  • Remove all empty functions, such as self.inputCheckBizhawk(), self.configureOptions(), etc
  • Remove the comments at the top of the file that reference your extension as being a "template extension"
  • Add an additional condition inside the self.afterRedraw() function to check if the InfoScreen is displaying Route information

The first is critical, because the existence of these functions in your extension will signal the Tracker to execute them at their appropriate frequency. In other words, the Tracker will be spending a bunch of time executing these empty functions, sometimes every single frame.

The second is more of a bit of clean-up to the extension, since I see that you likely copied the template but left in the comments about it.

The third is a conflict with some legacy Tracker code. The InfoScreen is a multi-purpose screen that displays info about a Pokémon, move, ability, or route. Your condition simply checks if this screen is in use, not if it's displaying information about a Route. As such, viewing a move or ability on the Tracker will draw the crosshairs.

To solve, change:

if Program.currentScreen ~= InfoScreen or Battle.inBattle then

to:

if Program.currentScreen ~= InfoScreen or Battle.inBattle or InfoScreen.viewScreen ~= InfoScreen.Screens.ROUTE_INFO then

@jciii91
Copy link
Author

jciii91 commented Nov 10, 2024

No worries about the delay, I'm just happy you like the idea. I'd be happy to make these changes and will notify you once they're committed.

@jciii91
Copy link
Author

jciii91 commented Nov 17, 2024

Changes have been made and pushed to "main". There's upgrades I had planned on making to this extension if/when it got admitted. Would any changes need to get approved first to ensure they're compliant?

@UTDZac
Copy link
Collaborator

UTDZac commented Nov 17, 2024

Thanks, looks good.

Final thing to do is to create a Release for your project. In this way, you can tag it as v1.0 (matching the version you put in your extension's lua code). And people can see if/when a new update is available. You can do this similar to other extensions we have available in our library.

For example: https://github.com/UTDZac/DeathQuotes-IronmonExtension/releases/tag/v1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Custom Code Extension Custom Code Extension ideas/submissions
Projects
None yet
Development

No branches or pull requests

2 participants