-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Egg incubation checks during PokeStop farming, and logging for hatch-events #907
Egg incubation checks during PokeStop farming, and logging for hatch-events #907
Conversation
Since this PR hasn't been merged yet, I added additional functionality to it. We now have hatch events for eggs. However, they are not based not actual hatch events from the server, because those turn up empty (for whatever reason). Instead, the client now remembers what the incubators stored previously and checks if there's a non-egg pokemon with that ID now (=hatched). The incubator state is stored in: /bin/Temp/Incubators.json and doesn't require any kind of manual setup. Not a very good solution, but it works. |
@@ -12,6 +17,8 @@ namespace PoGo.NecroBot.Logic.Tasks | |||
{ | |||
internal class UseIncubatorsTask | |||
{ | |||
private static readonly string IncubatorUsagePath = Path.Combine(Directory.GetCurrentDirectory(), "Temp", "Incubators.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this will break with multiple profiles.
Good find @ Ilses
You can also use the already existing Logs directory instead of Temp. Otherwise you would have to check for its existence and create it |
I think I'd rather see: private static readonly string IncubatorUsageFile = settings.ConfigPath + Path.DirectorySeparatorChar + "incubators.json" ...since the variable is a file, and not a path. |
Since it's neither a config nor a log, I think "Temp" fits better. It's not something you should include in your config backups. |
Fair enough. I'd still like the var renamed, but now I'm just picking nits ;) |
Made a commit for ProfilePath now. Also changed variable name to "...FilePath". A good compromise :) |
using this with no issues, merged myself with the latests commit, good work! |
can confirm.. it's pretty awesome to really hatch them while the bot runs and knowing the pokemon you got in your egg.. |
Ready to merge, thanks for the profile path integration. Good work |
Edit: See new comment below
Still doesn't log hatch-events though, since
ctx.Client.Inventory.GetHatchedEgg();
doesn't seem to return anything. Perhaps because the inventory (which includes pokemon) has already been refreshed?