Skip to content

Conversation

GepLik
Copy link
Contributor

@GepLik GepLik commented Aug 2, 2016

WARNING:
The code below is safe to use.
However, I tried to test further the possibilities of the field normalized_hit_position, and, coincidence or not, couldn't log again with my account any more for 1 hour immediately after sending a weird value. If you want to proceed and modify normalized_hit_position to test randomization, be careful.

Short Description:
The code allows to modify the frequency of the various throw possibilities.
For example, with the following setting :
"catch_throw_parameters": {
"excellent_rate": 4,
"great_rate": 10,
"nice_rate": 4,
"normal_rate": 2,
"spin_success_rate" : 0.6,
}
The bot would have 4 chances out of 20 (4+10+4+2) to land an Excellent throw.
In the sample config, those value add up to 1 to look like percentage, but the user is free to set the values to what speaks most to him/her.
The spin_success_rate is a percentage of landing a successful spin. In the example above, the bot has 60% chance of landing a spin that will generate the bonus exp.

More information about the normalized_hit_position :
The code below should work safely as it doesn't contain the further tests i have tried, however my paranoid nature would ask for people to test with account they don't care about for 1 day before merging it. I will do so myself tomorrow too. Since the (unban?) I have been testing the code below, and got no further problem.
The value of 0 for normalized_hit_position is safe, as it was what we were sending before I correct the API call.
The value of 1.0 is also safe, as we used it forever.
I didn't test any values between 0 et 1.
Values above 1 seems to be what could have caused the potential temporary ban.
The last case don't happen with this code, as the value is set either to 0 or 1.

Fixes:

@GepLik GepLik changed the title Allow to change frequency of the different catch throw types Allow to customize quality of pokeball throws Aug 2, 2016
@douglascamata
Copy link
Member

@Likael please check how to put all the settings you add properly inside another key in the setup. The websocket settings are a good example.

@GepLik
Copy link
Contributor Author

GepLik commented Aug 2, 2016

@douglascamata I need your help here, I must be missing something. I can't find the websocket settings (other than the key websocket_server).
I packed all the settings under the key catch_throw_parameters. The key itself is at the base of the config, mainly because :

  • I couldn't put it in a task, as this config is used by an undeclared worker, instanced by both CatchVisiblePokemon and CatchLuredPokemon.
  • I did not wanted to put it in the Catch key, as it is used a list of pokemons with a default any and additional keys there could be confusing.

I will be happy look at the websocket settings if you can guide me to it, and revise the settings to make it look more like it.

@mhdasding mhdasding mentioned this pull request Aug 2, 2016
@douglascamata
Copy link
Member

@Likael this config:

add_config(
        parser,
        load,
        short_flag="-ws",
        long_flag="--websocket.server_url",
        help="Connect to websocket server at given url",
        default=False
    )

Automatically translates to a variable named websocket_server_url, which in the JSON configuration will be used like this:

"websocket": {
    "server_url": "my websocekt url"
}

This way you don't need any .get call or to mess with dicts. (:

@RedViper9
Copy link
Contributor

This is great! Can't wait.

Would it be possible to randomize these parameters such that Excellent throws are made 15-20% of the time, for example?

@GepLik
Copy link
Contributor Author

GepLik commented Aug 2, 2016

@douglascamata Excellent! I must have missed it. I am on it.
@RedViper9 That's exactly what it will used too :) Defining your own odds for throw quality to be used.

GepLik and others added 14 commits August 2, 2016 23:34
Added missing curly bracket to tasks>MoveToFort>config
…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
* Fix instance where evolve_all is unicode

* Test for isinstance basestring rather than Unicode || str
* 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
* 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
* 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
@GepLik
Copy link
Contributor Author

GepLik commented Aug 2, 2016

OK rebase went wrong. Will fix that tomorrow.

@GepLik
Copy link
Contributor Author

GepLik commented Aug 3, 2016

Closing pull request to reopen a new clean one

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.