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

Sleeper: pause for some time every day #2193

Merged
merged 4 commits into from
Aug 1, 2016

Conversation

johnbuluba
Copy link
Contributor

Short Description:
The bot is playing 24/7, this is not a normal user behavior. This worker pauses the bot every day for some time to simulate the user having some rest. The time and the duration is configurable from the config file, also a random offset is added for both values. Example of config entry:
`

{
     "type": "Sleeper",
     "config": {
       "time": "12:00",
       "duration":"5:30",
       "time_random_offset": "00:30",
       "duration_random_offset": "00:30"
     }
 }
 time: (HH:MM) local time that the bot should sleep
 duration: (HH:MM) the duration of sleep
 time_random_offset: (HH:MM) random offset of time that the sleep will start
                     for this example the possible start time is 11:30-12:30
 duration_random_offset: (HH:MM) random offset of duration of sleep
                     for this example the possible duration is 5:00-6:00

`
I made this to prevent detecting the bot and avoid ban, i hope you find it useful !

@solderzzc
Copy link
Contributor

lol, this is really funny :) @douglascamata @TheSavior

@TheSavior
Copy link
Contributor

For a first PR, this is great. Thanks for the quality, and I'm also very impressed that you wrote tests. I think this is the first worker that has tests (other than some helper logic for one of the navigators). Since this doesn't modify any other workers and just adds one, the barrier to merge is pretty low here.

Can we name it something more clear than just Sleeper? I'm concerned users won't be able to guess what this does just by seeing the name. Perhaps SleepSchedule?

@johnbuluba
Copy link
Contributor Author

Thanks a lot !
Yes maybe Sleeper is not clear enought... i will rename it asap !

@johnbuluba johnbuluba closed this Aug 1, 2016
@johnbuluba johnbuluba reopened this Aug 1, 2016
@johnbuluba
Copy link
Contributor Author

@TheSavior Its ready !

@TheSavior
Copy link
Contributor

TheSavior commented Aug 1, 2016

👍

Approved with PullApprove

@TheSavior TheSavior merged commit 589ada8 into PokemonGoF:dev Aug 1, 2016
@cwild
Copy link
Contributor

cwild commented Aug 1, 2016

Great work, I had been thinking about something similar and this looks like it will do just the trick!

@MZorzy
Copy link

MZorzy commented Aug 1, 2016

had to change
"type": "Sleeper",
to
"type": "SleepSchedule",
in config, but now in test

mhdasding added a commit to mhdasding/PokemonGo-Bot that referenced this pull request Aug 1, 2016
* dev: (21 commits)
  Use Default map_object_cache_time if not specified
  Request meta cell data once every 5 seconds (PokemonGoF#2171)
  Change FortID to FortName (PokemonGoF#2249)
  Let the user know that the maps api key exceeded its limits. (PokemonGoF#1989)
  fixed pokemon transfer so that "keep_best_*" filters can work again without requiring to be combined with "release_below_*" rules (PokemonGoF#2215)
  Using the logger instead of print in EvolveAll
  Remove MoveToFort from the FollowPath example config (PokemonGoF#2203)
  Removing nickname pokemon from the example config
  Adding a SleepSchedule worker.  Pause for some time every day (PokemonGoF#2193)
  Added nickname worker (PokemonGoF#1850)
  Moving evolve_cp_min to be a task level configuration
  Moving evolve_all to be a task level configuration
  Moving item_filter to be a task level configuration
  Fix incorrect config value for HandleSoftban. (PokemonGoF#2191)
  Better enforce rules about Pokemons to retain. (PokemonGoF#2073)
  This should fix issue: (PokemonGoF#2185)
  Revert "Adding an Anyball item to the release config" (PokemonGoF#2166)
  removed wrong log (PokemonGoF#2160)
  Adding an Anyball item to the release config (PokemonGoF#2140)
  Cluster Selection so it doesn't jump from cluster to cluster (PokemonGoF#2153)
  ...
solderzzc added a commit that referenced this pull request Aug 6, 2016
* [BUGFIX] Catch Pokemon while walking to fort (#979)

Resolves: #821

* Added IGNORED_FILES list to pylint-recursive.py (#923)

* Fixed a bug where the bot crashed if 'catch' or 'release' wasn't specified in config.json

* Added install.sh and run.sh

* Added IGNORED_FILES list to pylint-recursive.py

* Removed --item_filter argument from pokecli

Removed due to 'complexity' of new item_filter, therefore it should only
be in config.json

* Fix the teleporting on web ui (#1074)

* Update README.md (#1063)

The plural of pokemon is pokemon.

* Broken connection fix (#1071)

* Broken connection fix

* Typos fix

* Forgot to load itemfilter after deleting args input

* Update README with Docker instructions (#759)

* Add metrics logging and output on close (#1059)

* Add metrics logging and output on close

Output looks like the following:

[17:10:07] Exiting PokemonGo Bot
[17:10:07]
[17:10:07] Ran for 0:00:20
[17:10:07] Total XP Earned: 210 Averaging: 36534.47/h
[17:10:07] Travelled 0.01km
[17:10:07] Visited 0 stops
[17:10:07] Encountered 1 pokemon, 1 caught, 0 released, 0 evolved, 0
never seen before
[17:10:07] Threw 1 pokeball
[17:10:07] Earned 100 Stardust
[17:10:07]
[17:10:07] Highest CP Pokemon: Nidoran M [CP: 75] [IV: 1/10/5]
Potential: 0.36
[17:10:07] Most Perfect Pokemon: Nidoran M [CP: 75] [IV: 1/10/5]
Potential: 0.36

* Added Metrics class to collect end of run stats

Tried to come up with a reasonable division of labour for how to gather
the information.

Open to feedback!

* Revert logging changes

Didn’t mean to affect this message any more.

* Merge cells together to avoid staying in one cell too long (#1061)

* Merge cells together to avoid staying in one cell too long

This should help mitigate the issue where the bot travels to a stop
that is farther than a nearby one because the nearer one is in another
cell.

I also release control back to the make loop after catching any pokemon.

* PR Feedback fixes

+ Add concatenation of nearby cells rather than override.
~ Actually call the SeenFortWorker rather than just reference it.

* Don't make work a property

I seem to have made it one at some point, somehow… Go PyCharm!

* Add check to ensure there are available gyms

* Refactor EvolveAll and InitialTransfer workers (#941)

* Refactor EvolveAll and InitialTransfer workers

* Fixing Item import

* Fixed 'Pokemon will now be caught from lures' (#1072)

* Set evolve speed in config (#1090)

* added evolve_speed

* updated README.md to include evolve_speed

* when filter set to 0, it will failed (#1101)

* fixing item_list not found (#1120)

* Fix Location caching doesn't work (#1031) (#1100)

* Update _get_catch_config in pokemon_catch_worker (#1124)

It should return the setting given by "any" in the catch_config file, instead of return {} for a "unspecified" pokemon.

* unhappy api parameter name (#1137)

* Making the metrics be printed correctly at the end of the run (#1136)

* REVERT #1072

* FIX REVERTED #1072

* Moving logic for catching the visible pokemon out into a new worker (#1142)

* Dump cells to enable custom front-end functionalities (#1145)

* Dump cells to enable custom front-end functionalities

Fixed merge issues for #1019

It now dumps the cell list as a json into data/cells-$username.json, so
that more front-ends can use this information (I'm working on a
Kivy-based one).

* Updated ignore file skip new cellfiles

* Adding a WorkerResult and the MoveToFortWorker only takes a single step towards a fort (#1146)

* RecycleItemWorker implemented (runs on every tick) (#1156)

* RecycleItemWorker implemented (runs on every tick)

* moved RecycleItemWorker to a better place

* recycle item worker logging improved

* simplify if in item_inventory_count

* removing extra space

* Moving these flags into the workers. Make them run on each tick (#1159)

* Removing duplicated release logic from catching pokemon (#1160)

* Updated readme, contributors and gitignore file (#1161)

* moved most of readme stuff to wiki in order for a clean readme table
* added myself to contributors at last
* removed old files from gitignore file

* More items info at start (#1167)

* Update __init__.py

* Update pokemon_catch_worker.py

* Update CONTRIBUTORS.md

* removing modules that cant be imported (#1165)

* removing modules that cant be imported

* Updated pylint check

It wont exit incorrect if no error exists

* Fixing logspam for transferring pokemon (#1164)

* Removing unnecessary walking from the move to fort worker (#1166)

* Removed logging (#1171)

Should not logg when logging is done once it finds something to release

* Removing logging wrapping cleaning up the pokemon bag (#1172)

* Revert "Removing duplicated release logic from catching pokemon" (#1188)

* Hotfix/walk to pokestop and refactor to walker (#1193)

* some nice refactoring to StepWalker to avoid repetition

* removing sleep in navigator (bot should only sleep after walk and in workers)

* fixing walk to pokestop

* removing personal debug log from step walker

* removing empty line

* added random_lat_long_delta again to StepWalker (my bad)

* completely removed walking progress bar (log trimming is required)

* better log color when exchanging pokemon (red)

* less sleep after spinning pokestop

* spiral navigator shouldn't reuse step walker instance

* Reduce number of inventory calls (#1231)

There’s way too many API calls for the inventory, so I added a coached
response that’s used until someone invalidates it (like when
catching/throwing and spinning stops)

* Add missing inventory fetch (#1233)

To recycle an item with the correct number, we should force fetch from
the server.

* API update fixes (i2f etc) and lured pokemon catching  (#1163)

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* API update fixes (i2f etc) and lured pokemon catching

* Fix PogoAPI to a recent commit

* Fix PogoAPI to a recent commit

* Fix PogoAPI to a recent commit

* Fix PogoAPI to a recent commit

* Fix PogoAPI to a recent commit

* Added missing method

* Various bugfixes

* Various bugfixes

* Various bugfixes

* Various bugfixes

* Merging with recent commits

* Restored RecycleItemsWorker call

* Merged with latest commit

* Fixed arguments in method call

* Only work on forts when there is space in the bag. Do not switch mode (#1237)

* config parsing clean-ups (#1240)

* Update the location & location_cache logic (#1217)

Previously, the location_cache can't be used, even people set location_cache to TRUE. Everytime, it starts from the initial position.

Now the bot check the initial position first. 
Then check if people set location_cache. If so, read it and update it, otherwise use the initial location.
If there is no initial location and no location cache, print msg and exit.

* optimize docker usage (#1257)

* update Dockerfile; install missed python-protobuf package; add CMD as a way of defining default arguments for the ENTRYPOINT

* remove CMD command, default config parameter is also set in pokecli.py

* Only catch things that inherit from Exception. Try to prevent KeyboardError from being swallowed. (#1270)

* seperate worker for transfering pokemons to professor (#1281)

pulled out initial transfer and transfer on catched pokemon to seperate
worker

* Revert "Transfer poke worker" (#1284)

* Added GA in the README.me on dev branch first.

* Revert "Added GA in the README.me on dev branch first."

This reverts commit 90a17c0.

* adding random delay between pokemon capture & transfer. #774 (#1225)

* adding random delay between pokemon capture & transfer. #774

* improved fix for #774 by adding click_action_delay function

* wait time minimum & maximum are passed in from the config now

* updated readme & contributors files

* updated how action wait times are loaded from config

* optimize docker usage (#1257)

* update Dockerfile; install missed python-protobuf package; add CMD as a way of defining default arguments for the ENTRYPOINT

* remove CMD command, default config parameter is also set in pokecli.py

* Removed erroneous line in human_behavior and corrected bad merge resolution

* updated configs & changed function name to action_delay

* Fixed seperate transfer bug in worker (#1286)

* seperate worker for transfering pokemons to professor

pulled out initial transfer and transfer on catched pokemon to seperate
worker

* Fixed bug where config parameters wasnt checked

* Initial_transfer renamed to release_pokemons

Also updated the configuration argument

function to release pokemon runs on tick method which is called after
everyt small step the bot takes

* added back exception which was missing

* Default conf value and fixed typo

* fixed typo for pokemon and updated config
* added default value if its missing from conf

NOTE: transfer conditions are set by "release" parameters in config,
however we keep the highest CP of each pokemon, just to be sure we don't
empty the bag.

* Capital leter

* missed to rename on some places

Also enabled loggning to easier see why a certain pokemon may not be
transfered to professor for candy

* Log format update

* moved runtime error to evolved_capture statement

workaround if anyone should get it...

fixing it in future

* Anonymous login succ/failed/relogin/logout info to GA. (#1312)

* There's a big warning before bot login and 2s wait for exit if the health report is turned on.
Anonymous login succ/failed/relogin/logout info without any user account info will be sent to GA.
The function is not called to wait Signal system merge.

* Fixed page view is not true.

* Removed [x] since we ditched it.

* Refactoring get_nearest_fort code

* Update README.md

* Replacing config.mode with capture_pokemon and spin_forts

* Removed the GA.

* Revert "Removed the GA."

This reverts commit 58d7a67.

* Allow to keep stronger pokemon (#1302)

* Allow to keep stronger pokemon. It is woring both with CP and IV

* Remove not needed code

* Add example of keep_best_iv into configuration

* Add delay before pokemon transfering

* Resolve merge conflicts

* Use config.release_pokemon to determine should we release pokemon or not

* Fix a bug

* Update config.json.example (#1340)

Update config.json.example 4c46ad7

* Adding the new flags to the config.json example files (#1344)

* Add Mr. Mime to config.json.pokemons.example (#1350)

Add Mr. Mime to configs/config.json.pokemons.example

* Refactoring code into a SpinNearestFortWorker (#1351)

* Removing CatchVisiblePokemonWorker's argument of cell (#1352)

* Iterate over each worker and treat them the same (#1356)

* Fix merge conflicts that caused bugs (#1361)

* Merging some unnecessary methods and renaming take_step on the bot to… (#1360)

* Merging some unnecessary methods and renaming take_step on the bot to tick

* Merging variable definition

* Use a more human friendly time format (#1364)

* fixed transfer worker api crash (#1369)

* fixed transfer worker api crash

try catch exception to prevent bot from crashing

* better cach error method

* prevent call __getitem__ on bool error (#1355)

* prevent call __getitem__ on bool error

* fix for pr

* update sample config to solve bug (#1392)

buggy:
"catch_above_cp": 0, "catch_above_iv": 0.8, "logic": "and"
replaced:
"always_catch": true

* Added worker for incubating eggs (#1404)

* Added worker for incubating eggs

* Added options to configuration

* Bugfix

* Ignoring used eggs and incubators

* Using cached inventory instead of getting a fresh copy

* Implement proper version of keep_best option (#1395)

* Implement proper version of keep_best option

* Fix order of pokemons

* Change formatting

* Display kept pokemons, to be sure that it is working ok

* Don't print same info again and again

* Remove other worker using

* Get back spacing format

* Catch transfer worker error (#1423)

* fixed transfer worker api crash

try catch exception to prevent bot from crashing

* better cach error method

* Fix for clash between CLI and JSON args (#1420)

* makes spin forts and catch pokemon config in json not being overwritten by default cli args value if user dont provide cli args

* huge fix to how cli and json parameters are loaded

The CLI parameter parser now uses JSON-loaded parameters as first
fallback to missing parameters. The second fallback to missing
parameters are the default values previously used.

This is the perfect handling for making CLI args override JSON
configuration only for provided args. Non-provided args that are not
found in are set to the default value we think most users are going to
like.

* overriding config from loaded JSON is not necessary here anymore

* trying to fix the auth_service parameters

* add mixing cli args fixes that were forgotten

* fixing unicode load in location

* refactoring parameter configuration to avoid mistakes

* changed the order of functions in pokecli.py to follow some guidelines

main function comes first all all its children below

* small fix to evolve_cp_min

* text when pokemon is released improved

* Adding a message in the Readme about not supporting gym battles (#1453)

* Pokemon plural (#1477)

* Fix pokemon plural

* Delte old pokemon file

* [FEATURE] Api Wrapper to handle connection issues (#1459)

* add an api wrapper managing (trying to) handle connections error, needs more testing

* refine error testing

* import fix

* sleep less, lazy bum

* change retry parameter as an optional argument

* Magikarp twice in release block (#1486)

* Fix typo in filename (#1494)

* Add name to CONTRIBUTORS

* Add name to CONTRIBUTORS

* Fix typo in catch_visible_pokemon_worker filename

* Add missing renamed catch_visible_pokemon_worker to repository

* [Bug fixes] Further checking for the api wrapper response (#1499)

* further checking for the api response

* make sure to pop the request_callers field first

* comment

* new PolylineWalker(StepWalker) - [was #990] (#1467)

* new PolylineWalker(StepWalker)

Refactoring in the context of the new walker/navigator concept

Fixes:
-  PolylineWalker class renamed to Polyline
-  new class PolylineWalker(StepWalker)
-  change few tests

* fixed imports

* Added further release functionality (#1472)

* Added functionality to keep Pokemons based on IV and CP at the same time.

* Fixed example config and _validate_keep_best_config

* Added secondary criteria IV when CP is equal and the contrasting case.

* Removed unused import

* Use type unicode for argument location (#1503)

* Use type unicode for argument location

Fix for issue with invalid <lambda> value for location argument, e.g.: invalid <lambda> value: u'Pra\xe7a' when it contains special characters like "ç".

* Parse location for both command line and json

Will now correctly parse location both from command line and JSON file.

* Better naming for function to parse unicode str

* Added circle avoidance (#1515)

* Added circle avoidance

* Changed to add_config

* Changed path to recent_forts.
Put config keys into spin_forts key

* cp_min -> evolve_cp_min in config.json.example

* Update README.md

* annoying bug (#1559)

Added if try_cnt > 1: to remove the annoying count in logs due to server latency
or something
The response that comes back is "52" from api.

* Throttling api requests. Reverting log change (#1562)

* Egg incubation improvements (#1526)

* Moved egg hatching to incubation worker, added feedback for users

* old response handling and updated readme

* Fix evolve_all and use_lucky_egg (#1541)

Fixed issues where evolve_all would not run.  Also fixed use_lucky_egg
so that it only runs on the first tick.  Refactored so the
EvolveAllWorker._should_run function requires less logic (optimization)

* Event system for logs and web socket communication (#1523)

* Event system implementation

* some web socket work

* refactored the event system for clean ups

* added socketio_client to requirements

* let's not run event system setup yet and remove some tests

* add possibility to set the event level in event system

* some event system examples as comments

* fixed handler and rudimentary version of real logging handler

* better logging

* fixing type in example about emitting events

* added host and port configuration for websocket server instead of hardcoding them

* added flask to requirements.txt

* Revert "Egg incubation improvements" (#1565)

* Reduce log spam when moving towards forts (#1566)

* Fixed import error in api_wrapper (#1561)

* Moved egg hatching to incubation worker, added feedback for users (#1568)

* Refactoring function to get forts (#1578)

* Refactoring function to get forts

* Optionally sort by distance

* Update pokemon_transfer_worker.py (#1571)

* Update pokemon_transfer_worker.py

Grammer correction.

* Update pokemon_transfer_worker.py

* adding support for embedded config keys and fixing circle prevention

* CatchVisiblePokemonWorker now catches pokemon from lures (#1591)

* CatchVisiblePokemonWorker catches from lures

* Fix typos

* Allow worker order to be more easily customised in future with PokemonGoBot (#1600)

* Make SeenFortWorker top level (#1601)

* CatchVisiblePokemonWorker catches from lures

* Pull out SpinNearestFort into its own top level worker. Remove pokemon catching behavior

* Removing unused reference

* Moving MoveToFort to the top level (#1605)

* Moving MoveToFort to the top level

* Fixing bad import

* Consolidate similar meaning configuration keys properly inside another key (#1590)

* adding support for embedded config keys and fixing circle prevention

* forgot to fix this config

* refactor nested config system to support flag likes `--forts.something.anything`

This example `--forts.something.anything` would be parsed as
`config.forts_something_anything`. And in the JSON config it should be
like this:

```
‘forts’: {
    ‘something’: {
        ‘anything’: 1
    }
}
```

* add fix_nested_config(config) call

* update missing usage of `config.avoid_circles` -> `config.forts_avoid_circles`

* removed pdb, sorry

* fixing buggy merge, i'm sorry

* one last fix to nested config for fort spinning

* other small fix to nested config

* Fixed args PolylineWalker to match the super StepWalker class (#1621)

* * Removed pokemongo_bot/polyline_stepper.py - old Stepper() class
* Fixed args PolylineWalker to match the super StepWalker class
* Added a check to Polynine() point tinitalization, if no route was
  found then, we will return no points between orig, dest thus will
  walk in straight line - expected behaviour will teleport in small
  steps

* * fix typo

* "evolve_captured" is now using a list instead of a boolean (#1532)

* "evolve_captured" is now using a list instead of a boolean, working the same way as "evolve_all"

* parse error with format details when "evolve_captured" is not a string, or is the string "true" or "false"

* Extract CatchLuredPokemonWorker from PokemonCatchWorker and improved worker order (#1627)

* extracted lure catch worker from pokemon catch

* removing information less logs

* little refactoring to catch lured pokemon worker

* Fix 'with' statement mistakes (#1641)

* Update catch_visible_pokemon_worker.py

* Update __init__.py

* using get_cell_ids from pgoapi package

* trying to fix annoying log

* ok, I give up on log organisation

* Randomize `normalized_reticle_size` and `spin_modifier` parameter for `catch_pokemon` api (#1205)

* the MoveToFortWorker should always go to the nearest fort (#1666)

* Fix transfer worker not triggered for last pokemon (#1664)

* Making the SpiralNavigator a worker (#1683)

* Making the SpiralNavigator a worker

* Passing pylint

* Passing linter

* fixes Polyline class to handle a case in which google is returning only one point (#1674)

* Fixes:

https://github.com/th3w4y/PokemonGo-Bot/issues/27

* Fixes:
PolylineStepWalker walks for only one seconds #28
https://github.com/th3w4y/PokemonGo-Bot/issues/28

by adding a while destination nat reached loop

* fixes typo

* Revert "Making the SpiralNavigator a worker" (#1698)

* feat: show xp after catching pokemons (#1700)

* Update config.json.pokemon.example (#1711)

config.json.pokemon.example was missing several fields present in config.json.example

* Huge clean-up: PEP8, sort imports, remove deprecated and unused imports (#1697)

* SoftBan Worker (#1724)

* created a softban worker

* only delete key from dict if it is there

* pep8 stuff

* Improve docker usage; use docker-compose for starting the PokemonGo-Bot ecosystem (#1669)

* update Dockerfile; install missed python-protobuf package; add CMD as a way of defining default arguments for the ENTRYPOINT

* remove CMD command, default config parameter is also set in pokecli.py

* improve docker usage; add single container run for the webUI; add docker-compose.yml for starting the bot ecosystem with one command

* fix "How to run with Docker" link

* fix timezone setting: send timezone arg to the docker image build process, e.g. "docker build --build-arg timezone=Europe/Berlin -t pokemongo-bot ."

* adding a duplicate of SeenFortWorker before MoveToFortWorker

this ensures we interact with forts while we are moving to other forts

* Show Pokestop names (#1671)

* Restore the ability for a user to see Pokestop names. Default to off.

* Use the add_config function for forts.show_name (now default to true)

* Move fort_details function into cell_workers init module

* Forgot to pass bot reference

* Catching lured pokemon should use same fort_details API

* REmove config option. Always show Pokestop name.

* Move away from KeyError handling as per TheSaviour's suggestion

* fixing wrong import

* No longer caching things on the worker. Pulling straight from the bot instance (#1747)

* Creating an instance of the workers only on startup (#1750)

* Don't try to release pokemons in forts (#1751)

* * Always report session summary even on crash (#1759)

* Prevent crash checking session (#1754)

* Prevent crash when check session

* Fix function call

* [FIX] use_lucky_egg (#1774)

Changes to the tick_count caused the use_lucky_egg to not run.  Since
the tick_count is incremented prior to running the workers, the
tick_count will be 1 on the first tick

* add a flag to enable user to choose if he wants to walk to spin forts (#1772)

* add a flag to enable user to choose if he wants to walk to spin forts that are far away

* updated config example

* Display Fort Name instead of Fort ID in Log (#1801)

Displays the fort name in the CLI instead of the fort id.

Easier to read, better to look at than a hash.

* Update incubate_eggs_worker.py (#1862)

Fix: variable 'pokemon_data' referenced before assignment

* Improved some code formatting & fixed unicode issue with the logger. (#1839)

* Improved some code formatting & fixed unicode issue with the logger.

* Corrected formatting of log method & improved formatting of spiral_navigator.py

* Upgrade the capture logic for VIP pokemons! (#1807)

* This fix a small bug when user didn't update their config file for VIP setting (#1874)

* [FEATURE] Path Navigator (#1457)

Adds a navigator that walks along specified points.

* fixing a typo that causes a NameError exception (#1898)

* Adding a TreeConfigBuilder and tests (#1901)

* Adding a TreeConfigBuilder and tests

* Adding mock to the requirements

* not actually using mock or patch

* Egg Incubation - IV fix and UnboundLocalError fix (#1777)

* fixes for ivs and bad var

* Custom response/early return for error

* added check for blank ids

* added temp lists for duplication mitigation

* Removing Worker suffix on workers (#1914)

* Renaming more workers to make grammatical sense (#1915)

* Improved Path Navigator, Now Supports geopositioning resolution (#1917)

* Refactored Path Navigator, now supports geopositioning resolution

* Update path example config, for new format

* Fixed typo in dict

* Fixed Ref

* Possibility to set another config with run script (#1899)

* Location cache check. If start position differs, don't use the cache. (#1932)

* Making the navigators workers (#1933)

* Adding the navigator to the list of workers (#1950)

* Updated item_filter in config.json.example to use item names instead item id's (#1733)

* Updated item_filter in config.json.example to use item names instead of item id's

* Config.json item_list verification

* Merge remote-tracking branch 'upstream/dev' into dev

Conflicts:
	pokemongo_bot/cell_workers/recycle_items.py

* Adding recycle_items back
Changed error return type

* Configure the tasks from config.json (#1956)

* Configure the tasks from config.json

* Linking error to wiki

* Removing config for catch_pokemon (#1963)

* Loop over an array of old flags (#1964)

* Removing config forts_spin

* Removing hatch_eggs from config

* One more for hatch_eggs

* Removing config for release_pokemon

* One more for release_pokemon

* Removing config for softban_fix

* Removing config for forts.spin

* Removing config for forts.move_to_spin

* Supporting task level configuration (#1979)

* Supporting task level configuration

* Updating sample config files

* Providing example of how to configure tasks in the example configs

* Adding a task base class (#1983)

* Re-enable item ID's in the item_filter. (#1986)

* Allows users to enter both item ID's and item names in the item_filter.

* no message

* Allow to collect level up rewards (#2004)

* Foundation for remote control of the bot over websocket (#2000)

* improved websocket and logging handler

* added support for remote command execution through websocket and a player_info call example

* adding a missing variable

* only execute remote command if it exists and is callable, else return command not found

* wait forever instead of 5 secs in an infinite loop

* Tasks now extend a base task (#2007)

* Moving evolve_speed to task configuration

* Moving use_lucky_egg to be a task configuration

* Fixing bug in evolve all. Fixes #2019

* Removing unused navigator switch

* Avoid transferring favorite pokemons (#2038)

* Move follow path task config (#2044)

* Refactor (#1587)

* fixing `.get` call (closes #2082)

* Log location as a str (#1825)

We already have location as an encoded str in location_str and most calls to log pass a string as argument, so this is a bit more consistent.

* Update README.md

* Giving errors when specifying navigator cli arguments (#2126)

* [DEV FEATURE] Test framework .... beginning (#1682)

* add mock and nose to the dependencies

* added unit tests for the api_wrapper

* add testing to travis build

* fixing path ?

* pylint error fixed

* adding myself to contributors

* add test for the step_walker

* add runtime error for big distances

* change travis, nosetests should look for tests in all the folders

* Getting rid of nose, rename some files, add 'timeout_decorator' to the requirements

* update travis.yml

* changed run_tests script from bash file to python file

* revert file changes

* skipping failing test

* fix another test

* some style/import improvment

* revert SKIP_TIMEOUT

* remove run_tests.py

* move tests cases into main test folder

* refactor some code api_wrapper_test

* refactor and location parser

* test is failing add a FIXME tag

* location is now unicode friendly

* Fix throw type always normal when trying to catch pokemon (#2130)

* Warns if there aren't sufficient space left for loot. (#2137)

* Warns if there aren't sufficient space left for loot.

SpinFort will terminate silently, and users will not notice
that SpinFort is skipping due to the lack of space.

As a result, it sends out requests to Niantic even faster than before
becuase tasks are looping faster and doing noops. More server busy (error 52)
errors appear in the log without an explanation of what's actually
going on.

* improve readability of should_run for SpinFort and MoveToFort

* [Feature] Detect maximum cluster and move (#1993)

* adapted to new commits

* added config
changed gitignore

* added config

* locked versions

* typo

* account for task management change

* moved find_cluster to utils. follow_cluster now 1 task

* added test for follow_cluster

* added mock requirements

* trying to get travis to build

* trying to get travis to build

* added search for lured cluster functionality

* adapted tests

* removed double specification

* only use berries on VIP pokemon if catch rate is less than 90% #2135 (#2138)

* [FIX-Config] 'use_lucky_egg' should not be true in the exmple config file (#2105)

* Update README.md

* Added check for valid keep_best_iv amount (#2150)

* Cluster Selection so it doesn't jump from cluster to cluster (#2153)

* added secondary criteria so it doesn't jump from cluster to cluster when they're equally large

* added secondary criteria so it doesn't jump from cluster to cluster when they're equally large

* updated cluster example

* Adding an Anyball item to the release config (#2140)

Adding an Anyball item to the release config

* removed wrong log (#2160)

* Revert "Adding an Anyball item to the release config" (#2166)

* This should fix issue: (#2185)

MoveToFort(self.bot).work()
TypeError: __init__() takes exactly 3 arguments (2 given)

* Better enforce rules about Pokemons to retain. (#2073)

Rules about maximum CP and IV to transfer Pokemons are applied
also when keeping the best ones.

* Fix incorrect config value for HandleSoftban. (#2191)

* Moving item_filter to be a task level configuration

* Moving evolve_all to be a task level configuration

* Moving evolve_cp_min to be a task level configuration

* Added nickname worker (#1850)

* Adding a SleepSchedule worker.  Pause for some time every day (#2193)

* Added Sleeper worker

* changed Sleep worker name to SleepSchedule

* fixed wrong import names

* changed name in log

* Removing nickname pokemon from the example config

* Remove MoveToFort from the FollowPath example config (#2203)

FollowPath will not work properly while also using MoveToFort.

* Using the logger instead of print in EvolveAll

* fixed pokemon transfer so that "keep_best_*" filters can work again without requiring to be combined with "release_below_*" rules (#2215)

* Let the user know that the maps api key exceeded its limits. (#1989)

* Change FortID to FortName (#2249)

Making it more human readable. I did not test this change, just used the same field from movetofort line 41 and spin fort line 33.

* Request meta cell data once every 5 seconds (#2171)

This solve the Niantic "scan for pokemon" throttling without
making the bot very slow.

* Use Default map_object_cache_time if not specified

* Change egg hatching text (#2258)

* [FIX] Improper use of exception  (#2246)

* adapted improper exception use

* beautified

* fixed logic error

* Add optional simple lure attraction feature (#2257)

* Add lure attraction params in default config

* Update CONTRIBUTORS.md

* Add simple lure attraction feature (move2fort)

* Update move_to_fort.py

* Dev - Fixed the loss of fort data (updated) (#2269)

* Keep fort data even if the server returns no fort data. Also replaced redundant code.

* Making sure we only save fort data if the server returned multiple forts.

* Update web to latest master commit (#2274)

The current dev commit has an issue where it doesn’t show the number of
candies.

* Add missing curly bracket (#2282)

Added missing curly bracket to tasks>MoveToFort>config

* added param in config.json.pokemon.example.

* web submodule updated to latest commit (#2289)

* Modify SpiralTask to use 70m as stepsize and diameter as step_count (#2194)

* Lowered the stepsize in Spiral navigator to more accurate 70m

* Moved max_steps to task configuration and changed it to diameter

* Added diameter to configuration example

* Bugfix

* Removed max_steps from cli

* Added max_steps as legacy configuration

* Made step size of follow_spiral more configureable

* Changed default value for diameter

* This is just a temp fix, The one added the configure param need make sure it's really work.

* Fix instance where evolve_all is unicode - fixes #2281 (#2305)

* Fix instance where evolve_all is unicode

* Test for isinstance basestring rather than Unicode || str

* [Feature] added keep pokemon for batch evolution (#2255)

* added keep_for_evo

* accounted for non evolable pokemon

* additional logging

* additional logging

* moved get_candies to utils

* disregard 2nd stage evolution pokemon

* added sample configs

* Supporting sending requests through an HTTP proxy (#2358)

* Added proxy support

Added proxy support from config.json and command line. with parameters:

-prxip | --proxy_ip  or proxy_ip from config.json for ipv4 format as string "aaa.bbb.ccc.ddd"

-prxp| --proxy_port or proxy_por from config.json as int from 1 to 65536.

* Added proxy support

Added two additional parameters (proxy_ip and proxy_port) to add support for proxy.

proxy_ip must be as string of ipv4 format: "aaa.bbb.ccc.ddd" , proxy_port must be a int from 1 to 65536, if proxy_ip is null or set to "" and proxy port is null or set to 0 proxy will be ignored and not used.

* Moved proxy function to a method.

Moved proxy function to a method.

* Changed the name of method

Changed from set_proxy_if_exists to setup_proxy

* Revert "Dev Proxy support" (#2374)

* Revert "[Feature] added keep pokemon for batch evolution" (#2380)

* Adapt code to new PGoApi Code (#2357)

* wip: fixing imports and tests

* tests are passing

* add tests, and modify calls to api accordingly

* fix login bug

* fix rebase

* fix import error

* Handle ThrottlingException

* fix relogging errors

* Refactor evolve_all worker (#2244)

* Refactor evolve_all worker

- Remove transfer of evolved pokemon (should be handle by transfer task)
- Add order_by config flag to choose to evolve by iv or cp (default: cp)
- Add evolve_iv_min as threshold for evolve by iv (order by cp under threshold)
- Fix _validate_config not called before
- Get candy list to test if enough candy in the bag
- Filter out pokemon which can't be evolved

* remove unnecessary debug lines

* Add missing candy name

* Use uncached inventory to have up to date amount of candy and list of pokemon

* Fix candy name
Add missing candies

* Fix evolving logic:

- replace "order_by" by "first_evolve_by" to choose if we prioritize "cp" or "iv" (default: "cp")
- replace "evolve_cp_min" by "evolve_above_cp" (default: 500)
- replace "evolve_iv_min" by "evolve_above_iv" (default: 0.8)
- add "logic" to choose if we "evolve_above_cp" and/or "evolve_above_iv"
- update config file

* Rename EvolveAll to EvolvePokemon task name

* Add error warning about task renaming

* Add a test about tasl renaming

* Fix task renaming warning

* Update new api wrapper

* delaying errors, and reducing noise (#2393)

* Removed max_steps in the config pokemon sample. Also added FollowSpiral's new options (#2342)

* Display stats in the terminal title (#2252)

* Added UpdateTitleStats worker

* Added UpdateTitleStats worker

* Fixed return inconsistency in work method

* 🚀 Massively improved pylint rate

Cleaned ctypes unnecessary imports
Moved initialization inside __init__ method

* Fixed incorrect default value for min_interval

* Added support for cygwin on Windows

* Catch UnexpectedResponseException and retry (#2407)

* Catch UnexpectedResponseException and retry

* New func for UnexpectedResponse

* Fixed merge conflicts.

* Randomize spins for softban #2247 (#2253)

* Randomize spins for softban #2247

* Update handle_soft_ban.py

* fix(docker): correct web config file path (#2350)

* Allow for 3-7 decimal points for coordinates (#2402)

Some exports only provide three decimal point accuracy, and sometimes 4.440000 turns into 4.44, need to adjust the regex.

* PokemonGo-Map Synergy (#1992)

* Feature: Use PokemonGo-Map sqlite db to catch pokemon near you

* added example config for move_to_map_pokemon

* adapted new config format

* Automatically update Map position

* remove pokemon when encountered early

* forgot to remove a log

* minor fix

* updated example config and added ignore config

* change ignore config to a list

* teleport to pokemon if walk option is 0

* added snipe option

* Teleport back after sniped pokemon was caught

* proper sniping

* mark sniped pokemon as caught

* forgot to remove print

* minor bug fix

* ignore max_distance when sniping

* prioritize VIPs in a 10km radius

* better prioritize vips

* syntax error fix

* set base priority for vips

* move map config example to seperate file

* use web api instead of sqlite db

* fix datetime format

* huge code cleanup

* forgot to snipe

* add vips to catch as default

* default priority for vips

* only mark pokemon as caught when it really was caught

* bugfix

* bugfix #2

* i should go to bed

* add option to disable map update

* updated example map config to match default example

* improve pylint result, fix catch recognition

* more code clean up

* better config example

* dump caught pokemon to json file to prevent targeting them on restart

* check if we got pokeballs to use

* remove print

* fix item_inventory_count returnin None instead of 0

* if we only have ultraballs and the target is not a vip don't snipe/walk

* remove gender symbols

* fix Mr. Mime

* vip wrong order fix

* bugfix

* log error when JSON decoding fails

* handle base64 error

* Return type None on nested call was breaking details display (#2416)

* Adding a section on analytics and metrics to the Readme (#2434)

* Fix to display stats on iterm2 terminal (#2440)

* Fix #2442 - should_retry_throttle isn't defined (#2461)

* Fix #2442

Variables weren't correctly defined

* Fix typo

* Replace all `logger.log` calls with events! (#2173)

* bye bye `logger.log`, hello event system!

* fixing travis build

* trying to fix travis build

* test fixes

* updating remaining `logger.log` calls that should be replaced

* typo

* typos in IncubateEggs event

* improved fort loot event data

* fixing update_location event's distance unit

* fixing some events and log stuff

* adding missing fort_name parameter to lured_pokemon_found event

* fixing a variable inside an event formatted string

* fixing typos and utf8

* trying to fix tests with regards to float precision

* adding command to print all registered events and their parameters

* fixing tests yet again

* trying to fix unicode issues, arrgh!!!

* added a move to lured fort event

* better distance text in move to fort and fixing utf8 in spin fort task

* removing print from websocket server

* start embedded server before creating the socketio_handler

* I hate unicode

* rename and sleep events

* refactoring in how we emit events to avoid code repetition

* PokemonCatch task inherits from BaseTask

* go away, dirty logger.log!

* pep8 and removed logging handler name attribute

* good bye for the remaining logger.log calls

* bye logger module

* no more logger imports!

* removed last few loggers

* removing secret file and fixed variable name in follow cluster

* fixing kwargs for event emit

* trying to fix unicode handling one more time

* now it works!

* fixing more logs and removing debug unicode string

* no logs on websocket server yet

* adding a script to start a standalone websocket server

* more adjusted in websocket to support multiuser

* adding a fallback to logger.log issues a very verbose deprecation warning

* putting back compatibility with json based web ui

* correct parsing evolve_all (#2455)

* correct parsing evolve_all

Previously, 

```
 "evolve_all": "Pidgey, Caterpie, Weedle",
```

would only evolve Pidgey. This PR fix that.

* fix parsing evolve_captured

* Remove max_steps from examples and set EvolveAll to EvolvePokemon (#2430)

* Adding Raven to send exception reports to Sentry (#2514)

* Adding Raven to send exception reports to Sentry

* Removing test exception

* Removing incompatible python3 analytics library

* Using logger.log

* Using the correct logger

* changing license from MIT to GPLv3

* Updated README.md to state bot status (#2586)

* Added bot broken message at top of page.

* Changed REAME.md to mirror #2590

* Reordered

* Handling KeyboardInterrupt and some other exceptions (#2599)
alexyaoyang pushed a commit to alexyaoyang/PokemonGo-Bot that referenced this pull request Aug 15, 2016
TheSavior pushed a commit that referenced this pull request Aug 16, 2016
* SleepSchedule check if current sleep period is over

Enhances #2193

* Add config field "skip_current_sleep_cycle"

* Edit sample config files to include skip_current_sleep_cycle

* Remove skip_current_sleep_cycle

* Add one more check for current sleep
solderzzc added a commit that referenced this pull request Aug 17, 2016
* Do not spin fort on timeout when restarting the bot (#3931)

Fix bot stuck between forts when inventory is full

* Fixed references to self.bot.config.walk (#4046)

* Fixed error

* Fixed error

* Updating run.sh and install.sh (#4033)

* Update run.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Fixing typo

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second. (#4058)

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second.

* Added example in config.

* heartbeat_threshold using time delta (#4095)

* changed hearbeat threshold to work on a delta time

* renamed variable for clarity

* tidy up

* Fixing live stats crash on first run (#4088)

* try to fix system platform in init.py (#4068)

Fix for other system we don't know but should run without problem.

* Fix get_top_rank (#3823)

Refresh inventory when opening it
Do not use rare pokemon to xp
Fix an issue when use_lucky_egg=true and evolve_only_with_lucky_egg=false
Save web inventory after refresh
Add parameter evolve_time default to 20.
Rename parameter use_candies_for_xp in evolve_for_xp
Rename parameter minimum_evolve_for_lucky_egg in evolve_count_for_lucky_egg
Rename parameter use_lucky_egg in may_use_lucky_egg
Add 1 percent rule = Do not use rare pokemon candies for xp
Handle lucky egg already active case
Plan bad Eevees for transfer if evolve is deactivated

* Enhancement/sleep schedule check if current sleep is over (#4031)

* SleepSchedule check if current sleep period is over

Enhances #2193

* Add config field "skip_current_sleep_cycle"

* Edit sample config files to include skip_current_sleep_cycle

* Remove skip_current_sleep_cycle

* Add one more check for current sleep

* MoveToMapPokemon: Replacing min_time with reachable distance calculation (#4022)

* * replacing min_time functionality of MoveToMapPokemon by a more sophisticated way of determining reachability on time

* * fixing #3609

* moving config values to top

* Make PokemonOptimizer calculate correct transfer / evolve groups (#4099)

* Humanize & better app simulation for catches (#3872)

* changed 2 second delay between retrying throws to use action_delay
minimum delay is 2 seconds

* quick randomise 2,4 or 6 secs between failed throw and next throw to simulate app better

* added config option to turn randomize_flee_duration off (default = on)

* configurable delay for throwing balls

added action_delay when changing ball or using razzberry

* moved delay for razzberry to more appropriate place

* updated config files with catch_wait_min and catch_wait_max

* updated config files with randomize_flee_duration

* grouped catch simulation and humanization settings
added settings for all catch related sleeps

* Changed the logic for randomly choosing a sleep for flee animation to something reasonable

* docs
clean up import

* re-Wording followPath to more readable, recycle_items.should_run should accept <= for min_empty_space: 0 (#4105)

* re-wording follow path, inventory should have -1 value instead of 0

* remove unused

* refactor: inventory.get_space_left should return 0 so change conditions from recycle.should_run instead

* Send bot through Tor (#4108)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Update setup.sh (#4117)

* Update run.sh (#4123)

typo

* Fixing values on UpdateLiveStatus (#4127)

* Updated wiki, explain how to use Docker under Windows (#4136)

* Bring together CatchVisiblePokemon & CatchLuredPokemon in config (#3966)

* CatchPokemon calls CatchLuredPokemon and CatchVisiblePokemon methods.

Config now only needs one catch related worker.  All catch related config including option to catch lured and/or visible can be kept with the task.

* example config

* indentation

* defaults for catch_lured/visible_pokemon

* deprecated command line options for throw parameters

* catch_throw_parameters defaults match config.json.example

* added deprecation functionality for CatchVisiblePokemon and CatchLuredPokemon

* min_ultraball_to_keep default reflects example config

* tree_config_builder_test uses CatchPokemon instead of CatchLuredPokemon

* deprecation warning message

* catchsim config moved to CatchPokemon

* updated example configs

* updated docs

* User configurable delay when spinning fort (#4109)

* user configurable delay for spin fort

* replaced time.sleep(2) with configurable delay

* updated configs

* fix followCluster & MoveToMapPokemon (#4115)

* * fixed followCluster not following lured clusters because of outdated pokestop data structure
* fixed very annoying followCluster wording (OCD senses were tickling)
* fixed #4022

* no message

* string formatting

* correcting message to display lured only when walking to lured cluster

* message formatting

* forgot to add regester event variable

* Showing detailed sleep info (#4066)

* Windows installation instructions refit (#3898)

* Delete PokemonGo-Bot-Repair.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Removed an update procedure that was making the map not to work.

* Update installation.md

Modified Windows installation instructions to use the batch files.

* Update PokemonGo-Bot-Install.bat

Added links for the configuration instructions. Still missing links for the encrypt files. Need help on it.

* Update manual_installation.md

Recreated the installations instructions for Windows.

* Update installation.md

Removed the need to download PyYAML and modified the instructions to download only the required encrypt files.

* Update manual_installation.md

Removed the requirement to download PyYAML as the installer already downloads it during git pull. Also removed the requirement to download all encrypt files.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Added a pause in the end so the promp wont close in the end if `pokecli.py` goes to error.

* Update PokemonGo-Bot-Install.bat

Added a procedure to deal with the installation path issue. Also, added a command to install protobuff automatically.

* Update installation.md

Removed the requirement to install protobuff as it will be installed automatically by the install batch.

* Update PokemonGo-Bot-Install.bat

* Update manual_installation.md

Removed the requirement for protoc and added command line to download it.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Updated in order to work anywhere as long its inside the windows_bat folder

* Update PokemonGo-Bot-Install.bat

* Update installation.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Update CONTRIBUTORS.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Revert "Update CONTRIBUTORS.md"

This reverts commit 856a0fd.

* Revert "Delete PokemonGo-Bot-Repair.bat"

This reverts commit a459a86.

* Revert "Update PokemonGo-Bot-Start.bat"

This reverts commit 510570d.

* Revert "Update PokemonGo-Bot-Install.bat"

This reverts commit 9db2798.

# Conflicts:
#	windows_bat/PokemonGo-Bot-Install.bat

* Complete refit of all batches

We can now choose an install location and all required software is
automatically installed.

* Added contributors

Added new contributors

* Revert "Added contributors"

This reverts commit a1d364c.

* Deprecate action_wait_min/max in favour of task specific options (#4048)

* RecycleItems uses it's own recycle_wait_min/max instead of action_wait_min/max

* TransferPokemon uses it's own transfer_wait_min/max instead of action_wait_min/max

* PokemonOptimizer uses it's own transfer_wait_min/max instead of action_wait_min/max

* Deprecated action_wait_min and action_wait_max

* fixed mistake

* Update update_live_stats.py (#3985)

* SQLite backend for bot/plugin use (#4129)

* Initial attempt at implementing an SQLite backend for plugin use

* Fixed attribute error when accessing DB

* Patch snipey in move_to_map_pokemon.py (#4146)

to solve issue #4142

* Add files via upload (#4151)

* fix example config

* fix config file

* added a script to check json, and updated .travis.yml

* Update json-validate.py

* Documenting docker-compose with Tor (#4161)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Docker documentation update

Including example command for using the alternate tor proxy command. Additionally changed line 114 to down rather than rm so that the containers are stopped before they are removed in the case that the containers were launched in detached mode.

* Remove `,` at line 112 (#4171)

* Minor config fix (#4173)

Fixes indent

* Fix no pokeballs log spamming (#4000)

* Fix looping between equidstant pokestops

* :D

* emp

* changes

* fix no pokeballs log spamming, fix possible bug

* remove unnesscessary return

* revert pokemongo_bot/cell_workers/move_to_fort.py

* solve merge conflicts

* Remove extra whitespace
mjmadsen pushed a commit that referenced this pull request Aug 20, 2016
* Dev merge to master, PR (#4178)

* Do not spin fort on timeout when restarting the bot (#3931)

Fix bot stuck between forts when inventory is full

* Fixed references to self.bot.config.walk (#4046)

* Fixed error

* Fixed error

* Updating run.sh and install.sh (#4033)

* Update run.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Fixing typo

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second. (#4058)

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second.

* Added example in config.

* heartbeat_threshold using time delta (#4095)

* changed hearbeat threshold to work on a delta time

* renamed variable for clarity

* tidy up

* Fixing live stats crash on first run (#4088)

* try to fix system platform in init.py (#4068)

Fix for other system we don't know but should run without problem.

* Fix get_top_rank (#3823)

Refresh inventory when opening it
Do not use rare pokemon to xp
Fix an issue when use_lucky_egg=true and evolve_only_with_lucky_egg=false
Save web inventory after refresh
Add parameter evolve_time default to 20.
Rename parameter use_candies_for_xp in evolve_for_xp
Rename parameter minimum_evolve_for_lucky_egg in evolve_count_for_lucky_egg
Rename parameter use_lucky_egg in may_use_lucky_egg
Add 1 percent rule = Do not use rare pokemon candies for xp
Handle lucky egg already active case
Plan bad Eevees for transfer if evolve is deactivated

* Enhancement/sleep schedule check if current sleep is over (#4031)

* SleepSchedule check if current sleep period is over

Enhances #2193

* Add config field "skip_current_sleep_cycle"

* Edit sample config files to include skip_current_sleep_cycle

* Remove skip_current_sleep_cycle

* Add one more check for current sleep

* MoveToMapPokemon: Replacing min_time with reachable distance calculation (#4022)

* * replacing min_time functionality of MoveToMapPokemon by a more sophisticated way of determining reachability on time

* * fixing #3609

* moving config values to top

* Make PokemonOptimizer calculate correct transfer / evolve groups (#4099)

* Humanize & better app simulation for catches (#3872)

* changed 2 second delay between retrying throws to use action_delay
minimum delay is 2 seconds

* quick randomise 2,4 or 6 secs between failed throw and next throw to simulate app better

* added config option to turn randomize_flee_duration off (default = on)

* configurable delay for throwing balls

added action_delay when changing ball or using razzberry

* moved delay for razzberry to more appropriate place

* updated config files with catch_wait_min and catch_wait_max

* updated config files with randomize_flee_duration

* grouped catch simulation and humanization settings
added settings for all catch related sleeps

* Changed the logic for randomly choosing a sleep for flee animation to something reasonable

* docs
clean up import

* re-Wording followPath to more readable, recycle_items.should_run should accept <= for min_empty_space: 0 (#4105)

* re-wording follow path, inventory should have -1 value instead of 0

* remove unused

* refactor: inventory.get_space_left should return 0 so change conditions from recycle.should_run instead

* Send bot through Tor (#4108)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Update setup.sh (#4117)

* Update run.sh (#4123)

typo

* Fixing values on UpdateLiveStatus (#4127)

* Updated wiki, explain how to use Docker under Windows (#4136)

* Bring together CatchVisiblePokemon & CatchLuredPokemon in config (#3966)

* CatchPokemon calls CatchLuredPokemon and CatchVisiblePokemon methods.

Config now only needs one catch related worker.  All catch related config including option to catch lured and/or visible can be kept with the task.

* example config

* indentation

* defaults for catch_lured/visible_pokemon

* deprecated command line options for throw parameters

* catch_throw_parameters defaults match config.json.example

* added deprecation functionality for CatchVisiblePokemon and CatchLuredPokemon

* min_ultraball_to_keep default reflects example config

* tree_config_builder_test uses CatchPokemon instead of CatchLuredPokemon

* deprecation warning message

* catchsim config moved to CatchPokemon

* updated example configs

* updated docs

* User configurable delay when spinning fort (#4109)

* user configurable delay for spin fort

* replaced time.sleep(2) with configurable delay

* updated configs

* fix followCluster & MoveToMapPokemon (#4115)

* * fixed followCluster not following lured clusters because of outdated pokestop data structure
* fixed very annoying followCluster wording (OCD senses were tickling)
* fixed #4022

* no message

* string formatting

* correcting message to display lured only when walking to lured cluster

* message formatting

* forgot to add regester event variable

* Showing detailed sleep info (#4066)

* Windows installation instructions refit (#3898)

* Delete PokemonGo-Bot-Repair.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Removed an update procedure that was making the map not to work.

* Update installation.md

Modified Windows installation instructions to use the batch files.

* Update PokemonGo-Bot-Install.bat

Added links for the configuration instructions. Still missing links for the encrypt files. Need help on it.

* Update manual_installation.md

Recreated the installations instructions for Windows.

* Update installation.md

Removed the need to download PyYAML and modified the instructions to download only the required encrypt files.

* Update manual_installation.md

Removed the requirement to download PyYAML as the installer already downloads it during git pull. Also removed the requirement to download all encrypt files.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Added a pause in the end so the promp wont close in the end if `pokecli.py` goes to error.

* Update PokemonGo-Bot-Install.bat

Added a procedure to deal with the installation path issue. Also, added a command to install protobuff automatically.

* Update installation.md

Removed the requirement to install protobuff as it will be installed automatically by the install batch.

* Update PokemonGo-Bot-Install.bat

* Update manual_installation.md

Removed the requirement for protoc and added command line to download it.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Updated in order to work anywhere as long its inside the windows_bat folder

* Update PokemonGo-Bot-Install.bat

* Update installation.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Update CONTRIBUTORS.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Revert "Update CONTRIBUTORS.md"

This reverts commit 856a0fd.

* Revert "Delete PokemonGo-Bot-Repair.bat"

This reverts commit a459a86.

* Revert "Update PokemonGo-Bot-Start.bat"

This reverts commit 510570d.

* Revert "Update PokemonGo-Bot-Install.bat"

This reverts commit 9db2798.

# Conflicts:
#	windows_bat/PokemonGo-Bot-Install.bat

* Complete refit of all batches

We can now choose an install location and all required software is
automatically installed.

* Added contributors

Added new contributors

* Revert "Added contributors"

This reverts commit a1d364c.

* Deprecate action_wait_min/max in favour of task specific options (#4048)

* RecycleItems uses it's own recycle_wait_min/max instead of action_wait_min/max

* TransferPokemon uses it's own transfer_wait_min/max instead of action_wait_min/max

* PokemonOptimizer uses it's own transfer_wait_min/max instead of action_wait_min/max

* Deprecated action_wait_min and action_wait_max

* fixed mistake

* Update update_live_stats.py (#3985)

* SQLite backend for bot/plugin use (#4129)

* Initial attempt at implementing an SQLite backend for plugin use

* Fixed attribute error when accessing DB

* Patch snipey in move_to_map_pokemon.py (#4146)

to solve issue #4142

* Add files via upload (#4151)

* fix example config

* fix config file

* added a script to check json, and updated .travis.yml

* Update json-validate.py

* Documenting docker-compose with Tor (#4161)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Docker documentation update

Including example command for using the alternate tor proxy command. Additionally changed line 114 to down rather than rm so that the containers are stopped before they are removed in the case that the containers were launched in detached mode.

* Remove `,` at line 112 (#4171)

* Minor config fix (#4173)

Fixes indent

* Fix no pokeballs log spamming (#4000)

* Fix looping between equidstant pokestops

* :D

* emp

* changes

* fix no pokeballs log spamming, fix possible bug

* remove unnesscessary return

* revert pokemongo_bot/cell_workers/move_to_fort.py

* solve merge conflicts

* Remove extra whitespace

* Update pokemon.json (#4308)

confirmed

* Revert "Update pokemon.json" (#4315)

* added Mud Slap to Diglett moveset
solderzzc added a commit that referenced this pull request Aug 21, 2016
* Do not spin fort on timeout when restarting the bot (#3931)

Fix bot stuck between forts when inventory is full

* Fixed references to self.bot.config.walk (#4046)

* Fixed error

* Fixed error

* Updating run.sh and install.sh (#4033)

* Update run.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Fixing typo

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second. (#4058)

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second.

* Added example in config.

* heartbeat_threshold using time delta (#4095)

* changed hearbeat threshold to work on a delta time

* renamed variable for clarity

* tidy up

* Fixing live stats crash on first run (#4088)

* try to fix system platform in init.py (#4068)

Fix for other system we don't know but should run without problem.

* Fix get_top_rank (#3823)

Refresh inventory when opening it
Do not use rare pokemon to xp
Fix an issue when use_lucky_egg=true and evolve_only_with_lucky_egg=false
Save web inventory after refresh
Add parameter evolve_time default to 20.
Rename parameter use_candies_for_xp in evolve_for_xp
Rename parameter minimum_evolve_for_lucky_egg in evolve_count_for_lucky_egg
Rename parameter use_lucky_egg in may_use_lucky_egg
Add 1 percent rule = Do not use rare pokemon candies for xp
Handle lucky egg already active case
Plan bad Eevees for transfer if evolve is deactivated

* Enhancement/sleep schedule check if current sleep is over (#4031)

* SleepSchedule check if current sleep period is over

Enhances #2193

* Add config field "skip_current_sleep_cycle"

* Edit sample config files to include skip_current_sleep_cycle

* Remove skip_current_sleep_cycle

* Add one more check for current sleep

* MoveToMapPokemon: Replacing min_time with reachable distance calculation (#4022)

* * replacing min_time functionality of MoveToMapPokemon by a more sophisticated way of determining reachability on time

* * fixing #3609

* moving config values to top

* Make PokemonOptimizer calculate correct transfer / evolve groups (#4099)

* Humanize & better app simulation for catches (#3872)

* changed 2 second delay between retrying throws to use action_delay
minimum delay is 2 seconds

* quick randomise 2,4 or 6 secs between failed throw and next throw to simulate app better

* added config option to turn randomize_flee_duration off (default = on)

* configurable delay for throwing balls

added action_delay when changing ball or using razzberry

* moved delay for razzberry to more appropriate place

* updated config files with catch_wait_min and catch_wait_max

* updated config files with randomize_flee_duration

* grouped catch simulation and humanization settings
added settings for all catch related sleeps

* Changed the logic for randomly choosing a sleep for flee animation to something reasonable

* docs
clean up import

* re-Wording followPath to more readable, recycle_items.should_run should accept <= for min_empty_space: 0 (#4105)

* re-wording follow path, inventory should have -1 value instead of 0

* remove unused

* refactor: inventory.get_space_left should return 0 so change conditions from recycle.should_run instead

* Send bot through Tor (#4108)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Update setup.sh (#4117)

* Update run.sh (#4123)

typo

* Fixing values on UpdateLiveStatus (#4127)

* Updated wiki, explain how to use Docker under Windows (#4136)

* Bring together CatchVisiblePokemon & CatchLuredPokemon in config (#3966)

* CatchPokemon calls CatchLuredPokemon and CatchVisiblePokemon methods.

Config now only needs one catch related worker.  All catch related config including option to catch lured and/or visible can be kept with the task.

* example config

* indentation

* defaults for catch_lured/visible_pokemon

* deprecated command line options for throw parameters

* catch_throw_parameters defaults match config.json.example

* added deprecation functionality for CatchVisiblePokemon and CatchLuredPokemon

* min_ultraball_to_keep default reflects example config

* tree_config_builder_test uses CatchPokemon instead of CatchLuredPokemon

* deprecation warning message

* catchsim config moved to CatchPokemon

* updated example configs

* updated docs

* User configurable delay when spinning fort (#4109)

* user configurable delay for spin fort

* replaced time.sleep(2) with configurable delay

* updated configs

* fix followCluster & MoveToMapPokemon (#4115)

* * fixed followCluster not following lured clusters because of outdated pokestop data structure
* fixed very annoying followCluster wording (OCD senses were tickling)
* fixed #4022

* no message

* string formatting

* correcting message to display lured only when walking to lured cluster

* message formatting

* forgot to add regester event variable

* Showing detailed sleep info (#4066)

* Windows installation instructions refit (#3898)

* Delete PokemonGo-Bot-Repair.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Removed an update procedure that was making the map not to work.

* Update installation.md

Modified Windows installation instructions to use the batch files.

* Update PokemonGo-Bot-Install.bat

Added links for the configuration instructions. Still missing links for the encrypt files. Need help on it.

* Update manual_installation.md

Recreated the installations instructions for Windows.

* Update installation.md

Removed the need to download PyYAML and modified the instructions to download only the required encrypt files.

* Update manual_installation.md

Removed the requirement to download PyYAML as the installer already downloads it during git pull. Also removed the requirement to download all encrypt files.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Added a pause in the end so the promp wont close in the end if `pokecli.py` goes to error.

* Update PokemonGo-Bot-Install.bat

Added a procedure to deal with the installation path issue. Also, added a command to install protobuff automatically.

* Update installation.md

Removed the requirement to install protobuff as it will be installed automatically by the install batch.

* Update PokemonGo-Bot-Install.bat

* Update manual_installation.md

Removed the requirement for protoc and added command line to download it.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Updated in order to work anywhere as long its inside the windows_bat folder

* Update PokemonGo-Bot-Install.bat

* Update installation.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Update CONTRIBUTORS.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Revert "Update CONTRIBUTORS.md"

This reverts commit 856a0fd.

* Revert "Delete PokemonGo-Bot-Repair.bat"

This reverts commit a459a86.

* Revert "Update PokemonGo-Bot-Start.bat"

This reverts commit 510570d.

* Revert "Update PokemonGo-Bot-Install.bat"

This reverts commit 9db2798.

# Conflicts:
#	windows_bat/PokemonGo-Bot-Install.bat

* Complete refit of all batches

We can now choose an install location and all required software is
automatically installed.

* Added contributors

Added new contributors

* Revert "Added contributors"

This reverts commit a1d364c.

* Deprecate action_wait_min/max in favour of task specific options (#4048)

* RecycleItems uses it's own recycle_wait_min/max instead of action_wait_min/max

* TransferPokemon uses it's own transfer_wait_min/max instead of action_wait_min/max

* PokemonOptimizer uses it's own transfer_wait_min/max instead of action_wait_min/max

* Deprecated action_wait_min and action_wait_max

* fixed mistake

* Update update_live_stats.py (#3985)

* SQLite backend for bot/plugin use (#4129)

* Initial attempt at implementing an SQLite backend for plugin use

* Fixed attribute error when accessing DB

* Patch snipey in move_to_map_pokemon.py (#4146)

to solve issue #4142

* Add files via upload (#4151)

* fix example config

* fix config file

* added a script to check json, and updated .travis.yml

* Update json-validate.py

* Documenting docker-compose with Tor (#4161)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Docker documentation update

Including example command for using the alternate tor proxy command. Additionally changed line 114 to down rather than rm so that the containers are stopped before they are removed in the case that the containers were launched in detached mode.

* Remove `,` at line 112 (#4171)

* Minor config fix (#4173)

Fixes indent

* Fix no pokeballs log spamming (#4000)

* Fix looping between equidstant pokestops

* :D

* emp

* changes

* fix no pokeballs log spamming, fix possible bug

* remove unnesscessary return

* revert pokemongo_bot/cell_workers/move_to_fort.py

* solve merge conflicts

* Remove extra whitespace

* Further SQLite efforts to ease usage via `bot.database`. (#4179)

* Check for tutorial completion (#4070)

* Use empty default username for nickname
On gmail accounts, it would be suspect to have @gmail.com in nickname
Nickname is not set if user does not set one in config

* Fix typo

* Fix result key name

* Moved to own task

* Add example in config

* Rebased to latest dev on top of :
Fixing live stats crash on first run (#4088)
in order for the bot to reach the task without crashing

* damn thos DOS line endings

* fix json

* Fix to prevent meltdown when migrations are not present for a Datastore (#4183)

* Added Daily Catch Limits & Catch Log (SQL) (#4188)

* Update pokemon_catch_worker.py

* daily_catch_limit

* create catch_log.py

migration

* Update pokecli.py

* catch_limit

* catch_limit

* Update config.json.cluster.example

* Update config.json.map.example

* Update config.json.optimizer.example

* Update config.json.path.example

* Update config.json.pokemon.example

* Update pokemon_catch_worker.py

* Update pokemon_catch_worker.py

* Create catch_log.py

* Update configuration_files.md

* Delete catch_log.py

* Add throw type to threw_pokeball message (#4199)

* Keep by best hp max (#4144)

* Updated wiki, explain how to use Docker under Windows

* Add keep_best_hp_max to keep pokemon with the best potential hp

* Add example of keep_best_hp_max in config

* Keep best pokemon by custom criteria order

* Correct list of criteria. Add example in config.

* Update documentations for keep custom pokemons

* Replace the important | for the set

* Clean the charmander comment

* Latitude and Longitude in UpdateLiveStats (#4196)

* Added an option to show location in UpdateLiveStats

* Fix error

* stop catching pokemon if we do not have pokeballs (#4168)

* stop catching pokemon if we do not have pokeballs

* uses global constant

* The catch event should only emit when caught success. (#4200)

* Fixed Encrypt file name in Windows (#4193)

* Random pause task (#4202)

* Updated wiki, explain how to use Docker under Windows

* Add keep_best_hp_max to keep pokemon with the best potential hp

* Add example of keep_best_hp_max in config

* Keep best pokemon by custom criteria order

* Correct list of criteria. Add example in config.

* Update documentations for keep custom pokemons

* Replace the important | for the set

* Clean the charmander comment

* Add task random pause

* Add random pause in config

* Add todo for the raising errors if min > max

* Upgrade to the latest pgoapi. (#4206)

* Upgrade to the latest pgoapi.
8c1c17637be0aa679d92e582e6c4dd1370a3ac00

* Changed for pgoapi upgrade.

* Upgrade for new pogapi version.

* Switch to 12b2028cbf19342efd971020033027802b569769 of pgoapi, the latest doesn't work.

* show what kind of egg is being hatched (#4219)

* Add spin message (#4226)

* List Pokemon bag at bot start (#4189)

* - Added option to print Pokemon Bag when bot starts
- Using self.logger to log multiple lines

* Little code change
- Some progress making it customizable, to be possible to choose which info to show from each pokemon to show

* Update ListPokemonBag functionality

* Code tweaked to use inventory
* Nested config with 3 parameters
* Configs to change settings: show amount of each pokemon; pokemon info to show
* Added config example to all config example files

* typo fix

* Added UpdateLiveInventory config (#3950)

* Added UpdateLiveInventory function

* Added UpdateLiveInventory function

* Fix no EOF empty line

* Updated UpdateLiveInventory function, more customizable now

* More configs on UpdateLiveInventory

* - Changed to self.logger instead of event when using multiple lines config
- When using multiple lines config emits event at debug level

* Minor tweak and merge with PokemonGoF/dev

* Fixed config.json.example

* Updated CONTRIBUTORS.md

* Removed proto folder, we don't need it anymore.

* Removed the old inventory / only one call to the api (#3948)

* Removed every call to the old inventory
Added some messages to monitor item inventory
Added some methods needed on the new inventory

* Removed print

* Removed print

* Keeps track of candy on pokemon catch

* Dynamically count candy gained

* Rename pokemon id in pokemon unique id

* Fixed typo
Some clean up

* Renamed pokemon id in unique_id

* Now display again stats on start

* Now use ultraball on non vip too

* Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot into remove-old-inventory

# Conflicts:
#	pokemongo_bot/__init__.py

Now move to map use cached inventory
Removed log.logger()

* Minor fixes after removed the old inventory (#4231)

* Pokestops / Evolves / Transfers Logged to DB (#4232)

* Pokestop Logging

* Evolve Logging

* evolve_log.py migrations

* transfer_log.py migration

* pokestop_log.py migration

* Update transfer_pokemon.py

* Update transfer_pokemon.py

* Revert "Pokestops / Evolves / Transfers Logged to DB" (#4239)

* Hotfix/remove old inventory (#4238)

* Updated configuration documentation after #4005

* Updated configuration documentation of walk

* Renamed id in unique_id
Added functions to get pokemon inventory size

* Removed variable used for test purpose

* Computing candy awarded instead of taking only the first value

* Reverted to use json again

* Calling the api instead of the removed inventory

* Fixed #4237
Not calling old inventory to get available lucky egg count

* Polyline rework (#3854)

* added better rng

* forgot adding

* rework on polyline

* remove wrong files...

* remove wrong files...

* reverting unnecessory change...

* minor fix

* get the CI pass

* fix test

* minor fix

* Features/missed throws (#4107)

* Adds a missed shot opportunity. This will reduce the 100% hit rate and humanise the throwing behaviour.

* * Added the new value to config.json.example.
* A little house cleaning

* Fixing error in logic

* Changing sleep for action_delay

* * Updated config example
* Fixed simulation changes

* Fixes bugs

* Configurable altitude range  (#4250)

* Added alt_min/alt_max

* Changed default values

* Added alt

* Cleaned up speed calc

* Added altitude randomness

* Added altitude randomness

* Added altitude randomness

* Fixed import

* Added altitude randomness

* Added altitude randomness

* Fixed import

* Added alt_min/alt_max

* Added alt_min/alt_max

* Added alt_min/alt_max

* Switch to walk_min, walk_max

* Added alt_min/alt_max

* Added alt_min/alt_max

* show commit hash info (#4244)

* add commit hash info

* check if the hash if a valid hex

* Hotfix for inventory and pokemon optimizer (#4258)

* Hotfix for inventory and pokemon optimizer

* Better code

* Small fixes for altitude (#4265)

* Small fix for alt

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Changed default alt values (to meters)

* Small change

* Show eggs count (#4263)

* Start to use the signature interface. (#4245)

* Start to use the signature interface.

* Added dummy class to show how to use:
DeviceInfo
ActivityStatus
SensorInfo

* sensor data is randomly generated (#4249)

* including activity status details resulted in uk6 fail (no map objects), need more iOS dumps to identify the issue

* Switch the upstream of pgoapi to joelgreen, he will handle the upupstream PR as well.

* Impose minimum on walk/alt minimums (#4269)

* fix setup.sh (#4155)

* improve step walker (#4097)

* Init self.alt (#4271)

* Init self.alt

* aded import uniform

* fix

* Fix altitude and walker_factory usage (#4254)

* Fix: Correct usage of alt in move_to_map_pokemon

* Fix: Correct usage of walker_factory

* Only walk towards Pokemon when total of balls >= min_ball

* Login table check (#4277)

check to see if login table exists before attempting record insert

* Catch_Log table check & database log events (#4280)

* Catch log table checks

Ensuring catch_log table exists before inserting record to db

* Log events (for database stuff)

real quick

* Database log events

* register_event pokestop_log

* pokestop_log log event

* Existing Table Checks (in migrations) (#4273)

* table check

* Existing Table Check

* Fix bug (#4276)

* Update alt to last-location (#4278)

* Evolve / Transfer / Pokestop logs (DB) (#4285)

* Log pokemon evolves to the database

with safety check on table existing

* Log pokestops to database

logs all pokestops to the database (will be used to limit pokestops per "time"), included safety check to ensure table exists before inserting

* evolve_log.py

* transfer_log.py

* pokestop_log.py

* Update CONTRIBUTORS.md

* change color for both update live stats and inventory (#4230)

* Signatureconfig (#4287)

* pass config into ApiWrapper and use md5 hash of username for device_id

* update to pgoapi which increments version number from 1.1.6 to 1.1.7

* include location fix in the signature, note in the future we will need a batch of location fixes per second

* use @ instead of /commit

* new api with google login fix

* include unknown25

* Salt hash for device_id (#4289)

* salt the hash

* Update config.json.example

* Update config.json.cluster.example

* Update config.json.map.example

* Update config.json.optimizer.example

* Update config.json.path.example

* Update pokecli.py

* Update api_wrapper.py

* Update config.json.cluster.example

* Update config.json.example

* Update config.json.map.example

* Update config.json.optimizer.example

* Update config.json.path.example

* store device_id to file

* Update api_wrapper.py

* Update pokecli.py

* Dump device_id salt to file in data (#4294)

* Dump device_id salt to file in data

* Use previous salt if it's already stored

* Berry usage threshold (#4295)

* berry threshold

* edit example configs

* Correct sort on keep best custom (#4242)

* Only go through CompleteTutorial once at launch (#4296)

* Changes to the Windows Batches (#4213)

* Delete PyYAML-3.11-cp27-cp27m-win32.whl

Not needed anymore

* Delete PyYAML-3.11-cp27-cp27m-win_amd64.whl

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

Added virtualenv to the installation.

* Update PokemonGo-Bot-Install.bat

Fixed typos

* Fixed backup restoration procedures.

* Additional fixes to the backup procedures.

* Update PokemonGo-Bot-Install.bat

Added a function to treat /

* Fixed treatment for / in the path

* quick fix

* Update api_wrapper.py

* Refactor the hash & salt code (#4300)

Simplify logic for using the config and/or device file information

* Softban Tracker (#4299)

* Log softbans + source / date to database

* Log softbans + source / date to database

* Update __init__.py

* Update colored_logging_handler.py

* Create softban_log.py

* re-add new berry stuff

* Updated "Seel" Moveset (#4302)

Added "Lick" to the Fast Attacks

* Assign VIP status based on NCP (#4177)

* Added NCP support to pokemon_catch_worker.py.

* Update pokemon_catch_worker.py

* Added missing initialization of ncp

* Incubate_eggs_merge

* Update pokemon_catch_worker.py

* Trying to set up appveyor for windows based CI (#3591)

* Trying to set up appveyor

* Set the path too

* Typo

* Referencing the path when installing

* Using os.sep

* Adjusted Movesets (#4306)

Added moves to Graveler, Grimer and Staryu

* Log Transfers (#4310)

missing from #4285

* Update pokemon.json (#4312)

Missing move

* Add "names" filter to apply sorting rules to selected families only (#4313)

Make sure optimizer try its best to reach the minimum evolve count if we want to use lucky eggs
Do not transfer favorite pokemon and pokemon in fort
Add database logging stuff
Update pokemon optimizer config example
Update pokemon.json

* Revert "Trying to set up appveyor for windows based CI" (#4317)

* Added default value for vip pokemon to prevent consider all pokemon as vip. (#4318)

* To fix CI build, working branch (#4319)

* To fix CI build in api_wraper.py

* added self.config is none to make CI happy.

* Add inventory hot-update to collect_level_up_reward (#4320)

* Minor fix (#4274)

* Gps noise (#3912)

* revert some unexpected changes

* added default argument to constructor to fix CI issue

* fixing wrong default value & added config example

* fixed alt issue and CI

* changed default not to use noise

* Fix diglett moveset (#4322)

* Dev merge to master, PR (#4178)

* Do not spin fort on timeout when restarting the bot (#3931)

Fix bot stuck between forts when inventory is full

* Fixed references to self.bot.config.walk (#4046)

* Fixed error

* Fixed error

* Updating run.sh and install.sh (#4033)

* Update run.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Fixing typo

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second. (#4058)

* Added heartbeat threshold, it's not reasonable to send heartbeat to server every second.

* Added example in config.

* heartbeat_threshold using time delta (#4095)

* changed hearbeat threshold to work on a delta time

* renamed variable for clarity

* tidy up

* Fixing live stats crash on first run (#4088)

* try to fix system platform in init.py (#4068)

Fix for other system we don't know but should run without problem.

* Fix get_top_rank (#3823)

Refresh inventory when opening it
Do not use rare pokemon to xp
Fix an issue when use_lucky_egg=true and evolve_only_with_lucky_egg=false
Save web inventory after refresh
Add parameter evolve_time default to 20.
Rename parameter use_candies_for_xp in evolve_for_xp
Rename parameter minimum_evolve_for_lucky_egg in evolve_count_for_lucky_egg
Rename parameter use_lucky_egg in may_use_lucky_egg
Add 1 percent rule = Do not use rare pokemon candies for xp
Handle lucky egg already active case
Plan bad Eevees for transfer if evolve is deactivated

* Enhancement/sleep schedule check if current sleep is over (#4031)

* SleepSchedule check if current sleep period is over

Enhances #2193

* Add config field "skip_current_sleep_cycle"

* Edit sample config files to include skip_current_sleep_cycle

* Remove skip_current_sleep_cycle

* Add one more check for current sleep

* MoveToMapPokemon: Replacing min_time with reachable distance calculation (#4022)

* * replacing min_time functionality of MoveToMapPokemon by a more sophisticated way of determining reachability on time

* * fixing #3609

* moving config values to top

* Make PokemonOptimizer calculate correct transfer / evolve groups (#4099)

* Humanize & better app simulation for catches (#3872)

* changed 2 second delay between retrying throws to use action_delay
minimum delay is 2 seconds

* quick randomise 2,4 or 6 secs between failed throw and next throw to simulate app better

* added config option to turn randomize_flee_duration off (default = on)

* configurable delay for throwing balls

added action_delay when changing ball or using razzberry

* moved delay for razzberry to more appropriate place

* updated config files with catch_wait_min and catch_wait_max

* updated config files with randomize_flee_duration

* grouped catch simulation and humanization settings
added settings for all catch related sleeps

* Changed the logic for randomly choosing a sleep for flee animation to something reasonable

* docs
clean up import

* re-Wording followPath to more readable, recycle_items.should_run should accept <= for min_empty_space: 0 (#4105)

* re-wording follow path, inventory should have -1 value instead of 0

* remove unused

* refactor: inventory.get_space_left should return 0 so change conditions from recycle.should_run instead

* Send bot through Tor (#4108)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Update setup.sh (#4117)

* Update run.sh (#4123)

typo

* Fixing values on UpdateLiveStatus (#4127)

* Updated wiki, explain how to use Docker under Windows (#4136)

* Bring together CatchVisiblePokemon & CatchLuredPokemon in config (#3966)

* CatchPokemon calls CatchLuredPokemon and CatchVisiblePokemon methods.

Config now only needs one catch related worker.  All catch related config including option to catch lured and/or visible can be kept with the task.

* example config

* indentation

* defaults for catch_lured/visible_pokemon

* deprecated command line options for throw parameters

* catch_throw_parameters defaults match config.json.example

* added deprecation functionality for CatchVisiblePokemon and CatchLuredPokemon

* min_ultraball_to_keep default reflects example config

* tree_config_builder_test uses CatchPokemon instead of CatchLuredPokemon

* deprecation warning message

* catchsim config moved to CatchPokemon

* updated example configs

* updated docs

* User configurable delay when spinning fort (#4109)

* user configurable delay for spin fort

* replaced time.sleep(2) with configurable delay

* updated configs

* fix followCluster & MoveToMapPokemon (#4115)

* * fixed followCluster not following lured clusters because of outdated pokestop data structure
* fixed very annoying followCluster wording (OCD senses were tickling)
* fixed #4022

* no message

* string formatting

* correcting message to display lured only when walking to lured cluster

* message formatting

* forgot to add regester event variable

* Showing detailed sleep info (#4066)

* Windows installation instructions refit (#3898)

* Delete PokemonGo-Bot-Repair.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Removed an update procedure that was making the map not to work.

* Update installation.md

Modified Windows installation instructions to use the batch files.

* Update PokemonGo-Bot-Install.bat

Added links for the configuration instructions. Still missing links for the encrypt files. Need help on it.

* Update manual_installation.md

Recreated the installations instructions for Windows.

* Update installation.md

Removed the need to download PyYAML and modified the instructions to download only the required encrypt files.

* Update manual_installation.md

Removed the requirement to download PyYAML as the installer already downloads it during git pull. Also removed the requirement to download all encrypt files.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Added a pause in the end so the promp wont close in the end if `pokecli.py` goes to error.

* Update PokemonGo-Bot-Install.bat

Added a procedure to deal with the installation path issue. Also, added a command to install protobuff automatically.

* Update installation.md

Removed the requirement to install protobuff as it will be installed automatically by the install batch.

* Update PokemonGo-Bot-Install.bat

* Update manual_installation.md

Removed the requirement for protoc and added command line to download it.

* Update PokemonGo-Bot-Install.bat

* Update PokemonGo-Bot-Start.bat

Updated in order to work anywhere as long its inside the windows_bat folder

* Update PokemonGo-Bot-Install.bat

* Update installation.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Update CONTRIBUTORS.md

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Start.bat

* Update PokemonGo-Bot-Install.bat

* Revert "Update CONTRIBUTORS.md"

This reverts commit 856a0fd.

* Revert "Delete PokemonGo-Bot-Repair.bat"

This reverts commit a459a86.

* Revert "Update PokemonGo-Bot-Start.bat"

This reverts commit 510570d.

* Revert "Update PokemonGo-Bot-Install.bat"

This reverts commit 9db2798.

# Conflicts:
#	windows_bat/PokemonGo-Bot-Install.bat

* Complete refit of all batches

We can now choose an install location and all required software is
automatically installed.

* Added contributors

Added new contributors

* Revert "Added contributors"

This reverts commit a1d364c.

* Deprecate action_wait_min/max in favour of task specific options (#4048)

* RecycleItems uses it's own recycle_wait_min/max instead of action_wait_min/max

* TransferPokemon uses it's own transfer_wait_min/max instead of action_wait_min/max

* PokemonOptimizer uses it's own transfer_wait_min/max instead of action_wait_min/max

* Deprecated action_wait_min and action_wait_max

* fixed mistake

* Update update_live_stats.py (#3985)

* SQLite backend for bot/plugin use (#4129)

* Initial attempt at implementing an SQLite backend for plugin use

* Fixed attribute error when accessing DB

* Patch snipey in move_to_map_pokemon.py (#4146)

to solve issue #4142

* Add files via upload (#4151)

* fix example config

* fix config file

* added a script to check json, and updated .travis.yml

* Update json-validate.py

* Documenting docker-compose with Tor (#4161)

* Send bot through Tor

All of the bot's API requests go through tor

* links privoxy

you gotta link if you want to reference

* keep privoxy up too

* Docker documentation update

Including example command for using the alternate tor proxy command. Additionally changed line 114 to down rather than rm so that the containers are stopped before they are removed in the case that the containers were launched in detached mode.

* Remove `,` at line 112 (#4171)

* Minor config fix (#4173)

Fixes indent

* Fix no pokeballs log spamming (#4000)

* Fix looping between equidstant pokestops

* :D

* emp

* changes

* fix no pokeballs log spamming, fix possible bug

* remove unnesscessary return

* revert pokemongo_bot/cell_workers/move_to_fort.py

* solve merge conflicts

* Remove extra whitespace

* Update pokemon.json (#4308)

confirmed

* Revert "Update pokemon.json" (#4315)

* added Mud Slap to Diglett moveset

* added Mud Slap to Golem and Tackle to Starmie (#4325)

* reordered moves alphabetically (#4331)

* reordered moves alphabetically

* removed repeated line

* Fix unicode decode error (#4334)

* Fix: Check inventory for egg incubating (#4336)

* updated movesets (#4338)

* NoPlayerPositionSetException() after re-logging in (#4364)

* Polyline, Altitude bugfix and Polyline support for MoveToFort (#4350)

* bugfix for polyline

* leftovers

* changed default value of pokecli config aswell

* added fix for #4250

* fixed spiral aswell

* original current and last are wrong...

* seems it was ok, reverted partly...

* upside down

* changed message

* cleanup & polyline support for move_to_fort

* fixed default conf to StepWalker

* Transfert pokemon only when we don't have free slots (#4344)

* Transfert pokemon only when we don't have free slots

* Update configuration file

* Added tip

* Typo

* Added PokemonBag to UpdateLiveInventory (#4360)

* Added PokemonBag to UpdateLiveInventory

* Added documentation

* setup.sh: setting exec permission to the file (#4369)

It was not possible to execute the script with
'./'.

* Bug fix for bad PokemonGo-Map response (#4370)

* bugfix for polyline

* leftovers

* changed default value of pokecli config aswell

* added fix for #4250

* fixed spiral aswell

* original current and last are wrong...

* seems it was ok, reverted partly...

* upside down

* changed message

* cleanup & polyline support for move_to_fort

* fixed default conf to StepWalker

* fixed ValueError issue

* Display current candy count after evolution and transfer (#4352)

* Added FollowPath and UpdateLiveStats Settings (#4381)

Added FollowPath and UpdateLiveStats description. The UpdateLiveStats options are taken from the source code.

* Softban/Permban Slack Notifications (#4400)

* Ban Notifications (Slack) PokemonCatchWorker

* Update requirements.txt (slack notif)

* Update pokemon_catch_worker.py

* spin_fort.py slack notifcations

* Update config.json.cluster.example

* Update config.json.example

* Update config.json.map.example

* Update config.json.optimizer.example

* Update config.json.path.example

* Update config.json.pokemon.example

* pokecli.py slack variable

* Update pokecli.py

* Update pokemon_catch_worker.py

* Update spin_fort.py

* Update pokecli.py

* Revert "Softban/Permban Slack Notifications" (#4408)

* Fixed list_pokemon at startup (#4384)

* Fixes: Evolve (#4389)

- Add parameter `candy` to `pokemon_evolved` event.

- Fix PokemonOptimizer evolve problem with `pokemon_evolved` event.

- EvolvePokemon now correctly updates inventory even if evolve_log fails.

- EvolvePokemon now emits evolved event with xp & candy.

* Minor fixes and added updates to Configuration file (#4396)

* Minor update/fix
 * Fixed bad function call at update_live_inventory.py
 * Fixed 'Total eggs' only show not incubating eggs

* Updated configuration file

* Small fix

* Small fix

* Minor fix

* Fixed typo mistake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants