-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CampFort - Check pokeballs before camping #5177
CampFort - Check pokeballs before camping #5177
Conversation
I noticed that the bot doesn't move when camping at a lure, but had run out of pokeballs. This will first check IF we have any pokeballs left. If we have no pokeballs left, abandon the lure (to move to a fort to get more pokeballs) when we got some pokeballs again, will move back to the lure.
@davidakachaos, thanks for your PR! By analyzing the annotation information on this pull request, we identified @anakin5 to be a potential reviewer |
if sum([inventory.items().get(ball.value).count for ball in | ||
[Item.ITEM_POKE_BALL, Item.ITEM_GREAT_BALL, Item.ITEM_ULTRA_BALL]]) <= 0: | ||
self.logger.info('Not any pokeballs left, refuse to sit at lure!') | ||
return WorkerResult.ERROR |
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.
That part should go after the check on "move_until". There is no point displaying that we would not sit there if the task is deactivated or if we are in the moving phase.
Also, does not seem like an error to me, more a WorkerResult.SUCCESS.
On top of my comment, I am wondering something. The CampFort is not staying at a specific fort but in the middle of a cluster, which makes it a good location to spin forts, lazily speaking. The original goal was to really stop walking, take at rest at a convenient place. That we agree would be less efficient than walking around whole day, but also much more human. |
I see what you mean. But my line of thought was; if I was outside, playing Pokemon Go, I'm sitting at a few lures, and I run out of Pokeballs... I would look around for other stops nearby (that might be the tweak here!) to spin and collect balls. As I would wander to other stops to get some balls, I would still come back to the lure "hotspot" when I got a few more balls. |
OK. Let's just move down a bit the code then, to avoid message spam. |
As suggested, moved the check a bit down Solved the message spam with a switch to announce or not
@anakin5 Okay, so I've move the check below the enabled check. I also added a boolean to check if we've announced that the bot is out of balls. What do you think? |
@davidakachaos Actually it should go down a little bit more, after the check To limit the output, you could also activate the |
Now the worker will set a time to walk away from the lures. After the time has passed, the worker will check again if we have some Pokeballs. If we have enough, we will search for a lure again (the old one could be finished)
Thank you @anakin5 for all the great advise 😄 Now the worker will move away from the lure for a set time after which it will check again for enough balls. |
I will do a little adjustement latter on to support move_time = 0 but it can wait a bit |
Short Description:
I noticed that the bot doesn't move when camping at a lure, but had run
out of pokeballs. This will first check IF we have any pokeballs left.
If we have no pokeballs left, abandon the lure (to move to a fort to get
more pokeballs) when we got some pokeballs again, will move back to the
lure.