PokemonGoF / PokemonGo-Bot

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

bot behaves differently between different networks #3358

Closed itgoujie2 closed 8 years ago

itgoujie2 commented 8 years ago

Expected Behavior

bot should behave the same in any network

Actual Behavior

bot works fine without interruption in normal network, but when I run it in a network behind VPN, it always stops after a running a while, it is not crashed by some error, it just stopped producing logs. Ex. current time is 3:30PM, but bot stopped at 2:40PM without any further logs:

2016-08-09 14:39:54,659 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Psyduck, based on cp
2016-08-09 14:39:54,991 [TransferPokemon] [INFO] [pokemon_release] Exchanged Psyduck [CP 395] [IV 0.24] for candy.
2016-08-09 14:39:58,567 [NicknamePokemon] [INFO] [rename_pokemon] Pokemon Psyduck renamed to Psyduck_56
2016-08-09 14:39:58,578 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop Barbary Coast Trail Plaque - 0.08km (attraction of lure 0.08km)
^C2016-08-09 15:32:45,901 [PokemonGoBot] [INFO] [bot_exit] Exiting bot.
2016-08-09 15:32:46,922 [       cli] [INFO] 
2016-08-09 15:32:46,922 [       cli] [INFO] Ran for 0:55:58
2016-08-09 15:32:46,922 [       cli] [INFO] Total XP Earned: 1410  Average: 1511.47/h
2016-08-09 15:32:46,922 [       cli] [INFO] Travelled 0.01km
2016-08-09 15:32:46,922 [       cli] [INFO] Visited 3 stops
2016-08-09 15:32:46,922 [       cli] [INFO] Encountered 6 pokemon, 6 caught, 7 released, 0 evolved, 0 never seen before
2016-08-09 15:32:46,922 [       cli] [INFO] Threw 6 pokeballs
2016-08-09 15:32:46,922 [       cli] [INFO] Earned 600 Stardust
2016-08-09 15:32:46,922 [       cli] [INFO] 
2016-08-09 15:32:46,922 [       cli] [INFO] Highest CP Pokemon: Psyduck [CP: 839] [IV: 1/12/12] Potential: 0.56 
2016-08-09 15:32:46,922 [       cli] [INFO] Most Perfect Pokemon: Zubat [CP: 379] [IV: 8/12/11] Potential: 0.69 

Your config.json (remove your credentials and any other private info)

{
    "auth_service": "google",
    "username": "",
    "password": "",
    "location": "",
    "gmapkey": "",
    "tasks": [
      {
        "type": "HandleSoftBan"
      },
      {
        "type": "CollectLevelUpReward"
      },
      {
        "type": "IncubateEggs",
        "config": {
          "longer_eggs_first": true
        }
      },
      {
        "type": "TransferPokemon"
      },
      {
        "type": "EvolvePokemon",
        "config": {
            "evolve_all": "Pidgey,Weedle,Caterpie,Zubat,Rattata,Psyduck,Spearow,Tentacool,Goldeen,Staryu,Eevee,Doduo,Krabby,Paras,Ekans,Venonat,Meowth,Poliwag",
            "first_evolve_by": "cp",
            "evolve_above_cp": 100,
            "evolve_above_iv": 0.8,
            "logic": "or",
            "evolve_speed": 20,
            "use_lucky_egg": false
        }
      },
      {
        "type": "RecycleItems",
        "config": {
          "item_filter": {
            "Pokeball":       { "keep" : 100 },
            "Potion":         { "keep" : 40 },
            "Super Potion":   { "keep" : 40 },
            "Hyper Potion":   { "keep" : 40 },
            "Max Potion":   { "keep" : 40 }, 
            "Revive":         { "keep" : 40 },
            "Razz Berry":     { "keep" : 100 }
          }
        }
      },
      {
        "type": "NicknamePokemon", 
        "config": {
            "nickname_template": "{name:.8s}_{iv_pct}"    
        }
      }, 
      {
        "type": "CatchVisiblePokemon"
      },
      {
        "type": "CatchLuredPokemon"
      },
      {
        "type": "SpinFort"
      },
      {
        "type": "MoveToFort",
        "config": {
            "lure_attraction": true,
            "lure_max_distance": 2000
        }
      },
      {
        "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": 4.16,
    "action_wait_min": 1,
    "action_wait_max": 4,
    "debug": false,
    "test": false,
    "health_record": false,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "evolve_captured": "NONE",
    "catch_randomize_reticle_factor": 1.0,
    "catch_randomize_spin_factor": 1.0,
    "catch": {
      "any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
      "// Example of always catching Rattata:": {},
      "// Rattata": { "always_catch" : true }
    },
    "release": {
      "any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
        "Bulbasaur":    { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Ivysaur":      { "release_under_cp": 700, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Venusaur":     { "release_under_cp": 902, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Charmander":   { "release_under_cp": 500, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Charmeleon":   { "release_under_cp": 700, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Charizard":    { "release_under_cp": 909, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Squirtle":     { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Wartandtle":    { "release_under_cp": 820, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Blastoise":    { "release_under_cp": 888, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Caterpie":     { "keep_best_cp": 2, "keep_best_iv": 1 },
        "Metapod":      { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Butterfree":   { "release_under_cp": 508, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Weedle":       { "keep_best_cp": 2, "keep_best_iv": 1 },
        "Kakuna":       { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Beedrill":     { "release_under_cp": 504, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Pidgey":       { "keep_best_cp": 1 },
        "Pidgeotto":    { "keep_best_cp": 1 },
        "Pidgeot":      { "keep_best_cp": 1 },
        "Rattata":      { "keep_best_cp": 1 },
        "Raticate":     { "keep_best_cp": 1 },
        "Spearow":      { "keep_best_cp": 1 },
        "Fearow":       { "keep_best_cp": 1 },
        "Ekans":        { "keep_best_cp": 1 },
        "Arbok":        { "release_under_cp": 1000, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Pikachu":      { "release_under_cp": 309, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Raichu":       { "release_under_cp": 708, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Sandshrew":    { "release_under_cp": 400, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Sandslash":    { "release_under_cp": 800, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Nidandan F":    { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Nidandina":     { "release_under_cp": 750, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Nidoqueen":    { "release_under_cp": 868, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Nidandan M":    { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Nidandino":     { "release_under_cp": 800, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Nidoking":     { "release_under_cp": 864, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Clefairy":     { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Clefable":     { "release_under_cp": 1100, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Vulpix":       { "release_under_cp": 290, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Ninetales":    { "release_under_cp": 763, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Jigglypuff":   { "release_under_cp": 500, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Wigglytuff":   { "release_under_cp": 1000, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Zubat":        { "keep_best_cp": 1 },
        "Golbat":       { "keep_best_cp": 1 },
        "Oddish":       { "keep_best_cp": 1 },
        "Gloom":        { "keep_best_cp": 1 },
        "Vileplume":    { "release_under_cp": 871, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Paras":        { "keep_best_cp": 1 },
        "Parasect":     { "keep_best_cp": 1 },
        "Venonat":      { "keep_best_cp": 1 },
        "Venomoth":     { "keep_best_cp": 1 },
        "Diglett":      { "keep_best_cp": 1 },
        "Dugtrio":      { "release_under_cp": 408, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Meowth":       { "keep_best_cp": 2 },
        "Persian":      { "keep_best_cp": 1 },
        "Psyduck":      { "keep_best_cp": 2 },
        "Golduck":      { "keep_best_cp": 1 },
        "Mankey":       { "keep_best_cp": 1 },
        "Primeape":     { "release_under_cp": 650, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Growlithe":    { "release_under_cp": 700, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Arcanine":     { "release_under_cp": 1041, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Poliwag":      { "keep_best_cp": 2 },
        "Poliwhirl":    { "keep_best_cp": 1 },
        "Poliwrath":    { "release_under_cp": 876, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Abra":         { "release_under_cp": 208, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Kadabra":      { "release_under_cp": 396, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Alakazam":     { "release_under_cp": 633, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Machop":       { "release_under_cp": 590, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Machoke":      { "release_under_cp": 614, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Machamp":      { "release_under_cp": 907, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Bellsprout":   { "keep_best_cp": 1 },
        "Weepinbell":   { "release_under_cp": 1000, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Victreebel":   { "release_under_cp": 883, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Tentacool":    { "keep_best_cp": 1 },
        "Tentacruel":   { "keep_best_cp": 2 },
        "Geodude":      { "release_under_cp": 490, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Graveler":     { "release_under_cp": 800, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Golem":        { "release_under_cp": 804, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Ponyta":       { "release_under_cp": 530, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Rapidash":     { "release_under_cp": 768, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Slowpoke":     { "release_under_cp": 424, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Slowbro":      { "release_under_cp": 907, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Magnemite":    { "release_under_cp": 312, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Magneton":     { "release_under_cp": 657, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Farfetch'd":   { "release_under_cp": 441, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Doduo":        { "keep_best_cp": 1 },
        "Dodrio":       { "keep_best_cp": 1 },
        "Seel":         { "release_under_cp": 386, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Dewgong":      { "release_under_cp": 748, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Grimer":       { "release_under_cp": 448, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Muk":          { "release_under_cp": 909, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Shellder":     { "release_under_cp": 288, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Cloyster":     { "release_under_cp": 717, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Gastly":       { "keep_best_cp": 1, "keep_best_iv": 1 },
        "Haunter":      { "release_under_cp": 482, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Gengar":       { "release_under_cp": 724, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Onix":         { "release_under_cp": 300, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Drowzee":      { "release_under_cp": 374, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Hypno":        { "release_under_cp": 763, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Krabby":       { "keep_best_cp": 1 },
        "Kingler":      { "release_under_cp": 1000, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Voltandb":      { "release_under_cp": 292, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Electrode":    { "release_under_cp": 576, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Exeggcute":    { "keep_best_cp": 1 },
        "Exeggutand":    { "release_under_cp": 1032, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Cubone":       { "release_under_cp": 352, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Marowak":      { "release_under_cp": 578, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Hitmonlee":    { "release_under_cp": 520, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Hitmonchan":   { "release_under_cp": 530, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Lickitung":    { "release_under_cp": 568, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Koffing":      { "release_under_cp": 403, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Weezing":      { "release_under_cp": 784, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Rhyhandn":      { "release_under_cp": 412, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Rhydon":       { "release_under_cp": 782, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Chansey":      { "release_under_cp": 235, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Tangela":      { "release_under_cp": 607, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Kangaskhan":   { "release_under_cp": 712, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Handsea":       { "release_under_cp": 278, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Seadra":       { "release_under_cp": 597, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Goldeen":      { "keep_best_cp": 1 },
        "Seaking":      { "keep_best_cp": 1 },
        "Staryu":       { "keep_best_cp": 1 },
        "Starmie":      { "release_under_cp": 900, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Mr. Mime":     { "release_under_cp": 520, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Scyther":      { "release_under_cp": 724, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Jynx":         { "release_under_cp": 600, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Electabuzz":   { "release_under_cp": 739, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Magmar":       { "release_under_cp": 792, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Pinsir":       { "keep_best_cp": 1 },
        "Tauros":       { "keep_best_cp": 1 },
        "Magikarp":     { "keep_best_cp": 1 },
        "Gyarados":     { "release_under_cp": 938, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Lapras":       { "release_under_cp": 1041, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Ditto":        { "release_under_cp": 321, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Eevee":        { "keep_best_cp": 2 },
        "Vapandeon":     { "release_under_cp": 984, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Jolteon":      { "release_under_cp": 746, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Flareon":      { "release_under_cp": 924, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Pandygon":      { "release_under_cp": 590, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Omanyte":      { "release_under_cp": 391, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Omastar":      { "release_under_cp": 780, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Kabuto":       { "release_under_cp": 386, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Kabutops":     { "release_under_cp": 744, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Aerodactyl":   { "release_under_cp": 756, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Snandlax":      { "release_under_cp": 1087, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Articuno":     { "release_under_cp": 1039, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Zapdos":       { "release_under_cp": 1087, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Moltres":      { "release_under_cp": 1132, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Dratini":      { "keep_best_cp": 3 },
        "Dragonair":    { "keep_best_cp": 1 },
        "Dragonite":    { "release_under_cp": 1221, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Mewtwo":       { "release_under_cp": 1447, "release_under_iv": 0.8, "cp_iv_logic": "and" },
        "Mew":          { "release_under_cp": 1152, "release_under_iv": 0.8, "cp_iv_logic": "and" }
    },
    "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": {}

    }
}

Steps to Reproduce

try run the bot behind VPN

Other Information

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

RedViper9 commented 8 years ago

Based on the code you posted something is sending SIGINT to your terminal.

^C2016-08-09 15:32:45,901 [PokemonGoBot] [INFO] [bot_exit] Exiting bot.

That ^C is the usual notation for ctrl+c.

I'm running a number of bots behind a VPN and have had no issue.

itgoujie2 commented 8 years ago

That is because I noticed the bot stopped, then i forced ctrl+c, and then restarted the bot

Sent from my iPhone

On Aug 9, 2016, at 7:20 PM, RedViper9 notifications@github.com wrote:

Based on the code you posted something is sending SIGINT to your terminal.

^C2016-08-09 15:32:45,901 [PokemonGoBot] [INFO] [bot_exit] Exiting bot. That ^C is the usual notation for ctrl+c.

I'm running a number of bots behind a VPN and have had no issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DiegoRBaquero commented 8 years ago

You are just deleting logs, aren't you? Kidding...

Try activating the debug (in your config file), it must be network related of course but not showing up in normal log. With debug logs I think we can find the answer.

k4n30 commented 8 years ago

@itgoujie2 are you still experiencing this issue with the latest version, I think your "getting stuck issue" has been resolved in recent commits. But I'd love to hear back from you to ensure it has :)

itgoujie2 commented 8 years ago

I think you can mark this one closed, my account was banned anyway