tehp / openpogobot Goto Github PK
View Code? Open in Web Editor NEWA PokemonGo Python bot - NO LONGER MAINTAINED
License: MIT License
A PokemonGo Python bot - NO LONGER MAINTAINED
License: MIT License
Bot write to inventory, catchable, and location json files inside the web folder
Bot is not writing to the inventory, catchable and location json files located in the web folder anymore
Run like normal
OS: Debian 8
Git Commit:
After adding ./data/catch-ignore.yml, the bot should run fine and ignore the pokemons listed
The bot crashes with the following error:
[2016-07-25 14:54:26] [x] Starting PokemonGo Bot.... Traceback (most recent call last): File "pokecli.py", line 182, in <module> main() File "pokecli.py", line 173, in main bot.take_step() File "d:\pokemon\Bot\PokemonGo-Bot\pokemongo_bot\__init__.py", line 40, in take_step self.stepper.take_step() File "d:\pokemon\Bot\PokemonGo-Bot\pokemongo_bot\stepper.py", line 40, in take_step self._work_at_position(position[0], position[1], position[2], True) File "d:\pokemon\Bot\PokemonGo-Bot\pokemongo_bot\stepper.py", line 101, in _work_at_position self.bot.work_on_cell(map_cells, position, pokemon_only) File "d:\pokemon\Bot\PokemonGo-Bot\pokemongo_bot\__init__.py", line 43, in work_on_cell self._remove_ignored_pokemon(map_cells) File "d:\pokemon\Bot\PokemonGo-Bot\pokemongo_bot\__init__.py", line 68, in _remove_ignored_pokemon if pokemon_name in ignores: NameError: global name 'ignores' is not defined
OS: Windows 10
Git Commit: 65f0fb8
also getting these errors in Terminal.
python2 pokecli.py -a ptc -u USER -p PASS --location "51.640513, -2.678127"
Much of the projects JavaScript needs linting.
Right now this will be a brain dump...apologize for the lack of structure.
@OpenPoGo/maintainers
before mergingBot exits when SIGINT is fired.
Exiting PokemonGo Bot
is printed but nothing happens until all clients connected to the web server plugin exit.
Can probably be fixed by firing an event when the bot is going to shut down, allowing plugins to clean up their state. Alternatively, force the program to exit by installing a SIGINT handler.
Add option to disable plugins like web, etc.
Mostly for typing and being more organized. I think we need to eventually transition to only support python 3.5.
Please up/down vote this post for your decision.
Hi there,
After pulling latest from main I get :
Traceback (most recent call last):
File "./pokecli.py", line 37, in
from pokemongo_bot import logger
File "/root/OpenPoGoBot/pokemongo_bot/init.py", line 14, in
from pokemongo_bot import logger, cell_workers, human_behaviour, item_list, stepper
File "/root/OpenPoGoBot/pokemongo_bot/cell_workers/init.py", line 4, in
from pokemongo_bot.cell_workers.seen_fort_worker import SeenFortWorker
File "/root/OpenPoGoBot/pokemongo_bot/cell_workers/seen_fort_worker.py", line 7, in
from pokemongo_bot.utils import format_time, f2i
File "/root/OpenPoGoBot/pokemongo_bot/utils.py", line 10, in
from api.worldmap import PokeStop
File "/root/OpenPoGoBot/api/init.py", line 6, in
from pgoapi.exceptions import ServerSideRequestThrottlingException # type: ignore
ImportError: cannot import name ServerSideRequestThrottlingException
The Read Me talks about the release config. Does this feature work here? If not, maybe we should remove it from the Read Me until it is ported over.
The bot should start without crash when -it
is given as option but certain pokemons are not available.
$ ./pokecli.py -j config.json -lc -it -cp 200
{'username': u'[email protected]', 'max_steps': 100000, 'recycle_items': True, 'initial_transfer': True, u'evolve_all': True, u'item_filter': {u'201': {u'keep': 30}, u'701': {u'keep': 100}, u'1': {u'keep': 50}, u'102': {u'keep': 30}, u'103': {u'keep': 30}, u'101': {u'keep': 10}}, 'distance_unit': u'km', 'exclude_plugins': [u'web'], 'auth_service': u'google', 'walk': 4.16, 'debug': False, 'json': 'config.json', 'test': False, 'location': u'54.179776, 7.889137', 'ign_init_trans': '', 'location_cache': True, 'cp': 200, 'password': u'***', 'gmapkey': u'XXX', 'pokemon_potential': 0.7, 'mode': u'all'}
…
[2016-07-29 10:59:20] [x] Initial Transfer.
[2016-07-29 10:59:20] [x] Will NOT transfer anything above CP 200 or these ['']
Traceback (most recent call last):
File "./pokecli.py", line 240, in <module>
main()
File "./pokecli.py", line 228, in main
bot.start()
File "~/OpenPoGoBot/pokemongo_bot/__init__.py", line 55, in start
self._setup_api()
File "~/OpenPoGoBot/pokemongo_bot/__init__.py", line 250, in _setup_api
worker.work()
File "~/OpenPoGoBot/pokemongo_bot/cell_workers/initial_transfer_worker.py", line 23, in work
pokemon_groups = self._initial_transfer_get_groups()
File "~/OpenPoGoBot/pokemongo_bot/cell_workers/initial_transfer_worker.py", line 57, in _initial_transfer_get_groups
inventory_dict = inventory_req['responses']['GET_INVENTORY']['inventory_delta']['inventory_items']
KeyError: 'GET_INVENTORY'
Start bot with -it
, stop it and immediately start second time with -it
.
OS: OSX Yosemite (python 2.7.11 and python 3.5.2)
Git Commit: d61d555
After updating today when I try to start the bot I get this repeating over and over. I log in with a google account and everything was working fine before.
[2016-07-30 13:32:27] [+] Login to Pokemon Go successful.
[API] Token has expired, attempting to log back in...
ERROR:pgoapi.pgoapi:Login failed - unexpected server response!
[API] Failed to login. Waiting 15 seconds...
ERROR:pgoapi.pgoapi:Login failed - unexpected server response!
[API] Failed to login. Waiting 15 seconds...
On login i should be able play
I get login servers busy non stop
Use config.json
OS: Ubuntu 14.04
Git Commit: Newest
Bot walks smoothly
Bot moves too fast or teleports causing softban and crashes
PoGo bot (Not my screenshot but in my case it's the same as this)
Walk speed on both bots are 4
OS: Mac OS
Git Commit: 65f0fb8
Already mentioned here: #28
Currently Travis only runs pep8
and exits. It might make sense for us to create one or more dummy accounts with various different input parameters and run the bot for a few minutes in the Travis build to make sure the bot at least has baseline functionality working.
This will most likely miss edge cases/unexpected behavior, but it'll give additional confirmation that the codebase will run successfully.
Obviously login credentials should be encrypted, but this will not work for PRs from 3rd party forks (though it will work for branches in this repo). Even with this limitation, it might be worthwhile. Thoughts?
Cloud providers have been blocked from accessing Niantic's API, however unit testing and mocks can be used instead.
If i set mode in config to "all", i expect that the bot wont change it.
If my bag is full, the bot changes mode to "poke" (https://github.com/OpenPoGo/OpenPoGoBot/blob/64768648983982a4981d2af28128201372b71420/pokemongo_bot/cell_workers/seen_fort_worker.py#L88) and just catches pokemon until there are no pokeballs left.
Without pokeballs it will change to "farm" (https://github.com/OpenPoGo/OpenPoGoBot/blob/69a376bbf0cec29536a8d466ce4db11949ee7d89/pokemongo_bot/cell_workers/pokemon_catch_worker.py#L139) and the bot will only farm.
I think it should clean the inventory as set with item_filter on full bags. And it should farm only to get a few balls if there are none and start catching pokemons after that.
Upon arriving at a Pokestop I will get
[2016-07-27 16:19:45] [#] Finished walking
[2016-07-27 16:19:45] [#] Arrived at Pokestop
Traceback (most recent call last):
File "pokecli.py", line 240, in
main()
File "pokecli.py", line 233, in main
bot.take_step()
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/init.py", line 65, in take_step
self.stepper.take_step()
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/stepper.py", line 39, in take_step
self._work_at_position(position[0], position[1], True)
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/stepper.py", line 107, in _work_at_position
self.bot.work_on_cell(cell, pokemon_only)
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/init.py", line 104, in work_on_cell
walk_worker.work()
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/cell_workers/walk_towards_fort_worker.py", line 49, in work
logger.log(u"[#] Now at Pokestop: " + fort_name)
File "/home/frank/newshit/OpenPoGoBot-master/pokemongo_bot/logger.py", line 29, in log
print(output)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 43-46: ordinal not in range(256)
RPC understands about incubators as such we could do two things:
This will allow better use of eggs, and the ability to get more rare Pokemon we normally would miss out on in the bot system.
Arguments should use dashes not underscores.
Instead of --initial_transfer, the argument should be --initial-transfer.
Please see stack trace:
[2016-07-29 03:08:21] [#] -- Level: 12
[2016-07-29 03:08:21] [#] -- Experience: 70360
[2016-07-29 03:08:21] [#] -- Experience until next level: 4640
[2016-07-29 03:08:21] [#] -- Pokemon Captured: 177
[2016-07-29 03:08:21] [#] -- Pokestops Visited: 143
[2016-07-29 03:08:21] [x] Initial Transfer.
[2016-07-29 03:08:21] [x] Will NOT transfer anything above CP 500 or these ['']
Traceback (most recent call last):
File "./pokecli.py", line 240, in
main()
File "./pokecli.py", line 228, in main
bot.start()
File "/root/OpenPoGoBot/pokemongo_bot/init.py", line 55, in start
self._setup_api()
File "/root/OpenPoGoBot/pokemongo_bot/init.py", line 250, in _setup_api
worker.work()
File "/root/OpenPoGoBot/pokemongo_bot/cell_workers/initial_transfer_worker.py", line 23, in work
pokemon_groups = self._initial_transfer_get_groups()
File "/root/OpenPoGoBot/pokemongo_bot/cell_workers/initial_transfer_worker.py", line 57, in _initial_transfer_get_groups
inventory_dict = inventory_req['responses']['GET_INVENTORY']['inventory_delta']['inventory_items']
KeyError: 'GET_INVENTORY'
OpenPoGoBot will try to spin, if it can't it should walk away and not try to spin that for at least 5 mins.
OpenPoGoBot Spins the same Stop multiple times, reports that you are softbanned, and closes
Run OpenPoGoBot and wait for it to spin a Stop
Also reported here: #42
OS: Windows/Linux
Git Commit: Happening on latest commit: db376bb
Remove all try/catch checks for properties and replace with .get('prop_name', {})
try:
inventory_items = response_dict['responses']['GET_INVENTORY']['inventory_delta']['inventory_items']
for item in inventory_items:
# print('item {}'.format(item))
if 'inventory_item_data' in item:
item_data = item['inventory_item_data']
if 'pokemon_data' in item_data:
pokecount += 1
if 'item' in item_data and 'count' in item_data['item']:
itemcount += item_data['item']['count']
except KeyError:
pass
Definitely need to re-implement --cp and --iv ASAP
This is definitely open for discussion. I'm personally a fan of removing JSON configuration files and going back to command line parameters. At least give command line priority over JSON (So you can use both but if there's a conflict command line is used).
So I'm finding the bot's structure a little all over the place:
pokecli
invokes the bot
bot
then passes straight throught to the stepper
stepper
gets a list of cell ids and calls the bot
backworkers
when it wantswalk_towards_fort_worker
then calls the stepper
back again and we go around in circles until all the stop have been visited.While it works, it makes modifying workers and pathing more difficult as there is worker logic in the bot and pathing logic in both the bot and the workers.
I've been working on a way to solve it, and i've come up with this:
Mapper
component will handle map-only functions, like fetching cell IDs from a lat/long coord.Navigator
. The Navigator
is responsible for choosing where the bot will go. For now, we will have a FortNavigator
that will visit forts, but any Navigator
can be easily created, for example something like a WaypointNavigator
that will walk a pre-set path.Navitgator
has choosen) will be done by PathFinders
. Examples we have now would be a GoogleDirectionsPathFinder
, which uses the google directions api, and DirectPathFinder
, which goes directly there.Stepper
now ONLY handles moving the bot and tracking it's current and origin locations.Workers
now self contained and are passed a Cell
instance and are to work only on this Cell
. An array of all Workers
is kept in the bot
So, the flow would look more like this:
pokecli
invokes the bot
(pokecli.py#L240)bot
requests initial cell ids from the Mapper
(pokemongo_bot/init.py#L85)bot
invokes all Workers
with cell ids (pre-movement workers) (pokemongo_bot/init.py#L86)bot
invokes Navigator
with cell ids (pokemongo_bot/init.py#L88)Navigator
builds a destination and tells the Stepper
to move there. (pokemongo_bot/navigation/fort_navigator.py#L42-L45)Stepper
will find the way there using a PathFinder
(pokemongo_bot/stepper.py#L54 -> pokemongo_bot/navigation/path_finder/google_path_finder.py)Stepper
will move, 1 step at a time towards location along the PathFinder
's path. Each step invokes the Workers
with the current location's cell ids. (pokemongo_bot/stepper.py)Navigator
to choose next direction to travel.It makes more sense to me this way, and keeps all the components de-coupled.
Any thoughts?
if response_dict is None, then don't try to access properties.
tries to access properties when response_dict is None.
Currently the Bot object inside of init is just...terrible when accessing dicts. This is the first quality of life fix we need to change.
All logs use the same format, regardless of color
Colored (non-default) log messages do not have the brackets around the date, making the line badly formatted
Uh... I think it's pretty straight-forward.
OS: Windows 10
Git Commit: e014532
Filter items on login based on config.json file.
Recycle items from stop when item is over limit specified in config.json file.
Not filtering or recycling
Normal play
OS: OSX
Git Commit: Master - latest pull from 7/31/16
Currently the bot will walk to random locations in a given range, it could be great to provided an ordered list/dict or locations you want to visit.
--location "53.3468069,-6.2589212" --destionations=destionations.js
destionations.js
destionations = [
"53.3457565,-6.2604233"
"53.3448982,-6.2632986"
"53.3442321,-6.2640496"
"53.3430407,-6.2645432"
"53.3444627,-6.2595864"
"53.3444243,-6.2530418"
"53.3422721,-6.2534495"
"53.3434507,-6.2594899"
]
This would let people map out their favorite locations within a locale to have the bot visit.
I am looking at writing a Pokemon history system that could then scan the areas for Pokemon noticed ( similar to pokevision.com but with history). Over time this would also let the bot be able to have time-based logic such as be @ gps X at 12:20-12:34 to try and get a spawn. Obviously this could use more refinement but initially just being able to have a walk list in the bot would be great.
After a while I get this Now at Pokestop: Unknown - Spinning...
Currently the bot walks on water which can be problematic.
Ideally the bot should avoid waterways by using Google Maps directions API to navigate to the correct location.
Bot starts from last recorded location specified in data/last-location-{username}.json
Bot starts at specified location from config,json
"location": "123 Sesame Street",
"location_cache": true,
OS: Windows 10
Git Commit: newest | master | @ 4:20pm (GMT+12)
This project needs to be properly PEP-8 compliant.
cloning into 'web'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:OpenPoGo/OpenPoGoWeb.git' into submodule path 'web' failed
git submodule init
git submodule update
OS:
Git Commit:
Currently, the bot requires a config.json, otherwise it crashes with
AttributeError: 'Namespace' object has no attribute 'recycle_items'
, as you can't provide recycle_items via the command line. Ideally, recycle_items
should be initialized as empty (so to avoid crash if not supplied).
All PRs should be tested for style/pep8/pylint via Jenkins or some other CI
We'll be overhauling the web interface.
[ ] Should use better storage method of game state
[ ] Should use AngularJS instead of jQuery
As said in the subject, the toon is no longer moving while watching on the map.
location-username.json in web directory
file not found which causes web page to not work
start bot
start webserver
observe directory contents and webserver console
OS: Windows 10
Git Commit: Newest as of 12:25 AM EST July 26, 2016 (Master)
All of the calls like response_dict['responses']['GET_PLAYER']['player_data']
should be redone using a more abstract API.
Possible choices:
This is going to be dirty ticket.
Estimated time to walk to pokestop should be based on distance.
Time seems random.
[2016-07-26 13:48:36] [#] Found fort $ at distance 0.05km
[2016-07-26 13:48:36] [#] Need to move closer to Pokestop
[2016-07-26 13:48:36] [#] Walking from ($, $) to ($, $) for approx. 1.43 minutes
Start the bot with a pokemon clean up, keeping only the higher CP of each pokemon, while respecting the cp limit.
Option ignored and no pokemon are transferred
in config.json set:
"initial_transfer": true,
OS: Windows 10
Git Commit: newest | master | @ 4:20pm (GMT+12)
There should be a flag called --evolve-pokemon which enables automatic evolutions of Pokemon.
When the flag is active, whenever the player acquires enough candy to evolve a pokemon, it should evolve the highest CP pokemon. This can also be paired with --initial-evolve which iterates over all of the of the current pokemon and evolves any that can be evolved. The default for these two arguments should be False.
If a user has no pokeball of a type such as great balls, it should report 0.
The code will fault on the 'count' key missing as the item_id is present but not count with no inventory.
Log into the app trash all balls of a type
Start app when it tries to count the balls it will get:
Traceback (most recent call last):
File "pokecli.py", line 242, in <module>
main()
File "pokecli.py", line 230, in main
bot.start()
File "/Users/dmurphy/Desktop/PokeGo/dbmurphy-OpenPoGoBot/pokemongo_bot/__init__.py", line 55, in start
self._setup_api()
File "/Users/dmurphy/Desktop/PokeGo/dbmurphy-OpenPoGoBot/pokemongo_bot/__init__.py", line 225, in _setup_api
balls_stock = self.pokeball_inventory()
File "/Users/dmurphy/Desktop/PokeGo/dbmurphy-OpenPoGoBot/pokemongo_bot/__init__.py", line 307, in pokeball_inventory
item_count = int(item_data['count'])
KeyError: 'count'
This can be corrected by adding a check for the key just prior to using it.
OS: OSX
Git Commit: d130493
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.