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

CampFort - Check pokeballs before camping #5177

Merged
merged 4 commits into from
Sep 6, 2016

Conversation

davidakachaos
Copy link
Contributor

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.

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.
@mention-bot
Copy link

@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
Copy link
Contributor

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.

@julienlavergne
Copy link
Contributor

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.
I can image a scenario where you are always out of Pokeballs, and so the task would have no effect at all.

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.
Did you notice that you run out of Pokeballs while activating the CampFort ?

@davidakachaos
Copy link
Contributor Author

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.
What do you think? Is that a reasonable thing to argue here? Maybe with the distant tweak?

@julienlavergne
Copy link
Contributor

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
@davidakachaos
Copy link
Contributor Author

@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?

@julienlavergne
Copy link
Contributor

@davidakachaos Actually it should go down a little bit more, after the check now < move_until. That is because we don't want to warn about not staying at the fort if were going to do so in the first place (because the timer moving is still under way).

To limit the output, you could also activate the move_until timer otherwise we are going to get 1 ball at a nearby pokestop and then come back to camp with only 1 ball. Would be better to walk for 10 minutes.

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)
@davidakachaos
Copy link
Contributor Author

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.

@solderzzc
Copy link
Contributor

solderzzc commented Sep 6, 2016

👍

Approved with PullApprove

@solderzzc solderzzc merged commit d8c0997 into PokemonGoF:dev Sep 6, 2016
@julienlavergne
Copy link
Contributor

I will do a little adjustement latter on to support move_time = 0 but it can wait a bit

@davidakachaos davidakachaos deleted the camp_lure_enchangement branch September 6, 2016 17:13
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