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

max_sniping_distance

Open kenkclam opened this issue 10 years ago • 2 comments

===============ISSUE SECTION===============

Expected Behaviour

I updated to the latest release. Ran the bot and it stopped within one minute with no obvious trigger. Here is the error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte 2016-08-31 10:01:28,255 [sentry.errors.uncaught] [ERROR] [u"KeyError: 'max_sniping_distance'", u' File "pokecli.py", line 781, in ', u' File "pokecli.py", line 139, in main', u' File "pokemongo_bot/init.py", line 658, in tick', u' File "pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 315, in work', u' File "pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 141, in get_pokemon_from_social'] Wed Aug 31 10:01:28 CEST 2016 Pokebot configs/config.json Stopped.

Actual Behaviour

Here is the log when the bot stopped

2016-08-31 10:01:26,727 [MoveToFort] [INFO] [moving_to_fort] Moving towards pokestop Münster Brunnen - 0.08km 2016-08-31 10:01:28,227 [ cli] [INFO] 2016-08-31 10:01:28,227 [ cli] [INFO] Ran for 0:00:48 2016-08-31 10:01:28,227 [ cli] [INFO] Total XP Earned: 50 Average: 3738.88/h 2016-08-31 10:01:28,228 [ cli] [INFO] Travelled 0.00km 2016-08-31 10:01:28,228 [ cli] [INFO] Visited 1 stops 2016-08-31 10:01:28,228 [ cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before () 2016-08-31 10:01:28,228 [ cli] [INFO] Threw 0 pokeballs 2016-08-31 10:01:28,228 [ cli] [INFO] Earned 0 Stardust 2016-08-31 10:01:28,228 [ cli] [INFO] Hatched eggs 0 2016-08-31 10:01:28,228 [ cli] [INFO] Next egg hatches in 0.76 km 2016-08-31 10:01:28,228 [ cli] [INFO] 2016-08-31 10:01:28,228 [ cli] [INFO] Highest CP Pokemon: 2016-08-31 10:01:28,228 [ cli] [INFO] Most Perfect Pokemon: Traceback (most recent call last): File "pokecli.py", line 781, in main() File "pokecli.py", line 139, in main bot.tick() File "/Users/KenLam/PokemonGo-Bot/pokemongo_bot/init.py", line 658, in tick if worker.work() == WorkerResult.RUNNING: File "/Users/KenLam/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 315, in work pokemon_list = self.get_pokemon_from_social() File "/Users/KenLam/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 141, in get_pokemon_from_social if pokemon['dist'] > self.config['max_sniping_distance'] and self.config['snipe']: KeyError: 'max_sniping_distance' 2016-08-31 10:01:28,249 [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 891, in _send_output msg += message_body File "/Users/KenLam/PokemonGo-Bot/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte 2016-08-31 10:01:28,255 [sentry.errors.uncaught] [ERROR] [u"KeyError: 'max_sniping_distance'", u' File "pokecli.py", line 781, in ', u' File "pokecli.py", line 139, in main', u' File "pokemongo_bot/init.py", line 658, in tick', u' File "pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 315, in work', u' File "pokemongo_bot/cell_workers/move_to_map_pokemon.py", line 141, in get_pokemon_from_social'] Wed Aug 31 10:01:28 CEST 2016 Pokebot configs/config.json Stopped. Press any button or wait 20 seconds to continue.

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

Here is my config file

"libencrypt_location": "",
"websocket_server": true,
"heartbeat_threshold": 13,

"tasks": [
  {
    "//NOTE: This task MUST be placed on the top of task list": {},
    "type": "RandomAlivePause",
    "config": {
      "enabled": true,
      "min_duration": "00:01:10",
      "max_duration": "00:5:00",
      "min_interval": "00:5:00",
      "max_interval": "00:25:00"
    }
  },
  {
    "type": "RandomPause",
    "config": {
      "enabled": true,
      "min_duration": "00:9:10",
      "max_duration": "00:24:00",
      "min_interval": "00:18:00",
      "max_interval": "00:48:00"
    }
  },
  {
    "type": "CompleteTutorial",
    "config": {
      "enabled": false,
      "// set a name": "",
      "nickname": ""
    }
  },
  {
    "type": "MoveToMapPokemon",
    "config": {
      "address": "http://localhost:5000",
      "max_distance": 500,
      "min_time": 10,
      "min_ball": 20,
      "prioritize_vips": true,
      "snipe": true,
      "snipe_high_prio_only": true,
      "snipe_high_prio_threshold": 1150,
      "update_map": false,
      "map_path": "raw_data",
      "walker": "StepWalker",
      "mode": "priority",
      "catch": {
        "Poliwag": 10,
        "Nidoran F": 10,
        "Nidoran M": 10,
        "Clefairy": 15,
        "Bellsprout": 10,
        "Slowpoke": 10,
        "Eevee": 20,
        "Oddish": 20,
        "Geodude": 50,
        "Abra": 50,
        "Diglett": 100,
        "Vulpix": 100,
        "Kabuto": 100,
        "Muk": 300,
        "Poliwrath": 200,
        "Golem": 200,
        "Weezing": 300,
        "Electrode": 300,
        "Primeape": 300,
        "Mr-mimi": 1000,
        "Chansey": 1000,
        "Alakazam": 600,
        "Omastar": 500,
        "Kabutops": 500,
        "Raichu": 600,
        "Tauros": 500,
        "Dugtrio": 500,
        "Bulbasaur": 400,
        "Charmander": 500,
        "Charmeleon": 600,
        "Squirtle": 300,
        "Pikachu": 600,
        "Growlithe": 400,
        "Machop": 300,
        "Grimer": 200,
        "Exeggcute": 500,
        "Omanyte": 100,
        "Koffing": 200,
        "Dratini": 600,
        "Lapras": 1000,
        "Electabuzz": 1000,
        "Magmar": 600,
        "Ditto": 900,
        "Arcanine": 980,
        "Machamp": 700,
        "Blastoise": 980,
        "Venusaur": 1100,
        "Charizard": 1100,
        "Slowbro": 300,
        "Nidoqueen": 150,
        "Nidoking": 150,
        "Clefable": 100,
        "Victreebel": 200,
        "Jolteon": 200,
        "Magneton": 100,
        "Gengar": 100,
        "Machoke": 80,
        "Vileplume": 400,
        "Exeggutor": 1200,
        "Aerodactyl": 600,
        "Snorlax": 1200,
        "Articuno": 1200,
        "Zapdos": 1300,
        "Moltres": 1300,
        "Dragonair": 800,
        "Dragonite": 1200,
        "Mewtwo": 1300,
        "Mew": 1300
      }
    }
  },
  {
    "type": "HandleSoftBan"
  },
  {
    "type": "CollectLevelUpReward"
  },
  {
    "type": "IncubateEggs",
    "config": {
      "longer_eggs_first": true
    }
  },
  {
    "type": "UpdateLiveInventory",
    "config": {
      "enabled": true,
      "min_interval": 1200,
      "show_all_multiple_lines": false,
      "items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries"]
    }
  },
  {
   "type": "TransferPokemon",
   "config": {
   "min_free_slot": 5,
   "transfer_wait_min": 1,
   "transfer_wait_max": 4
  }
  },
  {
    "type": "EvolvePokemon",
    "config": {
      "enabled": true,

        "// evolve only pidgey and drowzee": "",
        "// evolve_list": "pidgey, drowzee",
        "// donot_evolve_list": "none",

        "// evolve all but pidgey and drowzee": "",
        "// evolve_list": "all",
        "// donot_evolve_list": "pidgey, drowzee",

        "evolve_list": "Magikarp, Psyduck, Poliwag, Poliwhirl, Drowzee, Slowpoke, Staryu, Eevee, Krabby, Goldeen, Pidgeotto, Bellsprout, Gastly, Oddish, Horsea",
        "donot_evolve_list": "none",

      "first_evolve_by": "cp",
      "evolve_above_cp": 120,
      "evolve_above_iv": 0.9,
      "logic": "and",
      "min_evolve_speed": 30,
      "max_evolve_speed": 40,
      "use_lucky_egg": false
    }
  },
  {
    "type": "RecycleItems",
    "config": {
      "enabled": true,
      "min_empty_space": 10,
      "max_balls_keep": 130,
      "max_potions_keep": 160,
      "max_berries_keep": 30,
      "max_revives_keep": 50,
      "item_filter": {
        "Pokeball":       { "keep" : 5 },
        "Potion":         { "keep" : 5 },
        "Super Potion":   { "keep" : 5 },
        "Hyper Potion":   { "keep" : 60 },
        "Max Potion":     { "keep" : 100 },
        "Revive":         { "keep" : 30 },
        "Max Revive":     { "keep" : 40},
    "Greatball":      { "keep" : 70 },
        "Ultraball":      { "keep" : 100 },
        "Razz Berry":     { "keep" : 30 }
      }
    }
  },
    {
      "type": "CatchPokemon",
      "config": {
        "catch_visible_pokemon": true,
        "catch_lured_pokemon": true,
            "daily_catch_limit": 500,
        "min_ultraball_to_keep": 2,
        "catch_throw_parameters": {
          "excellent_rate": 0.1,
          "great_rate": 0.1,
          "nice_rate": 0.4,
          "normal_rate": 0.4,
          "spin_success_rate" : 0.3
        },
              "catch_simulation": {
                "flee_count": 2,
                "flee_duration": 2,
                "catch_wait_min": 1,
                "catch_wait_max": 3,
                "berry_wait_min": 2,
                "berry_wait_max": 3,
                "changeball_wait_min": 2,
                "changeball_wait_max": 3
              }
      }
    },
  {
    "type": "SpinFort",
    "config": {
      "spin_wait_min": 2,
      "spin_wait_max": 8
       }
  },
  {
    "type": "MoveToFort",
    "config": {
        "lure_attraction": true,
        "lure_max_distance": 1000
    }
  },
  {
    "type": "FollowSpiral",
    "config": {
      "diameter": 1,
      "step_size": 5
    }
  }
],
"map_object_cache_time": 5,
"forts": {
  "avoid_circles": true,
  "max_circle_size": 10
},
"walk_max": 6,
"walk_min": 1,
"sleep_schedule": [
  {
    "time": "20:30",
    "duration": "12:00",
    "time_random_offset": "00:10",
    "duration_random_offset": "00:50",
    "wake_up_at_location": ""
  },
  {
    "time": "13:45",
    "duration": "5:00",
    "time_random_offset": "00:20",
    "duration_random_offset": "00:40",
    "wake_up_at_location": ""
  }
],
"alt_min": 30,
"alt_max": 40,
"gps_default_altitude": 278.0,
"replicate_gps_xy_noise": true,
"replicate_gps_z_noise": true,
"gps_xy_noise_range": 0.000025,
"gps_z_noise_range": 4.5,
"action_wait_min": 1,
"action_wait_max": 10,
"debug": false,
"test": false,
"health_record": true,
"location_cache": false,
"distance_unit": "km",
"reconnecting_timeout": 30,
"evolve_captured": "NONE",
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,

Output when issue occurred

Steps to Reproduce

Other Information

OS:

Branch:

Git Commit:

Python Version:

Any other relevant files/configs (eg: path files)

kenkclam avatar Aug 31 '16 08:08 kenkclam

There is a new update to split the max_distance into walk distance and snipe distance I did not notice the change in the config, my bad.

      "max_walking_distance": 500,
      "max_sniping_distance": 500,

Is walk_distance in metre and snip_distance in km?

kenkclam avatar Aug 31 '16 08:08 kenkclam

Per configuration_files.md, both of these are in meters.

mjmadsen avatar Aug 31 '16 18:08 mjmadsen