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

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

Merged
merged 17 commits into from
Aug 18, 2016

Conversation

BriceSD
Copy link
Contributor

@BriceSD BriceSD commented Aug 14, 2016

Short Description:

I’m making the next step toward the new inventory integration.
I’ve deleted every call to the old one, as well as uneeded refresh call.
For now I’ve only tested the item part. I definitely need help to test these changes.

Added some messages to monitor item inventory
Added some methods needed on the new inventory
@@ -262,7 +262,8 @@ def _get_player_stats(self):
:return: The player stats object.
:rtype: dict
"""
inventory_items = self.bot.get_inventory() \
# TODO : find a better solution than calling the api
inventory_items = self.bot.api.get_inventory() \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Moonlight-Angel If you got any idea about it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@BriceSD I don't know if we can avoid calling the API for the player stats. Are they stored and correctly updated internally ? In which case we could use the internally stored info instead of calling the API.
If no such thing is available, then I guess the same kind of refactoring is necessary to get the player data once and update it internally.

Copy link
Contributor Author

@BriceSD BriceSD Aug 17, 2016

Choose a reason for hiding this comment

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

@Moonlight-Angel It doesn’t track player stats. After putting some thought in it, I think it shouldn’t after all. We don’t even make an api call each tick, making one hear is completely fine. The fact that it’s called get_inventory() confused me.

But what about moving these to metrics, I can see a use for them somewhere else :

        current_level = int(player_stats.get('level', 0))
        prev_level_xp = int(player_stats.get('prev_level_xp', 0))
        next_level_xp = int(player_stats.get('next_level_xp', 0))
        experience = int(player_stats.get('experience', 0))
        current_level_xp = experience - prev_level_xp
        whole_level_xp = next_level_xp - prev_level_xp

edit : we need some of them at start up.

self.api.activate_signature(self.get_encryption_lib())
self.logger.info('')
self.update_inventory()
#self.update_inventory()
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably best to just remove code rather than comment it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, still got some clean up to do

@julienlavergne
Copy link
Contributor

The issue now that we have full cached inventory is:

  • Your bot can be detected by renaming / transferring / evolving pokemon without ever refreshing the inventory. If it is what the mobile app is doing, then fine, otherwise you are flagged. It would be good to know what the app is doing exactly.
  • The web inventory is never updated

@@ -395,7 +395,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False):
)

# We could refresh here too, but adding 3 saves a inventory request
candy = inventory.candies(True).get(pokemon.pokemon_id)
candy = inventory.candies().get(pokemon.pokemon_id).add(3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not like that ;) candy object is used right after

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I understand it we’re printing the updated amount of candies right after. Updating it before seems legit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure you can get the exact number of awarded candies in the return API call (currently 3 but could change in the future)

Copy link
Contributor

Choose a reason for hiding this comment

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

What I mean is that the add function does not return a candy object instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anakin5 Oh I understand what you mean now

@BriceSD
Copy link
Contributor Author

BriceSD commented Aug 15, 2016

It’s right, they could know that we’re using a bot since we don’t refresh the inventory.
But this has always been the case. The bot has never make the same calls in the same order as the app. For now they don’t look at these stats to bann/softbann.

@julienlavergne
Copy link
Contributor

I consider it a defect if the bot does not do the same thing as the app.

@douglascamata
Copy link
Member

@anakin5 I consider it a defect if the bot does not do the same thing as the app.

Then we are full of defects.

We need to refresh the inventory only one single time at every tick and it's ok.

@TheSavior
Copy link
Contributor

TheSavior commented Aug 17, 2016

Are we still waiting on changes for this PR? Or is this good to go?

@BriceSD
Copy link
Contributor Author

BriceSD commented Aug 17, 2016

@TheSavior Now that I know what I want to do about UpdateLiveStats, we’re very close to it. Got few things to do, I got some refactoring in mind but that will happen in an other PR.

@BriceSD
Copy link
Contributor Author

BriceSD commented Aug 17, 2016

@TheSavior @douglascamata Should be good now

@douglascamata
Copy link
Member

@BriceSD merge conflicts :P

@solderzzc
Copy link
Contributor

Still have conflict...

@BriceSD
Copy link
Contributor Author

BriceSD commented Aug 18, 2016

I found that on PokemonCatchWorker

        is_vip = self._is_vip_pokemon(pokemon)
        if pokeballs < 1:
            if superballs < 1:
                if ultraballs < 1:
                    return WorkerResult.SUCCESS
                if not is_vip:
                   return WorkerResult.SUCCESS

If I remember well we are suppose to use ultraball on non VIP too, depending on min_ultraball_to_keep. Can someone confirm these last 2 lines shouldn’t be there ?

@solderzzc
Copy link
Contributor

@BriceSD you are right, and we already save lots of ultra ball since the new configuration.

…o remove-old-inventory

# Conflicts:
#	pokemongo_bot/__init__.py

Now move to map use cached inventory
Removed log.logger()
@BriceSD
Copy link
Contributor Author

BriceSD commented Aug 18, 2016

@solderzzc Thanks, I removed them from PokemonCatchWorker as well as MoveToMapPokemon

@solderzzc
Copy link
Contributor

@BriceSD Great, let's merge this PR in.

@solderzzc solderzzc merged commit 91ad8df into PokemonGoF:dev Aug 18, 2016
rawgni added a commit to rawgni/PokemonGo-Bot that referenced this pull request Aug 19, 2016
Switch to 12b2028cbf19342efd971020033027802b569769 of pgoapi, the latest doesn't work.

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

Add spin message (PokemonGoF#4226)

List Pokemon bag at bot start (PokemonGoF#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 (PokemonGoF#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 (PokemonGoF#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

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

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

Pokestops / Evolves / Transfers Logged to DB (PokemonGoF#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" (PokemonGoF#4239)

Hotfix/remove old inventory (PokemonGoF#4238)

* Updated configuration documentation after PokemonGoF#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 PokemonGoF#4237
Not calling old inventory to get available lucky egg count

Polyline rework (PokemonGoF#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 (PokemonGoF#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  (PokemonGoF#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
@Gobberwart
Copy link
Contributor

Gobberwart commented Aug 21, 2016

An issue from this appears to be that the inventory only updates when recycle_items runs (ie. if available space <= min_empty_space), which could be hours between refreshes depending on how your bot is configured. The inventory should update via the API run every tick, or at least every minute or so to prevent any incorrect information.

Note also that the web/inventory-USERNAME.json file only updates when the inventory refreshes, so this is effectively useless at the moment.

@Gobberwart
Copy link
Contributor

#4417

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
@BriceSD BriceSD deleted the remove-old-inventory branch August 23, 2016 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants