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

Public Sniping List Integration #3672

Closed
elicwhite opened this issue Aug 12, 2016 · 22 comments
Closed

Public Sniping List Integration #3672

elicwhite opened this issue Aug 12, 2016 · 22 comments

Comments

@elicwhite
Copy link
Contributor

elicwhite commented Aug 12, 2016

Utilizing Sniping Lists

There are a bunch of services right now that provide lists of pokemon that are live, and snipeable. Examples include:

We want to be able to allow our bots to support sniping from these lists. Each site has a different way to read data from their api.

Requirements for a valid solution:

  • The user of the bot must be able to configure which list(s) they want to pull from
  • The user must be able to configure which pokemon they want to snipe
  • Different websites have different data formats and needs (only sending VIPs or perfect IVs for example)
  • Creating a new data source should be possible using plugins
  • We must be able to report found pokemon back to the configured servers.

Solution:

Example Configuration

I imagine the configuration for this task to be something like this:

{
  // ...
  "tasks": [
    {
      "type": "SnipePokemon",
      "config": {
        "providers": [
          "PokeSnipers",
          "Haxton"
        ]
      }
    },
  ],
  "catch": {
    "Growlith": { "catch_above_cp": 1000, "catch_above_iv": 0.95, "logic": "or" }
  },
  "vips" : {
    "Dragonite": {},
    "Snorlax": {}
  }
  // ...
}

Providers

In this solution I will use the term Provider to mean a python class that provides the data from a single source.

There will be a SnipingProviderBase class that providers can implement. Here is a sample implementation:

class SnipingProviderBase(object):
  def initialize(self):
    self.search_config = self.config.get('search_config', {})

  def encountered_pokemon(self, pokemon):
    """
    format the pokemon and send the data to the server
    """
    pass

  def search_for_pokemon(self):
    """
    connect to the provider, possibly using search_config with the provider api
    return a list of pokemon location objects
    """
    pass

And then for an idea of what the SnipePokemon task might look something like this:

class SnipingTask(BaseTask):
  def initialize(self):
    self.raw_providers = self.config.get('providers', []);
    self.search_config = self.config.get('search_config', {})

    self.providers = [
      # Class references to instantiated providers
    ]

    # self.bot.event_manager.add_handler(...
    # register an event listener that listens for 
    # encounter pokemon and sends it to all providers

  def encountered_pokemon(self, data):
    for provider in self.providers:
      provider.encountered_pokemon(data)

  def work(self):
    # create a merged list of pokemon from all the providers
    # filter by search_config
    # sort
    # snipe
    pass

I imagine a real solution would be more complicated to have more caching and not need to make a request to the provider on every tick. Since we will have a list of pokemon waiting for us that just needs to be refreshed.

Keeping track of what has already been caught

If each provider is returning a list of the pokemon that match the configuration, and we cache that list so we don't make a request every tick, then when we catch pokemon, we need to be able to make sure we ignore the pokemon we have already caught. We can do this by having the SnipingTask keep a list of the pokemon it has already caught. On every tick we will remove from that list every pokemon that would no longer be visible. Then, when we get the lists from all of the providers, we can remove all of the ones in our already_caught list. This means we need some unique ID per sighting. If there is no unique ID provided by the api, we can create a hash of the object.

Plugins

We currently support plugins for tasks, and anything we do for sniping providers should work with that same base.

By specifying in the config as an array of class names of providers, the SnipingTask can work very similarly to the way we create the list of tasks.

Future Directions

By making it possible to create sniping providers as plugins, and as easily configurable as our bot currently is, I could imagine a significant amount of the projects on the web that work to gather pokemon data actually being able to be built on top of this. Imagine this configuration:

"tasks": [
  {
    "type": "SnipePokemon",
    "config": {
      "providers": [
        "my_plugin.MyCoolPokemonMapSite"
      ],
      "catch_vips": false,
      "catch": {}
    }
  },
  {
    "type": "FollowSpiral",
    "config": {
      "diameter": 4,
      "step_size": 70
    }
  }
]

With no other configuration, the bot would do nothing except walk in a spiral and report the pokemon it finds to the configured server. Neat!

@jnguyen32
Copy link

won't you get softbanned for teleporting?

@Quantra
Copy link
Contributor

Quantra commented Aug 12, 2016

When I was looking at doing this I felt it wasn't possible with the current sniping code. To make the encounter_api_call we need the encounter_id and either fort_id or spawnpoint_id. I looked at http://pokesnipers.com/api/v1/pokemon.json and they don't provide this.

To get it I think we need to change the code to teleport then request map objects so we can get those ids. I can't say for sure but I think this will be seen as teleporting and therefore softban. I'd love to be proven wrong.

For reference

    def snipe(self, pokemon):
        """Snipe a Pokemon by teleporting.

        Args:
            pokemon: Pokemon to snipe.
        """
        last_position = self.bot.position[0:2]
        self.bot.heartbeat()
        self._teleport_to(pokemon)
        catch_worker = PokemonCatchWorker(pokemon, self.bot)
        api_encounter_response = catch_worker.create_encounter_api_call()
        time.sleep(SNIPE_SLEEP_SEC)
        self._teleport_back(last_position)
        self.bot.api.set_position(last_position[0], last_position[1], 0)
        time.sleep(SNIPE_SLEEP_SEC)
        self.bot.heartbeat()
        catch_worker.work(api_encounter_response)
        self.add_caught(pokemon)
        return WorkerResult.SUCCESS

@solderzzc might have a better insight?

EDIT: http://haxton.io/api/pokemon does provide the required data =D

@douglascamata
Copy link
Member

Snipping doesn't 'cause a soft ban. You teleport to wherever the pokemon is, start the encounter, then teleport back and catch. It's easily done through Android emulators manually.

@k4n30
Copy link
Contributor

k4n30 commented Aug 12, 2016

@TheSavior what happened to searching first :p Going to leave this open as it encompasses other issues but has a forward looking approach

Related issues:
#3656 #3666 #3355 #3278 #3226

@fari-99
Copy link

fari-99 commented Aug 12, 2016

can we just use this url and use pokemongo-map to encounter it, after that we can snipe it.

i'm always using it like that, first i see coordinate in pokesniper, i entered it in pokemongo-map web location interface, and wait for encounter after that the bot try catch it.

@MasterCATZ
Copy link

pretty much what I am doing is having pogm , go to a new location imported from sniping API's long/lats

then PokemonGo-Bot see's them and snipes them

alternatively , import locations into the sql database that pogm uses ?

@nearalias
Copy link

nearalias commented Aug 12, 2016

so i saw on dev chat the other day someone mentioning Pokesnipers.com providing a json feed api, and i wrote up this https://gist.github.com/nearalias/1c7b7d82a8897fa59e1cc0d3c8908745 to use for myself.

however it seems kinda of buggy sometimes, and i'm not sure if it's due to teleporting mechanics incorrectly implemented, niantic ip banning, or just Pokesnipers feed being inaccurate. but feel free to build from this if it helps.

@ghost
Copy link

ghost commented Aug 12, 2016

@nearalias itry use your code but have errors, I thinks errors about 'EventNotRegisteredException: Event use_pokesnipers not registered...'

@DimaVIII
Copy link

I think you can stop building this feature... Permanent Bans are active now and may be agains Sniping. I was running two bot, in the same area. Both with "MoveToMapPokemon" one was on sniping mode and this account got a Permanent Ban the other still work.

#3724
https://www.reddit.com/r/pokemongo/comments/4rgzg1/hi_guyshow_can_i_fix_failed_to_get_game_data_from/

@k4n30
Copy link
Contributor

k4n30 commented Aug 12, 2016

@DimaVIII That's a bit short-sighted just to say "stop building they have perma banned people"

@DimaVIII
Copy link

DimaVIII commented Aug 12, 2016

@k4n30 I just hit up google for a hour and find lots of reports that confirm my observation. One of the trigger is teleporting.

@k4n30
Copy link
Contributor

k4n30 commented Aug 12, 2016

doesn't mean they won't find a new pattern or a new way to achieve the same outcome

@DimaVIII
Copy link

I was sniping in a 4km range and this feature will snipe around the world. So there is for sure no way to get around this ban. The server saves the location of caught pokemons and if you caught one in NYC and 2 min later one in Hong Kong...
(The server saves the location = in the past versions of the app was a white block above the "transfer pokemon" button. I'm pretty sure this block was for a small image of the location where you caught the pokemon.)

@EnvisageX
Copy link

I wasn't sniping last night... still got the 2 accounts I was running banned. So please write this feature. :)

@k4n30
Copy link
Contributor

k4n30 commented Aug 18, 2016

@TheSavior where's this awesome feature implementation you promised us? :p

@elicwhite
Copy link
Contributor Author

Based on the recent ban waves and the riskiness of sniping in general, I don't think I'm going to be building this. If someone else feels the urge, feel free.

@k4n30 k4n30 changed the title Proposal: Utilizing Public Sniping Lists Public Sniping List Integration Aug 19, 2016
@mjmadsen
Copy link
Contributor

@k4n30 @TheSavior would you say we meet this with our social feature?

@k4n30
Copy link
Contributor

k4n30 commented Aug 29, 2016

I'd say no, but I'm also kind of with what TheSaviour has said about sniping in general - Will allow him to make final decision

@avexus
Copy link

avexus commented Aug 31, 2016

I think sniping should be a manual thing. You run out of poke balls really really fast if you automate it.

@MZorzy
Copy link

MZorzy commented Sep 5, 2016

  • map-chat

@oralunal
Copy link
Contributor

oralunal commented Sep 6, 2016

https://github.com/5andr0/PogoLocationFeeder
This is a service that uses all the service @TheSavior told. This can be usefull.

@YvesHenri YvesHenri mentioned this issue Sep 15, 2016
@YvesHenri
Copy link

I bring good news. I made a PR (see above) which covers pretty much this issue. I've also adapted the above PogoLocationFeeder mentioned by @oralunal to work with our bot (see my github). Perhaps some of you could give some thoughts on the PR to convince @solderzzc and someone that always used walking sniper (he thinks its safer). There are always improvements to be done (increase flexibility) so all help are appreciated.

@YvesHenri YvesHenri mentioned this issue Sep 18, 2016
@k4n30 k4n30 closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests