PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.87k stars 1.54k forks source link

Pokemon capture percentage inaccurate/confusing. #4836

Closed hobbes3 closed 8 years ago

hobbes3 commented 8 years ago

Expected Behavior

If the chance to capture a pokemon is over 100% then it should always capture.

Actual Behavior

It still misses sometimes.

Your FULL config.json (remove your username, password, gmapkey and any other private info)

{
    "auth_service": "ptc",
    "username": "xxx",
    "password": "xxx",
    "location": "37.795614,-122.393536",
    "favorite_locations":[
        {"name": "San Francisco", "coords": "37.759234,-122.421307"}
    ],
    "gmapkey": "xxx",
    "encrypt_location": "",
    "websocket_server": false,
    "heartbeat_threshold": 10,
    "enable_social": true,
    "live_config_update": {
    "enabled": false,
    "tasks_only": false
    },
    "tasks": [
    {
        "type": "TelegramTask",
        "config": {
        "enabled": false,
        "master": null,
        "alert_catch": ["all"]
        }
    },
    {
        "//NOTE: This task MUST be placed on the top of task list": {},
        "type": "RandomAlivePause",
        "config": {
        "enabled": true,
        "min_duration": "00:00:03",
        "max_duration": "00:03:00",
        "min_interval": "00:08:00",
        "max_interval": "01:30:00"
        }
    },
    {
        "type": "HandleSoftBan"
    },
    {
        "type": "RandomPause",
        "config": {
        "enabled": true,
        "min_duration": "00:00:10",
        "max_duration": "00:02:00",
        "min_interval": "00:10:00",
        "max_interval": "02:00:00"
        }
    },
    {
        "type": "CompleteTutorial",
        "config": {
        "enabled": true,
        "// set a name": "",
        "nickname": "hobbes3k"
        }
    },
    {
        "type": "CollectLevelUpReward",
        "config": {
        "collect_reward": true,
        "level_limit": -1
        }
    },
    {
        "type": "IncubateEggs",
        "config": {
        "enabled": true,
        "infinite_longer_eggs_first": false,
        "breakable_longer_eggs_first": true,
        "min_interval": 120,
        "infinite": [2,5,10],
        "breakable": [2,5,10]
        }
    },
    {
        "type": "UpdateLiveStats",
        "config": {
        "enabled": true,
        "min_interval": 10,
        "stats": ["username", "uptime", "stardust_earned", "xp_earned", "xp_per_hour", "stops_visited"],
        "terminal_log": true,
        "terminal_title": true
        }
    },
    {
        "type": "UpdateLiveInventory",
        "config": {
        "enabled": true,
        "min_interval": 120,
        "show_all_multiple_lines": false,
        "items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]
        }
    },
    {
        "type": "ShowBestPokemon",
        "config": {
        "enabled": true,
        "min_interval": 60,
        "amount": 5,
        "order_by": "cp",
        "info_to_show": ["cp", "ivcp", "dps", "hp"]
        }
    },
    {
        "type": "TransferPokemon",
        "config": {
        "enabled": true,
        "min_free_slot": 9999,
        "transfer_wait_min": 3,
        "transfer_wait_max": 5
        }
    },
    {
        "type": "NicknamePokemon",
        "config": {
        "enabled": true,
        "nickname_above_iv": 0.89,
        "nickname_template": "{iv_pct}_{iv_ads}"
        }
    },
    {
        "type": "EvolvePokemon",
        "config": {
        "enabled": false,
        "evolve_all": "Caterpie,Ekans,Goldeen,Krabby,Pidgey,Rattata,Psyduck,Paras,Spearow,Tentacool,Weedle,Zubat",
        "first_evolve_by": "iv",
        "evolve_above_cp": 0,
        "evolve_above_iv": 0,
        "logic": "or",
        "min_evolve_speed": 20,
        "max_evolve_speed": 25,
        "use_lucky_egg": true
        }
    },
    {
        "type": "RecycleItems",
        "config": {
        "enabled": true,
        "min_empty_space": 20,
        "max_balls_keep": 300,
        "max_potions_keep": 20,
        "max_berries_keep": 100,
        "max_revives_keep": 10,
        "item_filter": {
            "Pokeball":     { "keep" : 100 },
            "Greatball":    { "keep" : 100 },
            "Potion":       { "keep" : 0 },
            "Super Potion": { "keep" : 0 },
            "Hyper Potion": { "keep" : 0 },
            "Max Potion":   { "keep" : 20 },
            "Revive":       { "keep" : 0 },
            "Max Revive":   { "keep" : 10 },
            "Razz Berry":   { "keep" : 100 }
        },
        "recycle_wait_min": 3,
        "recycle_wait_max": 5,
        "recycle_force": true,
        "recycle_force_min": "00:20:00",
        "recycle_force_max": "00:30:00"
        }
    },
    {
        "type": "CatchPokemon",
        "config": {
        "enabled": true,
        "catch_visible_pokemon": true,
        "catch_lured_pokemon": true,
        "min_ultraball_to_keep": 10,
        "berry_threshold": 0.35,
        "vip_berry_threshold": 0.9,
        "treat_unseen_as_vip": true,
        "daily_catch_limit": 999999,
        "catch_throw_parameters": {
            "excellent_rate": 0.3,
            "great_rate": 0.5,
            "nice_rate": 0.2,
            "normal_rate": 0.1,
            "spin_success_rate" : 0.8,
            "hit_rate": 0.85
        },
        "catch_simulation": {
            "flee_count": 3,
            "flee_duration": 2,
            "catch_wait_min": 2,
            "catch_wait_max": 6,
            "berry_wait_min": 3,
            "berry_wait_max": 5,
            "changeball_wait_min": 3,
            "changeball_wait_max": 5,
            "newtodex_wait_min": 20,
            "newtodex_wait_max": 30
        }
        }
    },
    {
        "type": "SpinFort",
        "config": {
        "enabled": true,
        "spin_wait_min": 3,
        "spin_wait_max": 5
        }
    },
    { "type": "UpdateWebInventory",
        "config": {
        "enabled": true
        }
    },
    {
        "type": "MoveToFort",
        "config": {
        "enabled": false,
        "lure_attraction": true,
        "lure_max_distance": 2000,
        "walker": "StepWalker",
        "log_interval": 5
        }
    },
    {
        "type": "FollowSpiral",
        "config": {
        "enabled": false,
        "diameter": 4,
        "step_size": 70
        }
    },
    {
        "type": "FollowPath",
        "config": {
        "enabled": true,
        "walker": "StepWalker",
        "path_mode": "loop",
        "path_start_mode": "first",
        "path_file": "configs/path.json",
        "number_lap": 10,
        "timer_restart_min": "00:10:00",
        "timer_restart_max": "00:20:00"
        }
    }
    ],
    "map_object_cache_time": 5,
    "forts": {
    "avoid_circles": true,
    "max_circle_size": 50,
    "cache_recent_forts": true
    },
    "pokemon_bag": {
    "// if 'show_at_start' is true, it will log all the pokemons in the bag (not eggs) at bot start": {},
    "show_at_start": true,
    "// if 'show_count' is true, it will show the amount of each pokemon (minimum 1)": {},
    "show_count": false,
    "// if 'show_candies' is true, it will show the amount of candies for each pokemon": {},
    "show_candies": false,
    "// 'pokemon_info' parameter define which info to show for each pokemon": {},
    "// the available options are": {},
    "// ['cp', 'iv_ads', 'iv_pct', 'ivcp', 'ncp', 'level', 'hp', 'moveset', 'dps']": {},
    "pokemon_info": ["cp", "iv_pct"]
    },
    "walk_max": 8.16,
    "walk_min": 3.16,
    "alt_min": 500,
    "alt_max": 1000,
    "gps_default_altitude": 8.0,
    "replicate_gps_xy_noise": false,
    "replicate_gps_z_noise": false,
    "gps_xy_noise_range": 0.000125,
    "gps_z_noise_range": 12.5,
    "debug": false,
    "test": false,
    "walker_limit_output": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "logging_color": true,
    "catch": {
    "any": { "always_catch": true }
    },
    "release": {
    "any": { "release_below_cp": 0, "release_below_iv": 0.9, "logic": "or" },

    "Articuno": { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Lapras":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Mew":      { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Mewtwo":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Moltres":  { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Snorlax":  { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Zapdos":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },

    "Caterpie":  { "keep_best_iv": 20 },
    "Goldeen":   { "keep_best_iv": 5 },
    "Krabby":    { "keep_best_iv": 5 },
    "Pidgey":    { "keep_best_iv": 60 },
    "Rattata":   { "keep_best_iv": 10 },
    "Spearow":   { "keep_best_iv": 10 },
    "Psyduck":   { "keep_best_iv": 45 },
    "Tentacool": { "keep_best_iv": 10 },
    "Weedle":    { "keep_best_iv": 20 },
    "Zubat":     { "keep_best_iv": 20 }
    },
    "vips" : {
        "Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
        "any": {"catch_above_cp": 500, "catch_above_iv": 0.9, "logic": "and" },
        "Abra": {},
        "Arcanine": {},
        "Articuno": {},
        "Bellsprout": {},
        "Blastoise": {},
        "Bulbasaur": {},
        "Charizard": {},
        "Charmander": {},
        "Charmeleon": {},
        "Dragonair": {},
        "Dragonite": {},
        "Dratini": {},
        "Eevee": {},
        "Exeggcute": {},
        "Exeggutor": {},
        "Flareon": {},
        "Growlithe": {},
        "Gyarados": {},
        "Ivysaur": {},
        "Kadabra": {},
        "Lapras": {},
        "Mew": {},
        "Mewtwo": {},
        "Moltres": {},
        "Snorlax": {},
        "Squirtle": {},
        "Vaporeon": {},
        "Venusaur": {},
        "Wartortle": {},
        "Zapdos": {}
    }
}

Output when issue occurred

2016-08-28 02:17:49,494 [CatchPokemon] [INFO] [lured_pokemon_found] Lured pokemon at fort Rincon Park Turtle (4cfe5f9e5c9f4670a9425e2607b32a01.16)
2016-08-28 02:17:49,789 [PokemonCatchWorker] [INFO] [pokemon_appeared] A wild Charmander appeared! [CP 665] [NCP 0.7] [Potential 0.47] [A/D/S 3/3/15]
2016-08-28 02:17:52,790 [PokemonCatchWorker] [INFO] [vip_pokemon] This is a VIP pokemon. Catch!!!
2016-08-28 02:17:56,940 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 16.98
2016-08-28 02:18:04,145 [PokemonCatchWorker] [INFO] [threw_pokeball] Great throw! Used Ultraball, with chance 32.03 (150 left)
2016-08-28 02:18:04,293 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:18:11,073 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 25.46
2016-08-28 02:18:18,630 [PokemonCatchWorker] [INFO] [threw_pokeball] Great Curveball throw! Used Ultraball, with chance 48.05 (149 left)
2016-08-28 02:18:18,884 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:18:28,100 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 38.20
2016-08-28 02:18:34,810 [PokemonCatchWorker] [INFO] [threw_pokeball] Great Curveball throw! Used Ultraball, with chance 72.07 (148 left)
2016-08-28 02:18:35,051 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:18:40,798 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 57.29
2016-08-28 02:18:51,690 [PokemonCatchWorker] [INFO] [threw_pokeball] Great Curveball throw! Used Ultraball, with chance 108.10 (147 left)
2016-08-28 02:18:51,928 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:18:58,145 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 85.94
2016-08-28 02:19:07,451 [PokemonCatchWorker] [INFO] [threw_pokeball] Great Curveball throw! Used Greatball, with chance 125.19 (2 left)
2016-08-28 02:19:07,665 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:19:19,681 [PokemonCatchWorker] [INFO] [threw_berry] Threw a Razz Berry! Catch rate with Pokeball is now: 128.91
2016-08-28 02:19:23,132 [PokemonCatchWorker] [INFO] [threw_pokeball] OK throw! Used Pokeball, with chance 128.91 (3 left)
2016-08-28 02:19:23,316 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:19:29,334 [PokemonCatchWorker] [INFO] [threw_pokeball] Excellent Curveball throw! Used Pokeball, with chance 128.91 (2 left)
2016-08-28 02:19:29,634 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:19:40,164 [PokemonCatchWorker] [INFO] [threw_pokeball] Excellent Curveball throw! Used Pokeball, with chance 128.91 (1 left)
2016-08-28 02:19:40,303 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:19:48,139 [PokemonCatchWorker] [INFO] [threw_pokeball] Excellent Curveball throw! Used Pokeball, with chance 128.91 (0 left)
2016-08-28 02:19:48,275 [PokemonCatchWorker] [INFO] [pokemon_capture_failed] Charmander capture failed.. trying again!
2016-08-28 02:19:55,119 [PokemonCatchWorker] [INFO] [threw_pokeball] Nice Curveball throw! Used Greatball, with chance 187.79 (1 left)
2016-08-28 02:19:55,267 [PokemonCatchWorker] [INFO] [pokemon_caught] Captured Charmander! [CP 665] [NCP 0.7] [Potential 0.47] [3/3/15] (690/999999) [+120 exp]
2016-08-28 02:19:55,269 [PokemonCatchWorker] [INFO] [gained_candy] You now have 259 Charmander candy!

Steps to Reproduce

Wait until a wild Pokemon appears.

Other Information

OS: Debian 8.1

Branch: dev Git Commit: 81384b35eed8f94eb845a6189e0e926873e4bcd2 Python Version: 2.7.12 Any other relevant files/configs (eg: path files)
Gobberwart commented 8 years ago

You'd think so, but I'd guess there's still random chance of failure, even if it's 100%. A critical miss if you like. Basically, your stats say you have 100% but there's still always some chance you'll screw it up.

Gobberwart commented 8 years ago

Although... it looks like it's stacking berries and it shouldn't be. Once a berry is "used" (ie. after you throw berry followed by ball) it should reset, not keep increasing chance.

hobbes3 commented 8 years ago

Also a few more weird things:

  1. It stopped using Ultraballs and used Great balls (even though I had over 100 Ultraballs left but only a few Greatballs left)
  2. It stopped throwing a Razz berry after a while.
Jasperrr91 commented 8 years ago

Yes, the order of the used balls is weird. This is because the script finds the best ball to catch the pokemon. What happens is this: The chance is multiplied to 128%. So the scripts things that using a normal pokeball still gives you a higher than 100% chance, thus uses a normal pokeball instead of wasting an ultra ball.

The reason the berry isn't used it because your chance of catching is above the ideal_catch_rate_before_throw. Because the incorrect repeated multiplier. I'll work on this.

mjmadsen commented 8 years ago

Merged to dev