-
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
Draft feature to snipe pokemon #1887
Conversation
What you mean by snipe? |
Ah that word from People can use trick to teleport to pokemon coords and encounter it then teleport back. |
Yes apparently you have to start the fight and teleport back before throwing the first pokeball |
Can you take a look at this PR #1748 |
@@ -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(): |
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.
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.
2ab669f
to
905b4f8
Compare
@TheSavior Updated, please have a look again. Thanks. |
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): |
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.
This should extend BaseTask which gives you bot and config for free. Take a look at the other workers for an example
@douglascamata Please review this |
if self.bot.tick_count is not 1: | ||
return | ||
|
||
while True: |
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.
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.
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.
@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
@TheSavior @douglascamata @nikhil-pandey is something like |
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. |
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. |
@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. |
Snipe Pokemons from List
@douglascamata Could you please review this? |
Merge conflicts again. |
Please put the snipe coordinates inside the worker config parameter. |
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.. |
@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.
|
@Kassius509 Maybe an option for config file location is what u need. You can share it among your Docker instances.
|
@Kassius509 all flags in config.json can be overwrote by console arguments, it is a main approach (at least we try to do it). |
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. |
I've tried this and it doesn't seem to work at all.
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. |
@nelsyeung consider using this #1992 or checkout master branch on my fork |
i get this error |
What do I type in to snipe a pokemon or add the location? theres no example besides this |
@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. |
Remove argument
|
How do I test this? |
@nelsyeung I used the regular dev version and im getting this error when I add it to config |
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 |
@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. |
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? |
Yeah, probably a good choice. Thanks @enjoy2000, it will help provide us some base code to look at when building a new version. |
Short Description:
Add draft commit with hope that u guys can give me some advices.
Always got softbanned when trying to snipe pokemon.