PokemonGoF / PokemonGo-Bot

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

Followpath issue #2827

Closed firzzen closed 8 years ago

firzzen commented 8 years ago

Expected Behavior

Bot should run and use the .gpx file for path.

Actual Behavior

Bot does not start and gives:

Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 126, in main if bot: UnboundLocalError: local variable 'bot' referenced before assignment

Steps to Reproduce

Use the below config and run it.

Other Information

Here is the full config:

{
"auth_service": "ptc",
"username": "xxxxxx",
"password": "xxxxx",
"location": "52.37163, 4.90292",
"gmapkey": "xxxxxx",
"tasks": [
  {
    "type": "HandleSoftBan"
  },
  {
    "type": "CollectLevelUpReward"
  },
  {
    "type": "IncubateEggs",
    "config": {
      "longer_eggs_first": true
    }
  },
  {
    "type": "TransferPokemon"
  },
  {
    "type": "EvolvePokemon",
    "config": {
        "evolve_all": "none",
        "first_evolve_by": "cp",
        "evolve_above_cp": 500,
        "evolve_above_iv": 0.8,
        "logic": "or",
        "evolve_speed": 20,
        "use_lucky_egg": false
    }
  },
  {
    "type": "SleepSchedule",
    "config": {
      "time": "23:01",
      "duration":"9:31",
      "time_random_offset": "00:25",
      "duration_random_offset": "00:24"
    }
  },
  {
    "type": "RecycleItems",
    "config": {
      "item_filter": {
        "Pokeball":       { "keep" : 80 },
        "Potion":         { "keep" : 0 },
        "Super Potion":   { "keep" : 0 },
        "Hyper Potion":   { "keep" : 0 },
        "Revive":         { "keep" : 0 },
        "Razz Berry":     { "keep" : 50 }
      }
    }
  },
  {
    "type": "CatchVisiblePokemon"
  },
  {
    "type": "CatchLuredPokemon"
  },
  {
    "type": "SpinFort"
  },
  {
    "type": "FollowPath",
    "config": {
      "path_mode": "loop",
      "path_file": "configs/Amsterdamtest.gpx"
    }
  }
 ],
  {
    "type": "MoveToFort",
    "config": {
      "lure_attraction": false,
      "lure_max_distance": 0
    }
  },
  {
    "type": "FollowSpiral",
    "config": {
      "diameter": 4,
      "step_size": 70
    }
  }
],
"map_object_cache_time": 5,
"forts": {
  "avoid_circles": true,
  "max_circle_size": 50
},
"websocket_server": false,
"walk": 12,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"evolve_captured": "all",
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"catch": {
  "any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or" },

  "// Pokemons with example": { "always_catch": true },
  "// Gets filtered with release parameters": {},

  "// Legendary pokemons (Goes under S-Tier)": {},
  "Lapras": { "always_catch": true },
  "Moltres": { "always_catch": true },
  "Zapdos": { "always_catch": true },
  "Articuno": { "always_catch": true },

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

  "// Growlithe evolves to Arcanine": {},
  "Growlithe": { "always_catch": true },
  "// Dragonair evolves to Dragonite": {},
  "Dragonair": { "always_catch": true },
  "// Grimer evolves to Muk": {},
  "Grimer": { "always_catch": true },

  "// Magikarp evolves to Gyarados": {},
  "Magikarp": { "always_catch": true },
  "// Exeggcute evolves to Exeggutor": {},
  "Exeggcute": { "always_catch": true },
  "// Eevee evolves to many versions, like Vaporeon, Flareon": {},
  "Eevee": { "always_catch": true },

  "// A-Tier pokemons": {},
  "Slowbro": { "always_catch": true },
  "Victreebel": { "always_catch": true },
  "Machamp": { "always_catch": true },
  "Poliwrath": { "always_catch": true },
  "Clefable": { "always_catch": true },
  "Nidoking": { "always_catch": true },
  "Venusaur": { "always_catch": true },
  "Charizard": { "always_catch": true },
  "Golduck": { "always_catch": true },
  "Nidoqueen": { "always_catch": true },
  "Vileplume": { "always_catch": true },
  "Blastoise": { "always_catch": true },
  "Omastar":  { "always_catch": true },
  "Aerodactyl": { "always_catch": true },
  "Golem": { "always_catch": true },
  "Wigglytuff": { "always_catch": true },
  "Dewgong": { "always_catch": true },
  "Ninetales": { "always_catch": true },
  "Magmar": { "always_catch": true },
  "Kabutops": { "always_catch": true },
  "Electabuzz": { "always_catch": true },
  "Starmie": { "always_catch": true },
  "Jolteon": { "always_catch": true },
  "Rapidash": { "always_catch": true },
  "Pinsir": { "always_catch": true },
  "Scyther": { "always_catch": true },
  "Tentacruel": { "always_catch": true },
  "Gengar": { "always_catch": true },
  "Hypno": { "always_catch": true },
  "Pidgeot": { "always_catch": true },
  "Rhydon": { "always_catch": true },
  "Seaking": { "always_catch": true },
  "Kangaskhan": { "always_catch": true }
  },
 "release": {
  "any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
  "// Example of always releasing Rattata:": {},
  "// Rattata": {"always_release": true},
  "// Example of keeping 3 stronger (based on CP) Pidgey:": {},
  "// Pidgey": {"keep_best_cp": 3},
  "// Example of keeping 2 stronger (based on IV) Zubat:": {},
  "// Zubat": {"keep_best_iv": 2},
  "// Also, it is working with any": {},
  "// any": {"keep_best_iv": 3},
  "// Example of keeping the 2 strongest (based on CP) and 3 best (based on IV) Zubat:": {},
  "// Zubat": {"keep_best_cp": 2, "keep_best_iv": 3},

  "Abra": {"keep_best_cp": 1},
  "Aerodactyl": {"keep_best_cp": 2},
  "Alakazam": {"keep_best_cp": 2},
  "Arbok": {"keep_best_cp": 2},
  "Arcanine": {"keep_best_cp": 2},
  "Articuno": {"keep_best_cp": 3},
  "Beedrill": {"keep_best_cp": 1},
  "Bellsprout": {"keep_best_cp": 1},
  "Blastoise": {"keep_best_cp": 3},
  "Bulbasaur": {"keep_best_cp": 1},
  "Butterfree": {"keep_best_cp": 1},
  "Caterpie": {"keep_best_cp": 1},
  "Chansey": {"keep_best_cp": 1},
  "Charizard": {"keep_best_cp": 3},
  "Charmander": {"keep_best_cp": 1},
  "Charmeleon": {"keep_best_cp": 1},
  "Clefable": {"keep_best_cp": 2},
  "Clefairy": {"keep_best_cp": 1},
  "Cloyster": {"keep_best_cp": 2},
  "Cubone": {"keep_best_cp": 1},
  "Dewgong": {"keep_best_cp": 1},
  "Diglett": {"keep_best_cp": 1},
  "Ditto": {"keep_best_cp": 2},
  "Dodrio": {"keep_best_cp": 1},
  "Doduo": {"keep_best_cp": 1},
  "Dragonair": {"keep_best_cp": 1},
  "Dragonite": {"keep_best_cp": 2},
  "Dratini": {"keep_best_cp": 1},
  "Drowzee": {"keep_best_cp": 1},
  "Dugtrio": {"keep_best_cp": 1},
  "Eevee": {"keep_best_cp": 2},
  "Ekans": {"keep_best_cp": 1},
  "Electabuzz": {"keep_best_cp": 1},
  "Electrode": {"keep_best_cp": 1},
  "Exeggcute": {"keep_best_cp": 1},
  "Exeggutor": {"keep_best_cp": 3},
  "Farfetch'd": {"keep_best_cp": 1},
  "Fearow": {"keep_best_cp": 0},
  "Flareon": {"keep_best_cp": 3},
  "Gastly": {"keep_best_cp": 1},
  "Gengar": {"keep_best_cp": 2},
  "Geodude": {"keep_best_cp": 1},
  "Gloom": {"keep_best_cp": 1},
  "Golbat": {"keep_best_cp": 1},
  "Goldeen": {"keep_best_cp": 1},
  "Golduck": {"keep_best_cp": 2},
  "Golem": {"keep_best_cp": 3},
  "Graveler": {"keep_best_cp": 1},
  "Grimer": {"keep_best_cp": 1},
  "Growlithe": {"keep_best_cp": 1},
  "Gyarados": {"keep_best_cp": 3},
  "Haunter": {"keep_best_cp": 1},
  "Hitmonchan": {"keep_best_cp": 2},
  "Hitmonlee": {"keep_best_cp": 1},
  "Horsea": {"keep_best_cp": 1},
  "Hypno": {"keep_best_cp": 1},
  "Ivysaur": {"keep_best_cp": 2},
  "Jigglypuff": {"keep_best_cp": 1},
  "Jolteon": {"keep_best_cp": 3},
  "Jynx": {"keep_best_cp": 0},
  "Kabuto": {"keep_best_cp": 1},
  "Kabutops": {"keep_best_cp": 2},
  "Kadabra": {"keep_best_cp": 2},
  "Kakuna": {"keep_best_cp": 1},
  "Kangaskhan": {"keep_best_cp": 2},
  "Kingler": {"keep_best_cp": 1},
  "Koffing": {"keep_best_cp": 1},
  "Krabby": {"keep_best_cp": 1},
  "Lapras": {"keep_best_cp": 3},
  "Lickitung": {"keep_best_cp": 1},
  "Machamp": {"keep_best_cp": 2},
  "Machoke": {"keep_best_cp": 1},
  "Machop": {"keep_best_cp": 1},
  "Magikarp": {"keep_best_cp": 1},
  "Magmar": {"keep_best_cp": 1},
  "Magnemite": {"keep_best_cp": 1},
  "Magneton": {"keep_best_cp": 2},
  "Mankey": {"keep_best_cp": 1},
  "Marowak": {"keep_best_cp": 2},
  "Meowth": {"keep_best_cp": 1},
  "Metapod": {"keep_best_cp": 1},
  "Mew": {"keep_best_cp": 2},
  "Mewtwo": {"keep_best_cp": 3},
  "Moltres": {"keep_best_cp": 2},
  "Mr. Mime": {"keep_best_cp": 1},
  "Muk": {"keep_best_cp": 2},
  "Nidoking": {"keep_best_cp": 3},
  "Nidoqueen": {"keep_best_cp": 3},
  "NidoranF": {"keep_best_cp": 1},
  "NidoranM": {"keep_best_cp": 1},
  "Nidorina": {"keep_best_cp": 1},
  "Nidorino": {"keep_best_cp": 1},
  "Ninetales": {"keep_best_cp": 3},
  "Oddish": {"keep_best_cp": 1},
  "Omanyte": {"keep_best_cp": 1},
  "Omastar":  {"keep_best_cp": 2},
  "Onix": {"keep_best_cp": 1},
  "Paras": {"keep_best_cp": 1},
  "Parasect": {"keep_best_cp": 1},
  "Persian": {"keep_best_cp": 1},
  "Pidgeot": {"keep_best_cp": 0},
  "Pidgeotto": {"keep_best_cp": 0},
  "Pidgey": {"keep_best_cp": 1},
  "Pikachu": {"keep_best_cp": 1},
  "Pinsir": {"keep_best_cp": 1},
  "Poliwag": {"keep_best_cp": 1},
  "Poliwhirl": {"keep_best_cp": 1},
  "Poliwrath": {"keep_best_cp": 2},
  "Ponyta": {"keep_best_cp": 1},
  "Porygon": {"keep_best_cp": 2},
  "Primeape": {"keep_best_cp": 1},
  "Psyduck": {"keep_best_cp": 1},
  "Raichu": {"keep_best_cp": 2},
  "Rapidash": {"keep_best_cp": 1},
  "Raticate": {"keep_best_cp": 0},
  "Rattata": {"keep_best_cp": 1},
  "Rhydon": {"keep_best_cp": 2},
  "Rhyhorn": {"keep_best_cp": 1},
  "Sandshrew": {"keep_best_cp": 1},
  "Sandslash": {"keep_best_cp": 2},
  "Scyther": {"keep_best_cp": 2},
  "Seadra": {"keep_best_cp": 1},
  "Seaking": {"keep_best_cp": 2},
  "Seel": {"keep_best_cp": 1},
  "Shellder": {"keep_best_cp": 1},
  "Slowbro": {"keep_best_cp": 3},
  "Slowpoke": {"keep_best_cp": 1},
  "Snorlax": {"keep_best_cp": 3},
  "Spearow": {"keep_best_cp": 1},
  "Squirtle": {"keep_best_cp": 1},
  "Starmie": {"keep_best_cp": 2},
  "Staryu": {"keep_best_cp": 1},
  "Tangela": {"keep_best_cp": 1},
  "Tauros": {"keep_best_cp": 1},
  "Tentacool": {"keep_best_cp": 1},
  "Tentacruel": {"keep_best_cp": 1},
  "Vaporeon": {"keep_best_cp": 3},
  "Venomoth": {"keep_best_cp": 2},
  "Venonat": {"keep_best_cp": 1},
  "Venusaur": {"keep_best_cp": 3},
  "Victreebel": {"keep_best_cp": 1},
  "Vileplume": {"keep_best_cp": 1},
  "Voltorb": {"keep_best_cp": 1},
  "Vulpix": {"keep_best_cp": 1},
  "Wartortle": {"keep_best_cp": 1},
  "Weedle": {"keep_best_cp": 1},
  "Weepinbell": {"keep_best_cp": 1},
  "Weezing": {"keep_best_cp": 1},
  "Wigglytuff": {"keep_best_cp": 1},
  "Zapdos": {"keep_best_cp": 3},
  "Zubat": {"keep_best_cp": 1}
},
"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" },
"Arcanine": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Articuno": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Blastoise": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Charizard": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Charmeleon": {"catch_above_cp": 500, "catch_above_iv": 0.5, "logic": "or" },
    "Dragonite": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Exeggutor": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Flareon": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Gyarados": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Ivysaur": {"catch_above_cp": 500, "catch_above_iv": 0.5, "logic": "or" },
    "Lapras": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Mew": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Mewtwo": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Moltres": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Muk": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Snorlax": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Vaporeon": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Venusaur": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Wartortle": {"catch_above_cp": 500, "catch_above_iv": 0.5, "logic": "or" },
    "Weezing": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" },
    "Zapdos": {"catch_above_cp": 1000, "catch_above_iv": 0.5, "logic": "or" }
}

}

When i remove this part then the bot runs fine (until the luredFort issue mentioned in #2808 kicks in):

  {
    "type": "FollowPath",
    "config": {
      "path_mode": "loop",
      "path_file": "configs/Amsterdamtest.gpx"
    }
  }

],

OS: Ubuntu 15.04 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here) Python Version: Python 2.7.9

bruvv commented 8 years ago

don't forget the git comment what is specified in the issue template. future more you can't use gpx as far as I know you should use this template: https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/configs/path.example.json

AcorpBG commented 8 years ago

{ "type": "MoveToFort", "config": { "lure_attraction": false, "lure_max_distance": 0 } }, { "type": "FollowSpiral", "config": { "diameter": 4, "step_size": 70 } } ], Remove this from the config you posted. you close the task section after FollowPath with ], then you have 2 more task which make your config syntax wrong. And you cannot use both FollowPath with MoveToFort or FollowSpiral

firzzen commented 8 years ago

@nivong it works well with .gpx files as well.

@AcorpBG thanks, that sovled the issue :).

Tych0n commented 8 years ago

@AcorpBG do you know does "FollowPath" conflicts with "MoveToMapPokemon" from #1992?