PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.87k stars 1.54k forks source link

Sniper: pending validation source list and sleeping itself when out of balls #5569

Open YvesHenri opened 8 years ago

YvesHenri commented 8 years ago

As I have stated a couple times, I DO NOT want to put more settings in the config file for the Sniper task. The more settings, the higher is the amount of issues we'll have to maintain everyday.

Running out of balls is a known 'issue' if your catch list is big and catches pretty much everything. You're supposed to be catching very rare pokemons ONLY, otherwise expect this to happen frequently! However, we can make it sleep itself whenever it happens to find out we're out of balls. This will help a lot. Setting a "min_balls" param wouldn't do it. No, it will not.

As we already know, the source has to reply something by the time they're being validated, otherwise we can't know whether the mappings have been specified correctly, so they have to be removed from the source list. We can, however, add them to a 'pending list', which will be validated in the task's work method, if any.

Please don't close this issue untill its been implemented (so people can stop talking about this - I hope).

Gobberwart commented 8 years ago

Sort-of related.... I was considering implementing a global "disable_catch" flag that would disable ALL catch-type tasks (catchpokemon, movetomappokemon, sniper etc.) if true.

Eg. Disable catch functions for 900s (15min) if min_balls < 50:

      {
        "type": "DisableCatch",
        "config": {
          "enabled": true,
          "min_balls": 50,
          "duration:" 900
        }
      },

I'd really like a feature like this to let my bot carry on looting etc. without catching anything for a while.

disable_catch could even be set using Telegram, eg "/disablecatch 900"

What do you think?
Gobberwart commented 8 years ago

And yes, I realise each function has a min_balls type parameter, but that is different. This would just stop all catching for a while.

YvesHenri commented 8 years ago

It does look good, although I have no idea how you're going to make this interact with all the catchable tasks you mentioned above. Do you plan to apply fixes on them all or put it centralize it somewhere?

Gobberwart commented 8 years ago

Yep, each task would need changes to make this work. Not sure if I plan to do it or not. Will see :)

kureijir commented 8 years ago

This is good, but I'd still love to have Sniper's min_balls differs from the other tasks, either hardcoded or configurable, given that we usually snipe rare pokemon only, and they're harder to catch, so it's more prefered to have more balls when sniping. For example, I want to have at least 20 pokeballs with me if I were to teleport to a Snorlax or Dragonite, but trying to catch an Eevee appeared next to me with 5 balls left is fine.

YvesHenri commented 8 years ago

This feature request will solve this problem @kureijir. Having a min balls set means trouble, since you'll be always running with this amount (no matter how many balls you got, you'll go down to that min quantity VERY quickly). If the min balls is 25, for example, and you have 100 balls, as soon as you go down to 25 (should be very soon) and, now, lets say you teleport to a dragonite, like you said; you'll be at around ~15 balls after this and it'll be skipping sniping untill you have 25 again, but then, again, you'll go down to 15~20 balls for the 42904th time. This will repeat forever. To avoid this, it'll need to sleep untill you have 100 balls again, lets say.

kureijir commented 8 years ago

Hmm so if I understand it correctly, you're saying that it should "have ~100 balls -> snipe -> ~15 balls -> stop catching until ~100balls -> repeat", instead of "having ~25balls -> snipe -> ~15 balls -> stop catching until ~25balls -> repeat". But I don't quite understand the difference between them. Also in my specific case, there are so many forts in my area, and they're so close together that if I didn't snipe, I always end up with a bunch of Ultraballs, and almost no Pokeballs and Greatballs (because they're recycled almost right away), which mean that if (again, it's just me) I run out of balls, the thing I need to stop is sniping alone.