PokemonGoF / PokemonGo-Bot

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

Connect to Broker when social is disabled #5741

Closed uzzle1987 closed 8 years ago

uzzle1987 commented 8 years ago

I disabled the social feature, but the Bot tries to connect with broker.pikabot.org. Why?

Expected Behavior

The Bot does not connect to the Broker when I disable the social feature

Actual Behavior

It connects and causes an exception

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

{ "websocket_server": false, "heartbeat_threshold": 10, "enable_social": false, "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": 3 } }, { "type": "CollectLevelUpReward", "config": { "collect_reward": true, "level_limit": -1 } }, { "type": "BuddyPokemon", "config": { "enabled": true, "buddy_list": "dratini, magikarp", "best_in_family": true, "// candy_limit = 0 means no limit, so it will never change current buddy": {}, "candy_limit": 0, "// force_first_change = true will always change buddy at start removing current one": {}, "force_first_change": false, "buddy_change_wait_min": 3, "buddy_change_wait_max": 5, "min_interval": 120 } }, { "type": "IncubateEggs", "config": { "enabled": true, "infinite_longer_eggs_first": false, "breakable_longer_eggs_first": true, "min_interval": 120, "infinite": [2,5,10], "breakable": [10] } }, { "type": "UpdateLiveStats", "config": { "enabled": true, "min_interval": 30, "stats": ["username", "uptime", "stardust_earned", "xp_earned", "xp_per_hour", "stops_visited"], "terminal_log": true, "terminal_title": true } }, { "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": false, "min_interval": 60, "amount": 5, "order_by": "cp", "info_to_show": ["cp", "ivcp", "dps", "hp"] } }, { "type": "TransferPokemon", "config": { "enabled": true, "min_free_slot": 5, "transfer_wait_min": 3, "transfer_wait_max": 5 } }, { "type": "NicknamePokemon", "config": { "enabled": false, "nickname_above_iv": 0.9, "nickname_template": "{ivpct}{iv_ads}", "nickname_wait_min": 3, "nickname_wait_max": 5 } }, { "type": "EvolvePokemon", "config": { "enabled": true, "evolve_list": "all", "donot_evolve_list": "none",

      "first_evolve_by": "cp",
      "evolve_above_cp": 0,
      "evolve_above_iv": 0,
      "logic": "or",
      "min_evolve_speed": 25,
      "max_evolve_speed": 30,
      "min_pokemon_to_be_evolved": 1,
      "use_lucky_egg": false
    }
  },
  {
    "type": "UseIncense",
    "config": {
      "use_incense": true,
      "use_order": [
        "ordinary",
        "spicy",
        "cool",
        "floral" 
      ]
    }
  },
  {
    "type": "RecycleItems",
    "config": {
      "enabled": true,
      "min_empty_space": 15,
      "max_balls_keep": 80,
      "max_potions_keep": 6,
      "max_berries_keep": 10,
      "max_revives_keep": 6,
      "item_filter": {
        "Pokeball":       { "keep" : 40 },
        "Greatball":      { "keep" : 30 },
        "Ultraball":      { "keep" : 30 },
        "Potion":         { "keep" : 0 },
        "Super Potion":   { "keep" : 0 },
        "Hyper Potion":   { "keep" : 0 },
        "Max Potion":     { "keep" : 10 },
        "Revive":         { "keep" : 0 },
        "Max Revive":     { "keep" : 10 },
        "Razz Berry":     { "keep" : 15 }
      },
      "recycle_wait_min": 3,
      "recycle_wait_max": 5,
      "recycle_force": true,
      "recycle_force_min": "00:10:00",
      "recycle_force_max": "01:00:00"
   }
  },
  {
    "type": "CatchLimiter",
    "config": {
      "enabled": true,
      "min_balls": 20,
      "duration": 15
    }
  },
  {
    "type": "Sniper",
    "config": {
        "enabled": false,
        "mode": "url",
        "bullets": 1,
        "homing_shots": true,
        "special_iv": 100,
        "order": ["missing", "vip", "priority"],
        "sources": [
            {
                "enabled": false,
                "url": "http://localhost:5000/raw_data",
                "timeout": 3,
                "key": "pokemons",
                "mappings": {
                    "id": { "param": "pokemon_id" },
                    "name": { "param": "pokemon_name" },
                    "latitude": { "param": "latitude" },
                    "longitude": { "param": "longitude" },
                    "expiration": { "param": "disappear_time", "format": "milliseconds" }
                }
            },
            {
                "enabled": true,
                "url": "https://pokewatchers.com/grab/",
                "timeout": 10,
                "mappings": {
                    "iv": { "param": "iv" },
                    "id": { "param": "pid" },
                    "name": { "param": "pokemon" },
                    "latitude": { "param": "cords" },
                    "longitude": { "param": "cords" },
                    "expiration": { "param": "timeend", "format": "milliseconds" }
                }
            },
            {
                "enabled": true,
                "url": "http://pokesnipers.com/api/v1/pokemon.json",
                "timeout": 10,
                "key": "results",
                "mappings": {
                    "iv": { "param": "iv" },
                    "name": { "param": "name" },
                    "latitude": { "param": "coords" },
                    "longitude": { "param": "coords" },
                    "expiration": { "param": "until", "format": "utc" }
                }
            }
        ],
        "catch": {
            "Snorlax": 1000,
            "Dragonite": 1000,
            "Growlithe": 600,
            "Clefairy": 500,
            "Kabuto": 500,
            "Dratini": 500,
            "Dragonair": 500,
            "Mr. Mime": 500,
            "Magmar": 500,
            "Electabuzz": 500,
            "Tangela": 500,
            "Tauros": 500,
            "Primeape": 500,
            "Chansey": 500,
            "Pidgey": 100,
            "Caterpie": 100,
            "Weedle": 100
        }
    }
  },
  {
    "type": "CatchPokemon",
    "config": {
      "enabled": true,
      "catch_visible_pokemon": true,
      "catch_lured_pokemon": true,
      "catch_incensed_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.6,
        "hit_rate": 0.75
      },
      "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": 1900
    }
  },
  { "type": "UpdateWebInventory",
    "config": {
      "enabled": true
    }
  },
  {
    "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": {
  "// if 'show_at_start' is true, it will log all the pokemons in the bag (not eggs) at bot start": {},
  "show_at_start": false,
  "// 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": 4.16,
"walk_min": 2.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": false,
"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" : 500 ,"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
  "// Example of always catching Rattata:": {},
  "// Rattata": { "always_catch" : true }
},
"release": {
  "any": {"keep_best_cp": 2}
},
"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

Traceback (most recent call last): File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokecli.py", line 843, in main() File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokecli.py", line 202, in main bot.tick() File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_botinit.py", line 756, in tick if worker.work() == WorkerResult.RUNNING: File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\cell_workers\catch_pokemon.py", line 47, in work if self.catch_pokemon(self.pokemon.pop()) == WorkerResult.ERROR: File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\cell_workers\catch_pokemon.py", line 159, in catch_pokemon return_value = worker.work() File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\cell_workers\pokemon_catch_worker.py", line 211, in work self._do_catch(pokemon, encounter_id, catch_rate_by_ball, is_vip=is_vip) File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\cell_workers\pokemon_catch_worker.py", line 735, in _do_catch action_delay(self.catchsim_catch_wait_min, self.catchsim_catch_wait_max) File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\human_behaviour.py", line 20, in action_delay time.sleep(shortNum) File "C:\Python27\lib\site-packages\eventlet\greenthread.py", line 34, in sleep hub.switch() File "C:\Python27\lib\site-packages\eventlet\hubs\hub.py", line 294, in switch return self.greenlet.switch() File "C:\Python27\lib\site-packages\eventlet\hubs\hub.py", line 346, in run self.wait(sleep_time) File "C:\Python27\lib\site-packages\eventlet\hubs\selects.py", line 50, in wait writers.get(fileno, noop).cb(fileno) File "C:\Python27\lib\site-packages\eventlet\green\thread.py", line 41, in __thread_body func(_args, *_kwargs) File "C:_COMED\priv\PoGo\PokemonGo-Bot\pokemongo_bot\event_handlers\social_handler.py", line 86, in run self._mqttc.connect("broker.pikabot.org", 1883, 20) File "C:\Python27\lib\site-packages\paho\mqtt\client.py", line 686, in connect return self.reconnect() File "C:\Python27\lib\site-packages\paho\mqtt\client.py", line 808, in reconnect sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "C:\Python27\lib\site-packages\eventlet\green\socket.py", line 63, in create_connection raise err socket.error: [Errno 10060] WSAETIMEDOUT

Other Information

OS: windows Branch: dev Git Commit: f65b063762384d97c5195a55db1b8257ba6cddee Python Version: 2.7.12

YvesHenri commented 8 years ago

You will always connect to the broker server in order to send your pokemon catches to help the community. Chosing whether to enable or disable the social_enabled flag will only impact on the MoveToMapPokemon task.