Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR [MoveToMapPokemon] UnboundLocalError: local variable 'alt' referenced before assignment #4521

Closed
ganagus opened this issue Aug 22, 2016 · 1 comment

Comments

@ganagus
Copy link

ganagus commented Aug 22, 2016

Expected Behavior

After encountering pokemon in task [MoveToMapPokemon], it should continue with other task, in my case: [FollowPath] task.

Actual Behavior

It stops with error message below.

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

{
"auth_service": "google",
"username": "[removed]",
"password": "[removed]",
"location": "-6.121763, 106.841819",
"gmapkey": "[removed]",
"encrypt_location": "",
"websocket_server": false,
"heartbeat_threshold": 10,
"tasks": [
{
"type": "HandleSoftBan"
},
{
"type": "SleepSchedule",
"config": {
"enabled": true,
"time": "23:54",
"duration":"6:46",
"time_random_offset": "00:24",
"duration_random_offset": "00:43"
}
},
{
"type": "CollectLevelUpReward"
},
{
"type": "IncubateEggs",
"config": {
"longer_eggs_first": true
}
},
{
"type": "UpdateLiveStats",
"config": {
"enabled": false,
"min_interval": 10,
"stats": ["username", "uptime", "stardust_earned", "xp_earned", "xp_per_hour", "stops_visited"],
"terminal_log": true,
"terminal_title": true
}
},
{
"type": "TransferPokemon",
"config": {
"transfer_wait_min": 1,
"transfer_wait_max": 4
}
},
{
"type": "NicknamePokemon",
"config": {
"enabled": true,
"nickname_template": "{iv_pct}_{iv_ads}"
}
},
{
"type": "EvolvePokemon",
"config": {
"evolve_all": "none",
"first_evolve_by": "cp",
"evolve_above_cp": 500,
"evolve_above_iv": 0.89,
"logic": "or",
"evolve_speed": 20,
"use_lucky_egg": false
}
},
{
"type": "RecycleItems",
"config": {
"min_empty_space": 15,
"max_balls_keep": 150,
"max_potions_keep": 50,
"max_berries_keep": 70,
"max_revives_keep": 70,
"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": 1,
"recycle_wait_max": 4
}
},
{
"type": "CatchPokemon",
"config": {
"enabled": true,
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"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": 3
}
},
{
"type": "MoveToMapPokemon",
"config": {
"enabled" : true,
"address": "http://localhost:5000",
"max_distance": 500,
"min_ball": 50,
"prioritize_vips": true,
"snipe": false,
"snipe_high_prio_only": true,
"snipe_high_prio_threshold": 400,
"update_map": true,
"mode": "priority",
"map_path": "raw_data",
"catch": {
"==========Legendaries==========": 0,
"Aerodactyl": 1000,
"Snorlax": 1000,
"Articuno": 1000,
"Zapdos": 1000,
"Moltres": 1000,
"Dratini": 1000,
"Dragonair": 1000,
"Dragonite": 1000,
"Mewtwo": 1000,
"Mew": 1000,

        "==========Region Locked==========": 0,
        "Farfetch'd": 1000,
        "Kangaskhan": 1000,
        "Mr. Mime": 1000,
        "Tauros": 1000,

        "==========Very Rare==========": 0,
        "Lapras": 900,
        "Electabuzz": 900,
        "Magmar": 900,
        "Ditto": 900,

        "==========Starters==========": 0,
        "Bulbasaur": 300,
        "Ivysaur": 600,
        "Venusaur": 800,

        "Charmander": 400,
        "Charmeleon": 600,
        "Charizard": 1000,

        "Squirtle": 300,
        "Wartortle": 600,
        "Blastoise": 800,

        "Pikachu": 600,
        "Raichu": 1000,

        "==========Semi Rare==========": 0,
        "Porygon": 200,
        "==Scyther": 200,
        "Jynx": 500,

        "==========Uncommon==========": 0,

        "Omanyte": 200,
        "Omastar": 400,

        "Seel": 300,
        "Dewgong": 600,

        "Grimer": 200,
        "Muk": 500,

        "Shellder": 200,
        "Cloyster": 400,

        "==Gastly": 100,
        "Haunter": 300,
        "Gengar": 500,

        "Onix": 100,

        "Drowzee": 300,

        "Hypno": 300,

        "Vulpix": 200,
        "Ninetales": 300,

        "==Paras": 100,
        "==Parasect": 100,

        "Growlithe": 300,
        "Arcanine": 700,

        "==Tentacool": 100,
        "==Tentacruel": 100,

        "Mankey": 100,
        "Primeape": 300,

        "Clefairy": 100,
        "Clefable": 300,

        "Jigglypuff": 100,
        "Wigglytuff": 300,

        "==Venonat": 100,
        "==Venomoth": 100,

        "==Diglett": 100,
        "Dugtrio": 300,

        "Meowth": 100,
        "Persian": 300,

        "==Psyduck": 100,
        "==Golduck": 100,

        "==Geodude": 100,
        "Graveler": 200,
        "Golem": 300,

        "==Eevee": 200,
        "==Vaporeon": 300,
        "==Jolteon": 300,
        "==Flareon": 300,

        "==Kabuto": 100,
        "Kabutops": 300,

        "==Magikarp": 100,
        "Gyarados": 800,

        "==Pinsir": 100,

        "Ponyta": 200,
        "Rapidash": 300,

        "==Slowpoke": 100,
        "==Slowbro": 100,

        "Magnemite": 300,
        "Magneton": 500,

        "==Krabby": 100,
        "==Kingler": 100,

        "Voltorb": 200,
        "Electrode": 300,

        "==Exeggcute": 100,
        "==Exeggcutor": 300,

        "==Cubone": 100,
        "==Marowak": 100,

        "Hitmonlee": 400,

        "Hitmonchan": 400,

        "Lickitung": 500,

        "Koffing": 200,
        "Weezing": 500,

        "Rhyhorn": 100,
        "Rhydon": 300,

        "Chansey": 800,

        "==Tangela": 100,

        "==Horsea": 100,
        "==Seadra": 100,

        "==Goldeen": 100,
        "==Seaking": 100,

        "==Staryu": 100,
        "==Starmie": 100,


        "==========T1 Evolvers==========": 0,
        "==Caterpie": 100,
        "==Metapod": 100,
        "==Butterfree": 100,

        "==Weedle": 100,
        "==Kakuna": 100,
        "==Beedrill": 100,

        "==Pidgey": 100,
        "==Pidgeotto": 100,
        "==Pidgeot": 100,

        "==========T2 Evolvers==========": 0,
        "==Nidoran F": 100,
        "==Nidorina": 100,
        "Nidoqueen": 100,

        "==Nidoran M": 100,
        "==Nidorino": 100,
        "Nidoking": 100,

        "==Oddish": 100,
        "==Gloom": 100,
        "Vileplume": 100,

        "==Poliwag": 100,
        "==Poliwhirl": 100,
        "Poliwrath": 100,

        "Abra": 300,
        "Kadabra": 600,
        "Alakazam": 800,

        "==Machop": 100,
        "==Machoke": 100,
        "Machamp": 100,

        "==Bellsprout": 100,
        "==Weepinbell": 100,
        "Victreebel": 100,

        "==========Trash==========": 0,

        "==Rattata": 10,
        "==Raticate": 10,

        "==Spearow": 10,
        "==Fearow": 10,

        "==Ekans": 10,
        "==Arbok": 10,

        "==Sandshrew": 10,
        "==Sandslash": 10,

        "==Zubat": 10,
        "==Golbat": 10,

        "==Doduo": 10,
        "==Dodrio": 10
      }
    }
  },
  {
    "type": "FollowPath",
    "config": {
      "enabled": true,
      "path_mode": "loop",
      "path_start_mode": "closest",
      "path_file": "configs/path.ancol.loop.poke.json"
    }
  },
  {
    "type": "MoveToFort",
    "config": {
      "enabled": false,
      "lure_attraction": false,
      "lure_max_distance": 2000
    }
  }
],
"map_object_cache_time": 5,
"forts": {
  "avoid_circles": true,
  "max_circle_size": 50,
  "cache_recent_forts": true
},
"walk_max": 4.16,
"walk_min": 2.16,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"logging_color": true,
"catch": {
  "any": {"catch_above_iv": 0},
  "// any": {"catch_above_iv": 0.8},
  "// Example of always catching Rattata:": {},
  "// Rattata": { "always_catch" : true },
  "Dratini": { "always_catch" : true },
  "Dragonair": { "always_catch" : true },
  "Snorlax": { "always_catch" : true },
  "Lapras": { "always_catch" : true },
  "Pikachu": { "always_catch" : true },
  "Raichu": { "always_catch" : true },
  "Growlithe": { "always_catch" : true },
  "Arcanine": { "always_catch" : true }
},
"release": {
  "any": { "keep_best_iv": 2 },

  "// Legendary pokemons (Goes under S-Tier)": {},
  "Lapras": { "keep_best_iv": 3 },
  "Moltres": { "release_below_cp": 1132, "release_below_iv": 0.8, "logic": "and" },
  "Zapdos": { "release_below_cp": 1087, "release_below_iv": 0.8, "logic": "and" },
  "Articuno": { "release_below_cp": 1039, "release_below_iv": 0.8, "logic": "and" },

  "// S-Tier pokemons (if pokemon can be evolved into tier, list the representative)": {},
  "Mewtwo": { "release_below_cp": 1447, "release_below_iv": 0.8, "logic": "and"},
  "Dragonite": { "keep_best_iv": 3 },
  "Snorlax": { "keep_best_iv": 3 },
  "// Mew evolves to Mewtwo": {},
  "Mew": { "release_below_cp": 1152, "release_below_iv": 0.8, "logic": "and" },
  "Arcanine": { "keep_best_iv": 3 },
  "Vaporeon": { "keep_best_iv": 3 },
  "Gyarados": { "keep_best_iv": 3 },
  "Exeggutor": { "keep_best_iv": 3 },
  "Muk": { "keep_best_iv": 3 },
  "Weezing": { "keep_best_iv": 3 },
  "Flareon": { "keep_best_iv": 3 },

  "// Growlithe evolves to Arcanine": {},
  "Growlithe": { "keep_best_iv": 5 },
  "// Dragonair evolves to Dragonite": {},
  "Dragonair": { "keep_best_iv": 5 },
  "// Grimer evolves to Muk": {},
  "Grimer": { "keep_best_iv": 5 },
  "// Magikarp evolves to Gyarados": {},
  "Magikarp": { "keep_best_iv": 6 },
  "// Exeggcute evolves to Exeggutor": {},
  "Exeggcute": { "keep_best_iv": 5 },
  "// Eevee evolves to many versions, like Vaporeon, Flareon": {},
  "Eevee": { "keep_best_iv": 5 },

  "// A-Tier pokemons": {},
  "Machamp": { "keep_best_iv": 3 },
  "Poliwrath": { "keep_best_iv": 3 },
  "Venusaur": { "keep_best_iv": 3 },
  "Charizard": { "keep_best_iv": 3 },
  "Vileplume": { "keep_best_iv": 3 },
  "Blastoise": { "keep_best_iv": 3 },
  "Aerodactyl": { "keep_best_iv": 3 },
  "Golem": { "keep_best_iv": 3 },
  "Wigglytuff": { "keep_best_iv": 3 },

  "// Koffing evolves to Weezing (A-Tier)": {},
  "Koffing": { "keep_best_iv": 3 },

  "// Below is B-tier and lower pokemons": {},
  "Squirtle": { "keep_best_iv": 5 },
  "Oddish": { "keep_best_iv": 3 },
  "Rhyhorn": { "keep_best_iv": 5 },
  "Clefairy": { "keep_best_iv": 3 },
  "Poliwhirl": { "keep_best_iv": 5 },
  "Charmeleon": { "keep_best_iv": 5 },
  "Wartortle": { "keep_best_iv": 3 },
  "Ivysaur": { "keep_best_iv": 3 },
  "Gloom": { "keep_best_iv": 3 },
  "Machoke": { "keep_best_iv": 3 },
  "Dratini": { "keep_best_iv": 5 }
},
"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": {},
    "// My vips": {},
    "Dratini": {},
    "Dragonair": {}
}

}

Output when issue occurred

2016-08-22 09:10:50,263 [MoveToMapPokemon] [INFO] [move_to_map_pokemon_encounter] Encountered Pokemon: Dratini
2016-08-22 09:10:51,711 [ cli] [INFO]
2016-08-22 09:10:51,713 [ cli] [INFO] Ran for 0:00:57
2016-08-22 09:10:51,713 [ cli] [INFO] Total XP Earned: 160 Average: 10041.84/h
2016-08-22 09:10:51,714 [ cli] [INFO] Travelled 0.00km
2016-08-22 09:10:51,714 [ cli] [INFO] Visited 0 stops
2016-08-22 09:10:51,714 [ cli] [INFO] Encountered 2 pokemon, 1 caught, 0 released, 0 evolved, 0 never seen before
2016-08-22 09:10:51,716 [ cli] [INFO] Threw 1 pokeball
2016-08-22 09:10:51,716 [ cli] [INFO] Earned 100 Stardust
2016-08-22 09:10:51,717 [ cli] [INFO]
2016-08-22 09:10:51,717 [ cli] [INFO] Highest CP Pokemon: Dratini [CP: 120] [IV: 8/4/15] Potential: 0.6
2016-08-22 09:10:51,717 [ cli] [INFO] Most Perfect Pokemon: Dratini [CP: 120] [IV: 8/4/15] Potential: 0.6
Traceback (most recent call last):
File "pokecli.py", line 674, in
main()
File "pokecli.py", line 118, in main
bot.tick()
File "C:\Pogo\PokemonGo-Bot\pokemongo_bot__init__.py", line 541, in tick
if worker.work() == WorkerResult.RUNNING:
File "C:\Pogo\PokemonGo-Bot\pokemongo_bot\cell_workers\follow_path.py", line 143, in work
'current_position': (lat, lng, alt),
UnboundLocalError: local variable 'alt' referenced before assignment
2016-08-22 09:10:51,733 [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 "C:\Python27\lib\site-packages\raven\transport\threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "C:\Python27\lib\site-packages\raven\transport\http.py", line 47, in send
ca_certs=self.ca_certs,
File "C:\Python27\lib\site-packages\raven\utils\http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 494, in open
response = self._open(req, data)
File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 512, in _open
'_open', req)
File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 466, in _call_chain
result = func(*args)
File "C:\Python27\lib\site-packages\raven\utils\http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 1284, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "C:\Python27\lib\httplib.py", line 1057, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1097, in _send_request
self.endheaders(body)
File "C:\Python27\lib\httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 895, in send_output
msg += message_body
File "C:\Python27\lib\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-22 09:10:51,743 [sentry.errors.uncaught] [ERROR] [u"UnboundLocalError: local variable 'alt' referenced before assignment", u' File "pokecli.py", line 674, in ', u' File "pokecli.py", line 118, in main', u' File "C:\Pogo\PokemonGo-Bot\pokemongo_bot_init
.py", line 541, in tick', u' File "C:\Pogo\PokemonGo-Bot\pokemongo_bot\cell_workers\follow_path.py", line 143, in work']

Something went wrong and the bot needed to be restarted. Please investigate the cause.

Steps to Reproduce

  • I got the latest development built
  • run the bot with config above
  • error happened
@k4n30
Copy link
Contributor

k4n30 commented Aug 22, 2016

#4493

@k4n30 k4n30 closed this as completed Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants