Giter Site home page Giter Site logo

poketrainer's Introduction

Post-Unknown6 changes:

The current version of the bot currently requires the encrypt library. Hop on the #poketrainer slack to find out more.

Long story short, you need to make libencrypt.so or encrypt.dll by finding the c_code folder of one of the unknown6 repositories and running make clean; make. You then put the built files into the same folder as pokecli.py and run it with:

python pokecli.py -i ACCOUNT_INDEx -e YOUR_ENCRYPT_LIB_NAME_GOES_HERE.DLL.SO

Please do not sell the bot, or use it to sell accounts/power leveling or what have you. If you really can't help yourself from trying to make money on it, please donate a portion of your profits to Kiva.

To the people that have done so already (heard from quite a few already), thank you for making the world a better place.


DISCLAIMER: this is super sketch and just a proof of concept It's not that bad any more, but still, use at your own risk and I claim no credit or responsibility or what have you for parts of it.

For Contributions: Please open pull request to develop branch not master Thank you!

Don't be a dumbass too, Let's not ruin a good thing...


Build Status

Rename config.json.example to config.json

usage: pokecli.py [-h] [-i CONFIG_INDEX] [-l LOCATION] [-e ENCRYPT_LIB] [-d]

optional arguments:
  -h, --help            show this help message and exit
  -i CONFIG_INDEX, --config_index CONFIG_INDEX
                        Index of account in config.json
  -l LOCATION, --location LOCATION
                        Location
  -e ENCRYPT_LIB, --encrypt-lib ENCRYPT_LIB
                        encrypt lib, libencrypt.so/encrypt.dll
  -d, --debug           Debug Mode

Web UI


Configuration

Copy config.json.example to config.json and change your account information. Below the accounts you can change options in the default section. If you need to change some options for an individual account, you can copy them to the account section and modify as needed.

Configuration options (non-exhaustive)

  • BEHAVIOR section
    • USE_GOOGLE will enable google walking directions for navigation
      • You will probably need to provide an api key in GMAPS_API_KEY to avoid rate limits
    • STEP_SIZE corresponds to how many meters you want to move at most between server calls, set this around 4-6 for walking or 100-200 for really, really fast driving
    • WANDER_STEPS will set the distance a pokestop can be away before and still allow us to wander off the walk path. This allows you to get pokestops that aren't close to the sidewalk/road. If you don't set it we won't wander off the path.
    • EXPERIMENTAL will set the flag to use exeperimental features
    • SKIP_VISITED_FORT_DURATION [Experimental] Avoid a fort for a given number of seconds
      • Setting this to 500 means avoid a fort for 500 seconds before returning, (Should be higher than 300 to have any effect). This will let the bot explore a bigger area.
    • SPIN_ALL_FORTS [Experimental] will try to route using google maps(must have key) to all visible forts, if SKIP_VISITED_FORT_DURATION is set high enough, you may roam around forever.
  • CAPTURE
    • CATCH_POKEMON Allows you to disabling catching pokemon if you just want to mine for the forts for pokeballs
    • MIN_FAILED_ATTEMPTS_BEFORE_USING_BERRY minimum number of failed capture attempts before trying to use a Razz Berry (default: 3)
    • USE_POKEBALL_IF_PERCENT As long as using a pokeball would result in at least this percent of a chance to capture, use it (default: 50)
    • USE_GREATBALL_IF_PERCENT If using a pokeball wouldn't result in at least the above percent, use a greatball if the capture rate is above this percent (default: 50)
    • USE_ULTRABALL_IF_PERCENT If using a greatball wouldn't result in at least the above percent, use an ultraball if the capture rate is above this percent (default: 50)
    • USE_MASTERBALL Using a masterball should in theory automatically result in a capture. If set to true, attempt to use a masterball if none of the above percentages are met. If this is set to false and none of the above percentages are met, default back to an ultraball (default: false)
  • EGG_INCUBATION
    • ENABLE enables automatic use of incubators (default: true)
    • USE_DISPOSABLE_INCUBATORS enables use of disposable (3-times use) incubators (default: false)
    • BIG_EGGS_FIRST incubate big eggs (most km) first (default: true)
  • POKEMON_CLEANUP
    • TESTING_MODE Set this to true if you want to see what pokemon the configured release method would keep or release (no pokemon are harmed when this is on)
    • KEEP_POKEMON_NAMES Names of pokemon you want the bot to hold regardless of IV/CP
    • THROW_POKEMON_NAMES Names of pokemon you want the bot to throw away regardless of IV/CP
      • Note: MIN_SIMILAR_POKEMON will still be kept for all pokemon types
    • KEEP_POKEMON_MAX_COUNT default 9999. If you want to keep a certain type of pokemon but you accidently run into a nest? Don't worry this will make sure you only keep X amount of pokemon specified in KEEP_POKEMON__NAMES
    • RELEASE_METHOD = "CLASSIC", if you are unsure about the other methods you should stick to this one!
      • KEEP_CP_OVER Never transfer any pokemon above this CP, Setting this to 0 will never transfer anything
      • KEEP_IV_OVER Never transfer any pokemon above this C IV, Setting this to 0 will never transfer anything
    • RELEASE_METHOD = "DUPLICATES"
      • The bot will collect all pokemon it encounters , thus collecting a ton of bad ones and filling up space. Enabling this feature (disabled by default) will have the bot automatically transfer pokemon that are duplicates. To determine which pokemon to transfer when duplicates exist, the pokemons are compared according to the SCORE_METHOD setting. The bot will transfer the lowest scoring pokemon, maintaining MIN_SIMILAR_POKEMON of each type. To be completely confident that the bot will not transfer your high lvl pokemon, when this feature is enabled only pokemon with a score below RELEASE_DUPLICATES_MAX_SCORE are released. If you have multiple pokemon that are close to the same lvl the bot can be configured to not transfer them by using RELEASE_DUPLICATES_SCALAR. The value of this config is multiplied by the highest scoring pokemon of a type and only those pokemon that are less than the scaled score are transfered.
      • EXAMPlES: If you set SCORE_METHOD to "IV" while having two Snorlaxs, one with stats CP:14 IV:95 and the other with CP:1800 IV:30 the bot will transfer the Snorlax with CP of 1800 and keep the CP 14 Snorlax because you have indicated you only care about a pokemon's IV. It must be fully understood why this happens to avoid unwanted transfer of pokemon. If not used correctly this feature can very easily transfer a large ammount of your pokemon so please make sure you fully understand it's mechanics before attempting use!
    • RELEASE_METHOD = "ADVANCED", this method allows you to keep a minimum amount of pokemon basen on their CP or IV
      • ALWAYS_RELEASE_BELOW_LEVEL This will release all pokemon below a specified level, ignoring all below options. A pokemon level can range from 1-40 for all pokemon types. For reference you can check this table to see how much CP each pokemon will have on different levels. Using Level provides an easy way to filter bad pokemons across all pokemon types.
      • KEEP_CP_OVER Don't transfer any pokemon above this CP (this will apply no matter what you set in BEST_CP)
      • KEEP_IV_OVER Don't transfer any pokemon above this IV (this will apply no matter what you set in BEST_IV)
      • BEST_CP Additional options for keeping pokemon based on their CP
        • MIN_AMOUNT Minimum amount of pokemon to keep by CP
        • KEEP_ADDITIONAL_SCALAR The value of this config is multiplied by the highest CP pokemon of a type and only those pokemon that are less than the scaled score are transfered.
        • MAX_AMOUNT Maximum amount of pokemon to keep by CP
      • BEST_IV Additional options for keeping pokemon based on their IV
        • MIN_AMOUNT Minimum amount of pokemon to keep by IV
        • KEEP_ADDITIONAL_SCALAR The value of this config is multiplied by the highest IV pokemon of a type and only those pokemon that are less than the scaled score are transfered.
        • MAX_AMOUNT Maximum amount of pokemon to keep by IV
        • IGNORE_BELOW Pokemon with lover IV than this will be ignored by MIN_AMOUNT and KEEP_ADDITIONAL_SCALAR
    • RELEASE_METHOD = "MULTI", this method allows you to define different RELEASE_METHODs and configs for on a per pokemon basis
      • MULTI_DEFAULT_RELEASE_METHOD this is the default RELEASE_METHOD that will be used for pokemon that don't have an explicit override
      • RELEASE_METHOD_* configuration blocks can be provided here to override the values that come from POKEMON_CLEANUP => RELEASE_METHOD_* as the default values for the specific pokemon release method configurations
      • POKEMON_CONFIGS this is a mapping of pokemon name to configuration overrides for that pokemon
        • pokemon name this is a pokemon name in the set of valid names for KEEP_POKEMON_NAMES
          • RELEASE_METHOD this is required if the release method should be different from MULTI_DEFAULT_RELEASE_METHOD otherwise it will use default
          • RELEASE_METHOD_* settings in these configuration blocks will override defaults for the this specific pokemon name
    • SCORE_METHOD
      • A pokemon's score is an arbitrary and configurable parameter defines how to sort pokemon by best > worst to decide which one to keep first. Possible values are "CP", "IV", "CPxIV", or "CP+IV" or the special "FANCY" method.
      • The "FANCY" method uses the options a WEIGHT_IV and WEIGHT_LVL which give the ability to specifically set more weight on Lvl or IV. The formula is as follows: (iv / 100.0 * SCORE_WEIGHT_IV) + level / (player_level+1.5) * SCORE_WEIGHT_LVL where player_level+1.5 is the max level that pokemon can reach when fully powered up.
  • NEEDY_ITEM_FARMING [Experimental] will cease trying to catch pokemon and roam around to collect more pokeballs when inventory is low
    • ENABLE : Boolean, whether or not this feature is enabled
    • POKEBALL_FARM_THRESHOLD : Integer, when the observed pokeball count drops on or below this number, skip catching pokemon and begin collecting.
    • POKEBALL_CONTINUE_THRESHOLD: Integer, when the observed pokeball count reaches this amount, stop farming and go back to catching pokemon.
    • FARM_IGNORE_POKEBALL_COUNT: Boolean, Whether to include this ball in counting. Same goes for GREATBALL, ULTRABALL, and MASTERBALL. Masterball is ignored by default.
    • FARM_OVERRIDE_STEP_SIZE: Integer, When it goes into farming mode, the bot assumes this step size to potentially speed up resource gathering. This might lead to softbans. Setting to -1 disables this feature. Disabled by default for safety.
    • If EXPERIMENTAL OR CATCH_POKEMON are false, this configuration will disable itself.
  • CONSOLE_OUTPUT Options for configuring logging messages
    • COLORLOG A dictionary for the various modules that support colored logging. Currently this is implemented in the following modules: poketrainer, fort_walker, poke_catcher, release, evolve, and inventory. Use of red is discouraged since this is reserved for pokecli.py and error logging. Valid color options are as follows, shamelessly copied from the readme.md from colorlog.

      The following escape codes are made available for use in the format string:

      • {color}, fg_{color}, bg_{color}: Foreground and background colors.

      • bold, bold_{color}, fg_bold_{color}, bg_bold_{color}: Bold/bright colors.

      • reset: Clear all formatting (both foreground and background colors).

      • The availible color names are "black", "red", "green", "yellow", "blue", "purple", "cyan" and "white". Multiple escape codes can be used at once by joining them with commas. (ex. "black,bg_white")

There are more options, check the current config.json.example, many are self-explanatory.

Find out Item ID's

For Chosing what Items to keep, get the names here, AeonLucidProtos_ItemID For Choosing what pokemon to keep get the names here,AeonLucidProtos_Pokemon

Put them in config. Type exactly as the name appears

Requirements

Python 2 vs 3

Although this project was originally built for Python 2.7, we have recently added support for Python 3.5. However, our tools that allow web.py to talk with pokecli.py currently require them to run on the same version of Python. So, if you choose to use Python 3 for one of them, you must use it for both of them (and vice versa for Python 2).

keeping the code clean

If you make changes to the Python code, please use tox to run flake8 and isort checks against the code. If you see any errors, please fix them before opening a pull request.

To run tox, just install the package and run the tox command from the root directory of the project. tox will automatically install flake8 and isort packages into a virtual environment as needed when it runs.

pip install tox
tox

If you are not updating the Python code, you do not need to install or use tox.

pokecli with Docker (optional)

Build and run container:

cd poketrainer/
docker build -t pokecli .
docker run -ti --name poketrainer -v /path/to/poketrainer/config.json:/config.json -p 5000:5000 pokecli -i 0

The name option, poketrainer in the example, is arbirary. Multilple containers can be made using different names. -v maps the config file into the container. You can modify config.json and it will be reread when the container is started, no need to recreate the container or rebuild the image. -p maps the web interface to the external network, so you can check on the status of your training from a different machine. If you choose not to map the port, the ip address of the container can be found using docker inspect poketrainer.

The container is now running in the foregorund, and can be stopped by using Ctrl+C. The container can be detached using the sequence Ctrl+p Ctrl+q. To stop a container running in the background, run docker stop poketrainer and restart it using docker start poketrainer. This will start the docker container in the background, attach to it using 'docker attach poketrainer`.

You can create an alias for this by adding alias pokecli='docker start poketrainer && docker attach poketrainer' to ~/.bashrc.

What's working:

What's working:

  • A lot of things. Check out the example config to see some of the features. Catching Lured pokemon, sniping, regular pokemon, multiple kinds of navigation (google maps, walking, driving, customized speed), a web ui, auto transfers, auto evolves, auto power ups, auto egg incubation, inventory managament, multiple account botting. And much more, README to be updated soon.

Join slack channel:

To ask question related to api and general help, join Pokemon Go Reverse Engineering Slack team.

  • To join, get a invite from here , join team via the email you recieve and then signin here.

Credits

super sketch but yolo

poketrainer's People

Contributors

0x539 avatar albertonoys avatar azgul avatar bicheichane avatar dwayn avatar enjia2000 avatar fallenpixel avatar infinitewarp avatar j-e-k avatar jekirl avatar jmhummel avatar joshpalan avatar joychugh avatar mepsyduck avatar mikeres0 avatar mjuchli avatar myhorta avatar rahu1994 avatar rirze avatar samuelteixeiras avatar schwiftyfella avatar sftwninja avatar sontek avatar spamfarm avatar stolencatkarma avatar tejado avatar wesselvdv avatar xezero avatar yumere avatar zlokomatic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poketrainer's Issues

Feature: Prioritize certain nearby pokemon?

Hi,

Would it be possible to use Pokemongo-Map and prioritize certain pokemons over visiting forts etc?

For example, I'd like to prioritize capturing Eevee or Pidgeys over random enounters b/w walks to forts.

Additionally, a priority map across multiple pokemons can be considered i.e. Eevee more important than pidgey.

Finally, the ability to proritize new pokemons over ones we've already captured.

Feature Request: Cleaning the Pokebox

Often the bot fails to release pokemon so the pokebox fills up after some time.
A script for cleaning the pokebox would be helfpul.

Maybe it could exclude favourite pokemon from releasing.

releasing

I think the release response string has been changed

SSL Issue

Hi,

When I try to run pokecli.py I get the following error :

Traceback (most recent call last):
File "pokecli.py", line 136, in
main()
File "pokecli.py", line 122, in main
if not api.login(config.auth_service, config.username, config.password, config.cached):
File "/home/halfman/pgoapi/pgoapi/pgoapi.py", line 541, in login
if not self._auth_provider.login(username, password):
File "/home/halfman/pgoapi/pgoapi/auth_google.py", line 46, in login
login = perform_master_login(username, password, self.GOOGLE_LOGIN_ANDROID_ID)
File "/usr/local/lib/python2.7/dist-packages/gpsoauth/init.py", line 66, in perform_master_login
return _perform_auth_request(data)
File "/usr/local/lib/python2.7/dist-packages/gpsoauth/init.py", line 22, in _perform_auth_request
headers={'User-Agent': useragent})
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 111, in post
return request('post', url, data=data, json=json, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 57, in request
return session.request(method=method, url=url, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 585, in send
r = adapter.send(request, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 477, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

What can I do to fix this error? 😞

Thanks for your help and thanks for this awesome work 😄

IV's are not returned correctly in some cases

I've noticed that individual values for some pokemon are missing, it doesn't happen on regular basis - I'm trying to reproduce this behavior currently.

Most extreme example I've found, 681 CP squirtle:

{
          "inventory_item_data": {
            "pokemon_data": {
              "move_1": 237, 
              "move_2": 58, 
              "captured_cell_id": 5120525706110959616, 
              "pokeball": 1, 
              "pokemon_id": 7, 
              "creation_time_ms": 1469427905752, 
              "height_m": 0.5753034949302673, 
              "stamina_max": 66, 
              "weight_kg": 15.164803504943848, 
              "stamina": 66, 
              "individual_stamina": 3, 
              "cp": 681, 
              "id": 8584391223757014808
            }
          }, 
          "modified_timestamp_ms": 1469427905778
        }
Nickname: , Type: Squirtle, CP: 681, IV: 6.66666666667

that has only individual_stamina in data_dumps, which leaves him at 6.66% of max IVs. I'm afraid it may cause release of pokemon, just because the value is wrong.

Bag full bug

Seems like my pokemon bag is full despite the fact that most pokemon are under 400CP and yes I have set the threshold above this limit so surely the bot should at least be transferring the duplicates?

How to release evolved pokemon?

I figured out how to add zubat to the evolve cycle, but now I have inventory full of golbats.
How do I make it so it transfers the golbat?

Attempt_Catch may use Master ball or Great ball even if it't not present in inventory

    def attempt_catch(self, encounter_id, spawn_point_guid):
        for i in range(1,4):
            r = self.catch_pokemon(
                normalized_reticle_size= 1.950,
                pokeball = i,
                spin_modifier= 0.850,
                hit_pokemon=True,
                normalized_hit_position=1,
                encounter_id=encounter_id,
                spawn_point_guid=spawn_point_guid,
                ).call()['responses']['CATCH_POKEMON']
            if "status" in r:
                return r

1 - normal
2- great
3 - ultra
4 - master

This behavior may result in softban.

I can attempt to fix it.

Drop Pokeballs?

I see there's potion drops, but is there pokeball drops? It seems like the inventory would get full if the bot doesn't get rid of excess pokeballs.

Feature suggestion: Output pokemon list to csv for easy viewing/sorting

I actually tried to do it myself but I'm not very good at working with lists in python. I see that get_inventory_data() is handling the pokemon list output but I couldn't figure out how to parse it into a CSV.

This would be useful for quick glancing and if you use Excel to convert the CSV into a table you can do all kinds of things like sorting by IV, color coding certain pokemon, sorting by quantity, etc.

Improve Auto Evolve

When you have a bunch of candy for a bad pokemon, you might as well evolve it before xfer to more xp

Line 12 Error, when attempting to start bot

Upon trying to start the bot I am hit with this error:

  File "pokebot.py", line 12, in <module>
    import requests
ImportError: No module named requests

Any ideas? Thank you!

Setup Issue

Hey !
I edited the config.json as per my requirements . I changed the ACCOUNT_INDEX to 0 . Now the this the error I get. Please help me
screen shot 2016-07-21 at 6 55 08 pm

Web.py works but only displays starting location on map.

Based on the console output of web.py I'm assuming it's supposed to show pokemon, right?

I see:

127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/092.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/103.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/022.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/073.png HTTP/1.1" 304 -
....
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/055.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/108.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/095.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/044.png HTTP/1.1" 304 -
127.0.0.1 - - [25/Jul/2016 15:58:20] "GET /static/pokemon/018.png HTTP/1.1" 304 -
....

But it doesn't actually display on the map. Chrome's dev console shows several Failed to load resource: net::ERR_BLOCKED_BY_CLIENT errors. The bot is working so it can't be my gmaps key. And the web view shows my entire list of pokemon and my data, etc.

Running on 127.0.0.1:5000/MY_PERSONAL_USERNAME/pokemon

Issue running

I believe I got it all set up correctly, but when I try to run it I get:

Traceback (most recent call last):
  File "pokecli.py", line 136, in <module>
    main()
  File "pokecli.py", line 102, in main
    config = init_config()
  File "pokecli.py", line 64, in init_config
    load.update(json.load(data))
  File "C:\Python27\lib\json\__init__.py", line 291, in load
    **kw)
  File "C:\Python27\lib\json\__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\lib\json\decoder.py", line 380, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting object: line 28 column 6 (char 877)

Sometimes catch attempt may return NONE

pgoapi

 catch_attempt = self.attempt_catch(encounter_id,spawn_point_id)
                capture_status = catch_attempt['status']
                # if status == RpcEnum.CATCH_SUCCESS:
                if capture_status == 1:

its weird but the catch_attempt may be none sometimes. So the catch_attempt['status'] will give an exception.

Could it be bcause of ban:?

Can't start bot

I get this error when attempting to start the bot:

C:\Users\nhege\Desktop\pgoapi-master\pgoapi-master>python pokecli.py -i 0
Traceback (most recent call last):
File "pokecli.py", line 37, in
from pgoapi import PGoApi
File "C:\Users\nhege\Desktop\pgoapi-master\pgoapi-master\pgoapi__init__.py", line 18, in
from pgoapi.pgoapi import PGoApi
File "C:\Users\nhege\Desktop\pgoapi-master\pgoapi-master\pgoapi\pgoapi.py", line 36, in
from itertools import chain, imap
ImportError: cannot import name 'imap'

[Improvement] Too many logs in Info

Suggestion to change the log levels to debug for most of the items,
Add info logs such as
Catching "Pokemon Name"
Player Level:
Total Pokemon in Inventory:
..

Waypoints Error after location change

I get the following error after changing the location and rerunning the program:

2016-07-25 12:45:35,991 [ pokecli] [ERROR] Error in main loop, restarting {u'routes': [], u'status': u'ZERO_RESULTS', u'geocoded_waypoints': [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}], 'url': u'https://maps.googleapis.com/maps/api/directions/json?origin=51.519579%2C-0.134322&destination=51.525198%2C-0.143260&waypoints=optimize%3Atrue%7Cvia%3A51.525288%2C-0.126358%7Cvia%3A51.524355%2C-0.143666%7Cvia%3A51.523881%2C-0.143938%7Cvia%3A51.524716%2C-0.142696%7Cvia%3A51.515002%2C-0.143199%7Cvia%3A51.525088%2C-0.141352%7Cvia%3A51.524989%2C-0.127272%7Cvia%3A51.515281%2C-0.142858%7Cvia%3A51.524674%2C-0.141405%7Cvia%3A51.516110%2C-0.143549%7Cvia%3A51.522715%2C-0.143815%7Cvia%3A51.515013%2C-0.126555%7Cvia%3A51.523114%2C-0.143301%7Cvia%3A51.525073%2C-0.139856%7Cvia%3A51.523493%2C-0.142478%7Cvia%3A51.524675%2C-0.128186%7Cvia%3A51.515083%2C-0.127101%7Cvia%3A51.524802%2C-0.128563%7Cvia%3A51.525141%2C-0.139175&mode=walking&key=AIzaSyAewZptWM-itpbQPL6S3ttjR-BwU_wL-gE&units=metric&sensor=false'}

Exempt certain pokemon types from cleanup?

I think there should be the ability to exempt certain pokemon from the cleanup, regardless of cp/iv, like maybe you want it to not throw away a snorlax, or lapras, dragonite, etc. Perhaps similar to the list for evolutions? Something like that.

[ERROR] restarting 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(

2016-07-25 15:03:00,507 [ pokecli] [ INFO] Your given location: -
2016-07-25 15:03:00,509 [ pokecli] [ INFO] lat/long/alt: -
2016-07-25 15:03:00,519 [auth_google] [ INFO] Google login for:-
2016-07-25 15:03:01,204 [auth_google] [ INFO] Google Login successful.
2016-07-25 15:03:01,206 [ pgoapi] [ INFO] Starting RPC login sequence (app simulation)
2016-07-25 15:03:01,334 [ pgoapi] [ INFO] Finished RPC login sequence (app simulation)
2016-07-25 15:03:01,338 [ pgoapi] [ INFO] Login process completed
2016-07-25 15:03:01,486 [ pgoapi] [ INFO] Username:-, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run: 0
2016-07-25 15:03:01,753 [ pgoapi] [ INFO] Player Items: PokeBalls: -, GreatBalls: -, MasterBalls: -, UltraBalls: -
Potion: -, Super Potion:-, Max Potion-, Hyper Potion -
2016-07-25 15:03:01,859 [ pgoapi] [ INFO] Username:-, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run:-
2016-07-25 15:03:03,095 [ pgoapi] [ INFO] Walking to fort at http://maps.google.com/maps-
2016-07-25 15:03:03,269 [ pgoapi] [ INFO] Username:-, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run: -
2016-07-25 15:03:03,270 [ pgoapi] [ INFO] On my way to the next fort! :)
2016-07-25 15:03:04,776 [ pgoapi] [ INFO] No nearby pokemon
2016-07-25 15:03:04,867 [ pgoapi] [ INFO] Username: -, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run: -
2016-07-25 15:03:04,868 [ pgoapi] [ INFO] On my way to the next fort! :)
2016-07-25 15:03:06,068 [ pgoapi] [ INFO] No nearby pokemon
2016-07-25 15:03:06,158 [ pgoapi] [ INFO] Username: -, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run: -
2016-07-25 15:03:06,161 [ pgoapi] [ INFO] On my way to the next fort! :)
2016-07-25 15:03:07,346 [ pgoapi] [ INFO] No nearby pokemon
2016-07-25 15:03:10,484 [ pgoapi] [ INFO] Username: -, Currencies: POKECOIN: -,STARDUST: -, Pokemon Caught in this run: -
2016-07-25 15:03:10,500 [ pokecli] [ERROR] Error in main loop, restarting 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(128)

Fully Evolve Pokemon (if we can)

I wanted to open this up for discussion. On one of the projects that I found out was a rip off of this I had done some work where the bot would transfer low level duplicates of pokemon even if they were above the CP and IV limits. Reasoning was some players simply want as many unique pokemon as possible and not necessarily a bunch of the same that are all high level. Is this something that would be appreciated in this, even as a feature that is disabled by default?

Feature: Maximize Evolution Benefits

Given that pidgies take 12 pokemon to evolve, and it would take roughly 60 pidgeys to maximize the benefit from lucky eggs, ideally pgoapi should not discard or level up any pidgeys depending on the candies available.

For example I've got 10 pidgeys and 50 candies, then I should hold ceil(50/12) = 5 pidgeys and transfer 5.

A better forumation would be,
x pokemons of some class, evolving at m candies each while y candies are available.

Then number of pokemons to transfer = z, implies

x-z = ceil((y+z)/m)

or

(mx - y)/(m+1) >= z >= (m(x-1) -y)/(m+1)

Again taking the above example,

m = 12, x = 10, y = 50

=> (120 - 50)/13 >= z >= (108 - 50)/13
=> 5.38 >= z >= 4.46
Given z is integral.
Thus z = 5 and only 5 pidgeys should be discarded.

What's the new feature IV means?

I put 0100 or 01 for the percent?
and if the range of a pokemon's IV is 30%~80%, my IV value is 50%, will it be deleted?
also how you compares two pokemon's IV? like one is 80%~90%, and one is 20%~95%?

if CP is less than already captured pokemon then sent to professor

if CP is less than already captured pokemon then sent to professor

  • if i had a pidgey with 90 cp with me and you just caught a pidgey with 50 cp then it should send the recently caught one to professor.
  • currently it only supports a app wide cp filtering of some base value

some sort of code is provided on this reddit link, i hope its hepful:
https://www.reddit.com/r/pokemongodev/comments/4txy32/pokemon_go_bot_user_friendly_open_source/

Issues Building Docker Image

I am fairly new to using docker. When I try to build this I am getting the following error.

Collecting expiringdict==1.1.3 (from -r requirements.txt (line 10))
Downloading expiringdict-1.1.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-scv7w0vs/expiringdict/setup.py", line 2, in
import md5 # fix for "No module named _md5" error
ImportError: No module named 'md5'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-scv7w0vs/expiringdict/
INFO[0018] The command [/bin/sh -c pip install --no-cache-dir -r requirements.txt] returned a non-zero code: 1

python web client not working

data_dumps gets the file which is named after your email e.g. [email protected]

However the web client looks for username.json file

IOError: [Errno 2] No such file or directory: u'data_dumps/username.json'

simple fix would be to look for email instead of user

Bugs

Couple issues I'm having -

  1. The docker base image appears to be missing protobuf-compiler
    add to Dockerfile should fix that -> "RUN apt-get update && apt-get install protobuf-compiler"
  2. Protos bug? Probably from switching to Aeons

python pokecli.py -i 0

Traceback (most recent call last): File "./pokecli.py", line 37, in <module> from pgoapi import PGoApi File "/root/git/pgoapi/pgoapi/__init__.py", line 19, in <module> from pgoapi.pgoapi import PGoApi File "/root/git/pgoapi/pgoapi/pgoapi.py", line 43, in <module> from pgoapi.location import * File "/root/git/pgoapi/pgoapi/location.py", line 6, in <module> from protos.RpcEnum_pb2 import * ImportError: No module named RpcEnum_pb2

Looks good though other then these

Error in main loop: 'map_cells'

2016-07-21 15:52:24,328 [ pgoapi] [ INFO] sleeping before next heartbeat
2016-07-21 15:52:26,348 [ pgoapi] [ INFO] Create new request...
2016-07-21 15:52:26,348 [ pgoapi] [ INFO] Adding 'GET_MAP_OBJECTS' to RPC request including arguments
2016-07-21 15:52:26,348 [ pgoapi] [ INFO] Execution of RPC
2016-07-21 15:52:28,472 [ pgoapi] [ INFO] Cleanup of request!
2016-07-21 15:52:28,475 [ pgoapi] [ERROR] Error in main loop: 'map_cells'

Seems to happen occasionally after the script has been running for a while, and the script then hangs. Appears to be an issue with pgoapi.

Integrate webserver into the bot

I made a version using websocket to maintain realtime data on the html page (specially cool for the map, which I also changed to be with the pokemon go colors), but because the webserver is using the dump which is only created when we have the GET_INVENTORY, it doesn't feel realtime.

I'd suggest to move the web server into the bot and have the html page being static and downloading the data using Ajax/websocket.

What are your thoughts ?

Feature Request: CLI to interact with bot

Hi,

It would be great if one could interact w/ the bot over CLI, such as using certain items, ask bot to move to a certain location gradually etc

Would need a server client model with the cli connecting to the bot server over sockets maybe?

Docker container not working properly

pgoapi-master $ docker build -t pokecli .
Sending build context to Docker daemon 3.162 MB
Step 1 : FROM python:3-onbuild
[....]
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libprotobuf9 libprotoc9
The following NEW packages will be installed:
libprotobuf9 libprotoc9 protobuf-compiler
0 upgraded, 3 newly installed, 0 to remove and 7 not upgraded.
Need to get 709 kB of archives.
After this operation, 2522 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c apt-get update && apt-get install protobuf-compiler' returned a non-zero code: 1
pgoapi-master $ ls
Dockerfile MANIFEST.in config.json.example old-demo pokemon.en.json static
GAME_MASTER_POKEMON_v0_2.tsv README.md data_dumps pgoapi requirements.txt templates
LICENSE.txt compile_proto.sh examples pokecli.py setup.py web.py
pgoapi-master $ docker run pokecli
Unable to find image 'pokecli:latest' locally
Pulling repository docker.io/library/pokecli
docker: Error: image library/pokecli:latest not found.
See 'docker run --help'.
pgoapi-master $

Issue with web client: can't connect

Hello,
when I run the bot I'm having issues with the web client.
When I try to connect, the browser always gives the same "can't connect to the server" error.
The bot works well, so maybe I have some configuration problem.
Any suggestion?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.