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

Draft feature to snipe pokemon #1887

Closed
wants to merge 8 commits into from

Conversation

enjoy2000
Copy link

Short Description:
Add draft commit with hope that u guys can give me some advices.
Always got softbanned when trying to snipe pokemon.

@douglascamata
Copy link
Member

What you mean by snipe?

@enjoy2000
Copy link
Author

Ah that word from .net version.

People can use trick to teleport to pokemon coords and encounter it then teleport back.
After that we can catch it normally without softban.

@DayBr3ak
Copy link
Contributor

Yes apparently you have to start the fight and teleport back before throwing the first pokeball

@wilsonyqm
Copy link

Can you take a look at this PR #1748

@enjoy2000
Copy link
Author

image
./pokecli.py --snipe=True
First run and it success.

But maybe need more refactoring work, please help to review.

@@ -104,6 +108,34 @@ def report_summary(bot):
if metrics.most_perfect is not None:
logger.log('Most Perfect Pokemon: {}'.format(metrics.most_perfect['desc']), 'cyan')

def snipe():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be here. Now that the bot is fully configurable by the user in config.json, I'd recommend creating a SnipePokemon worker. Then a user could specify just that in their config.json and get the behavior you want. There should generally be no reason this file needs to be modified anymore.

@enjoy2000
Copy link
Author

@TheSavior Updated, please have a look again. Thanks.

@nikhil-pandey
Copy link
Contributor

Awesome!
image

@nikhil-pandey
Copy link
Contributor

Processing snipe targets from a configuration file on each tick would be awesome.

from pokemongo_bot import logger
from utils import distance

class SnipePokemon(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should extend BaseTask which gives you bot and config for free. Take a look at the other workers for an example

@elicwhite
Copy link
Contributor

@douglascamata Please review this

if self.bot.tick_count is not 1:
return

while True:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me super uncomfortable. I understand why it is here and what you are trying to do, but this is super yucky as a worker to have a while true that waits for user input. Perhaps @douglascamata's socket.io approach will be what we need to support this.

Copy link
Contributor

@nikhil-pandey nikhil-pandey Jul 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheSavior @enjoy2000 Or we could use a configuration file with list of snipe targets and process them one by one and remove the targets as they are processed. Would be usable even when bot is running. Similar to #1768

@enjoy2000
Copy link
Author

enjoy2000 commented Jul 31, 2016

@TheSavior @douglascamata @nikhil-pandey is something like watchdog & a config file ok?

@elicwhite
Copy link
Contributor

I think I defer to @douglascamata here. I'd want to make sure what we do is compatible with the websockets stuff which is probably coming in the next day or two. It is also possible he would want to merge something like that in the mean time and then he can go back and update it. Not sure, I'll wait for him.

@Nihisil
Copy link
Contributor

Nihisil commented Jul 31, 2016

I'm pretty sure we don't need to have user inputs in bot. It should be configured only from configs, because in that case we have ability to run it automatically by provision tools.

@nikhil-pandey
Copy link
Contributor

@Nihisil Right. I think we should use a configuration file with a list of destinations to snipe. The destinations are removed once they are processed. I don't exactly know what the plan is with websockets. I assume it will be used to perform actions from the web later on through API calls? If so, same config file can be updated later during API calls.

@nikhil-pandey
Copy link
Contributor

@douglascamata Could you please review this?

@douglascamata
Copy link
Member

Merge conflicts again.

@douglascamata
Copy link
Member

Please put the snipe coordinates inside the worker config parameter.

@douglascamata
Copy link
Member

Also please consider adding the pokemon name along with each coordinate. This way snipping is more effective because it will search only for the pokemon you want to snipe and not for everything there..

@ghost
Copy link

ghost commented Jul 31, 2016

@Nihisil @nikhil-pandey @douglascamata Are you guys suggesting we add the sniping coordinates to the already jam packed config file? If so I would have to disagree with you.

I believe the use case intended was to allow sniping of pokemon while the application was already running, allowing you to pass individual locations as you discover them without having to close the application then open, alter, and save the config.json and again relaunch the application each time.

I like the idea of adding the pokemon name along with the coordinate, but I would suggest this remain an optional feature.

./pokecli.py —snipe=True —location=1.232,1.232 —"Dragonite"

@enjoy2000
Copy link
Author

@Kassius509 Maybe an option for config file location is what u need. You can share it among your Docker instances.

On 1 Aug 2016, at 5:46 AM, Kassius509 notifications@github.com wrote:

with

@Nihisil
Copy link
Contributor

Nihisil commented Aug 1, 2016

@Kassius509 all flags in config.json can be overwrote by console arguments, it is a main approach (at least we try to do it).

@BartKoppelmans
Copy link
Contributor

BartKoppelmans commented Aug 2, 2016

Just an idea, maybe we could work together with this site to use their database for sniping. That way we can just set sniping to true and automatically snipe the rare pokemon that get listed there.

Edit: Found more information on Rare Pokémon Spawns. If we could implement this in a way that it automatically passes the coordinates into the bot, it would be perfect! Perhaps we could try doing it with an event, that whenever a new pokémon is listed, it automatically triggers the snipe feature.

I am not too skilled with Python, but I could look at how the database could be made up and used with events. I would need someone else to help me with writing the code though.

@nelsyeung
Copy link
Contributor

I've tried this and it doesn't seem to work at all.

[12:02:13]  Found location: 40.773115629, -73.980903625
[12:02:14]  Teleport to location..
[12:02:15]  No pokemon found!

I've basically tested this with common pokemon that are scanned from PokemonGo-Map, I used their provided coordinates with this and every one will return "No pokemon found!".

I've also tried the coordinates provided by Rare Pokemon Spawns, then confirm whether the Pokemon actually exists by putting the location into the PokemonGo-Map, finally input the location to snipe_list.json, but again, always, "No pokemon found!".

What am I missing with this? If my coordinates are not specific enough, is it not possible to have a configuration to expand the searching for the teleported part? That might cause softban but you can have a brute force way of teleporting to and back for the search.

@enjoy2000
Copy link
Author

@nelsyeung consider using this #1992 or checkout master branch on my fork

@drees5
Copy link

drees5 commented Aug 3, 2016

i get this error
./pokecli.py --snipe=true
[15:11:45] PokemonGO Bot v1.0
[15:11:45] No config argument specified, checking for /configs/config.json
usage: pokecli.py [-h] [-cf CONFIG] [-a AUTH_SERVICE] [-u USERNAME]
[-ws WEBSOCKET.SERVER_URL]
[-wss WEBSOCKET.START_EMBEDDED_SERVER]
[-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
[-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN] [-w WALK]
[-k GMAPKEY] [-d DEBUG] [-t TEST] [-du DISTANCE_UNIT]
[-ec EVOLVE_CAPTURED] [-rt RECONNECTING_TIMEOUT]
[-hr HEALTH_RECORD] [-ac FORTS.AVOID_CIRCLES]
[-mcs FORTS.MAX_CIRCLE_SIZE]
[--catch_randomize_reticle_factor CATCH_RANDOMIZE_RETICLE_FACTOR]
[--catch_randomize_spin_factor CATCH_RANDOMIZE_SPIN_FACTOR]
[--map_object_cache_time MAP_OBJECT_CACHE_TIME]
pokecli.py: error: unrecognized arguments: --snipe=true
(i have downloaded your fork)

@JohnnyOmm
Copy link

What do I type in to snipe a pokemon or add the location? theres no example besides this
{ "type": "SnipePokemon" },

@nelsyeung
Copy link
Contributor

@JohnnyOmm If you use his master branch, you simply need to add that to the task and it will prompt you to enter a location. However, I myself can't really find pokemon that way reliably. I would also recommend #1992 if you want sniping.
@drees5 For his master branch, you don't need to specify a command line argument, you simply add "type": "SnipePokemon" to your tasks. If you are using his feature branch, you do the same but also you have to cp the snipe_list.example.json file to snipe_list.json then you run python pokecli.py -spl configs/snipe_list.json to make it work.

@enjoy2000
Copy link
Author

Remove argument —snipe=True pls, just need to add task SnipePokemon in config.json

On 3 Aug 2016, at 9:53 PM, drees5 notifications@github.com wrote:

i get this error
./pokecli.py --snipe=true
[15:11:45] PokemonGO Bot v1.0
[15:11:45] No config argument specified, checking for /configs/config.json
usage: pokecli.py [-h] [-cf CONFIG] [-a AUTH_SERVICE] [-u USERNAME]
[-ws WEBSOCKET.SERVER_URL]
[-wss WEBSOCKET.START_EMBEDDED_SERVER]
[-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
[-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN] [-w WALK]
[-k GMAPKEY] [-d DEBUG] [-t TEST] [-du DISTANCE_UNIT]
[-ec EVOLVE_CAPTURED] [-rt RECONNECTING_TIMEOUT]
[-hr HEALTH_RECORD] [-ac FORTS.AVOID_CIRCLES]
[-mcs FORTS.MAX_CIRCLE_SIZE]
[--catch_randomize_reticle_factor CATCH_RANDOMIZE_RETICLE_FACTOR]
[--catch_randomize_spin_factor CATCH_RANDOMIZE_SPIN_FACTOR]
[--map_object_cache_time MAP_OBJECT_CACHE_TIME]
pokecli.py: error: unrecognized arguments: --snipe=true
(i have downloaded your fork)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #1887 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADs-e0_dD2z_n8Jv_rjk9I9P7v0w4AsZks5qcKtmgaJpZM4JY2kH.

@Kozeo
Copy link

Kozeo commented Aug 3, 2016

How do I test this?

@JohnnyOmm
Copy link

@nelsyeung I used the regular dev version and im getting this error when I add it to config
pokemongo_bot.tree_config_builder.ConfigException: No worker named SnipePokemon defined

@licklake licklake mentioned this pull request Aug 10, 2016
@umbreon222 umbreon222 mentioned this pull request Aug 12, 2016
@tolinwei
Copy link

Just found this PR, since PokemonGo-Map has been ceased, is this still working? If yes, what is the source of the teleport list – I read the previous comments and haven't found any here

@nelsyeung
Copy link
Contributor

@tolinwei Check out this version of the PokemonGo-Map. If you want rare spawns try PokeSpawns. Also check out MoveToMapPokemon feature that's already out for the less specific sniping feature.

@k4n30
Copy link
Contributor

k4n30 commented Aug 13, 2016

Should this be closed as the code it's based off is pretty old, and the movetomap task config option exists until #3672 is implemented?

@elicwhite
Copy link
Contributor

Yeah, probably a good choice.

Thanks @enjoy2000, it will help provide us some base code to look at when building a new version.

@elicwhite elicwhite closed this Aug 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.