PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

cpu utilization of python drifts to 100%

Open crepes11 opened this issue 10 years ago • 5 comments

Expected Behavior

The program does not need to use 100% of CPU, as i do not expect that much computation while simulating the using of Pokemon-Go.

Actual Behavior

Most of the time the cpu utilization of python is near 100%, while there are no other python programs running.

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

{ "auth_service": "ptc", "username": "xxxxxx", "password": "xxxxxx", "location": "xxxxxx", "gmapkey": "", "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, "// old syntax, still supported: alert_catch": ["all"], "// new syntax:": {}, "alert_catch": { "all": {"operator": "and", "cp": 1300, "iv": 0.95}, "Snorlax": {"operator": "or", "cp": 900, "iv": 0.9} } } }, { "//NOTE: This task MUST be placed on the top of task list": {}, "type": "RandomAlivePause", "config": { "enabled": true, "min_duration": "00:00:10", "max_duration": "00:10:00", "min_interval": "00:05:00", "max_interval": "01:30:00" } }, { "type": "HandleSoftBan" }, { "type": "RandomPause", "config": { "enabled": true, "min_duration": "00:00:10", "max_duration": "00:10:00", "min_interval": "00:10:00", "max_interval": "02:00:00" } }, { "type": "CompleteTutorial", "config": { "enabled": false, "// set a name": "", "nickname": "", "// 0 = No Team, 1 = Blue, 2 = Red, 3 = Yellow": "", "team": 0 } }, { "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": 120, "stats": ["username", "uptime", "xp_earned", "xp_per_hour", "level_stats"], "terminal_log": true, "terminal_title": false } }, { "type": "UpdateLiveInventory", "config": { "enabled": false, "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": 300, "amount": 10, "order_by": "cp", "info_to_show": ["cp", "ivcp", "dps", "hp"] } }, { "type": "TransferPokemon", "config": { "enabled": true, "min_free_slot": 50, "transfer_wait_min": 3, "transfer_wait_max": 5 } }, { "type": "NicknamePokemon", "config": { "enabled": true, "nickname_above_iv": 0.9, "nickname_template": "{name:.8s}_{iv_pct}", "nickname_wait_min": 6, "nickname_wait_max": 10 } }, { "type": "EvolvePokemon", "config": { "enabled": true, "evolve_all": "Pidgey,Weedle,Rattata,Spearow,Zubat", "first_evolve_by": "cp", "evolve_above_cp": 9, "evolve_above_iv": 0.01, "logic": "or", "min_evolve_speed": 25, "max_evolve_speed": 30, "use_lucky_egg": false } }, { "type": "UseIncense", "config": { "use_incense": false, "use_order": [ "ordinary", "spicy", "cool", "floral" ] } }, { "type": "RecycleItems", "config": { "enabled": true, "min_empty_space": 250, "max_balls_keep": 100, "max_potions_keep": 20, "max_berries_keep": 40, "max_revives_keep": 30, "item_filter": { "Pokeball": { "keep" : 100 }, "Potion": { "keep" : 10 }, "Super Potion": { "keep" : 20 }, "Hyper Potion": { "keep" : 30 }, "Revive": { "keep" : 30 }, "Razz Berry": { "keep" : 100 } }, "recycle_wait_min": 3, "recycle_wait_max": 5, "recycle_force": true, "recycle_force_min": "00:01:00", "recycle_force_max": "00:05:00" } }, { "type": "CatchPokemon", "config": { "enabled": true, "catch_visible_pokemon": true, "catch_lured_pokemon": true, "min_ultraball_to_keep": 5, "berry_threshold": 0.35, "vip_berry_threshold": 0.9, "treat_unseen_as_vip": true, "daily_catch_limit": 800, "vanish_settings": { "consecutive_vanish_limit": 10, "rest_duration_min": "02:00:00", "rest_duration_max": "04:00:00" }, "catch_throw_parameters": { "excellent_rate": 0.1, "great_rate": 0.5, "nice_rate": 0.3, "normal_rate": 0.1, "spin_success_rate" : 0.9, "hit_rate": 0.9 }, "catch_simulation": { "flee_count": 3, "flee_duration": 2, "catch_wait_min": 3, "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, "daily_spin_limit": 800 } }, { "type": "UpdateWebInventory", "config": { "enabled": false } }, { "type": "MoveToFort", "config": { "enabled": true, "lure_attraction": true, "lure_max_distance": 2000, "walker": "StepWalker", "log_interval": 5 } }, { "type": "FollowSpiral", "config": { "enabled": true, "diameter": 4, "step_size": 70 } } ], "map_object_cache_time": 5, "forts": { "avoid_circles": true, "max_circle_size": 50, "cache_recent_forts": true }, "pokemon_bag": { "show_at_start": true, "show_candies": true, "pokemon_info": ["cp", "iv_pct"] }, "walk_max": 8.16, "walk_min": 2.16, "alt_min": 500, "alt_max": 1000, "sleep_schedule": [ { "time": "03:00", "duration": "5:30", "time_random_offset": "00:30", "duration_random_offset": "00:30", "wake_up_at_location": "" } ], "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, "show_datetime": true, "show_process_name": true, "show_log_level": true, "show_thread_name": false }, "catch": { "any": {"candy_threshold" : 40000 ,"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"}, "// Example of always catching Rattata:": {}, "// Rattata": { "always_catch" : true } }, "release": { "any": {"keep_best_iv": 2}, "Kakuna": {"always_release": true}, "Pidgeotto": {"always_release": true}, "Raticate": {"always_release": true}, "Golbat": {"always_release": true}, "Fearow": {"always_release": true} }, "vips" : { "Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate": {}, "any": {"catch_above_cp": 1200, "catch_above_iv": 0.9, "logic": "or" }, "Lapras": {}, "Moltres": {}, "Zapdos": {}, "Articuno": {},

    "// S-Tier pokemons (if pokemon can be evolved into tier, list the representative)": {},
    "Mewtwo": {},
    "Dragonite": {},
    "Snorlax": {},
    "// Mew evolves to Mewtwo": {},
    "Mew": {},
    "Arcanine": {},
    "Vaporeon": {},
    "Gyarados": {},
    "Exeggutor": {},
    "Muk": {},
    "Weezing": {},
    "Flareon": {}
}

}

Output when issue occurred

No special output of pokemon-go-bot. Output after typing "top" in another terminal window shows that python has a utilization of 100%. There are no other python programs running besides.

Steps to Reproduce

starting the pokemon go bot. (I reinstalled the newest version today at noon.) open another terminal. type in "top". enter.

Other Information

OS: ubuntu 14.04 Branch: master Git Commit: (cd to PokemonGo-Bot directory, then typing 'git log -n 1 --pretty=format:"%H"' yields: 11123a82cb18c172a262dc9e46e7b2c175666828 Python Version: 2.7.6

EDIT: changed the 'actual behaviour' EDIT2: addet the full config.json

crepes11 avatar Sep 09 '16 13:09 crepes11

That happend to me too. To fixit I set to false enable_social, and delete the part at the end of the websocket. That did work for me, I don't know what it does, but it works. Now it use about 20% of cpu.

jmarenas avatar Sep 09 '16 22:09 jmarenas

To fixit I set to false enable_social, and delete the part at the end of the websocket.

Interesting. I found a memory leak (#5317) that is also fixed by this. There's something seriously wrong with those config options.

mesvam avatar Sep 10 '16 01:09 mesvam

@mesvam Could connect to broker via telnet?

telnet broker.pikabot.org 1883

sohje avatar Sep 10 '16 01:09 sohje

@sohje Not sure what you're referring to. Is this what you're looking for?

$ telnet broker.pikabot.org 1883
Trying 51.254.124.174...
Connected to broker.pikabot.org.
Escape character is '^]'.

What's broker.pikabot.org supposed to do?

mesvam avatar Sep 10 '16 06:09 mesvam

Stale. Closed.

Gobberwart avatar Sep 22 '16 05:09 Gobberwart