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

Last location cache not working with Docker #3596

Closed
pensiero opened this issue Aug 11, 2016 · 12 comments
Closed

Last location cache not working with Docker #3596

pensiero opened this issue Aug 11, 2016 · 12 comments

Comments

@pensiero
Copy link
Contributor

Expected Behavior

After stopping and running again docker, the player doesn't start from the last location

Actual Behavior

After stopping and running again docker, it start from the location set in the config.json

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

Default, only changed credentials and:
"location": "48.59324626,9.90760185",

Steps to Reproduce

  • Run docker run --name=pokego-bot1 --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
  • Then press CMD-C
  • Then run it again

Other Information

OS: Debian
Git Commit: d5812e9
Python Version: 2.7.3

@ghost
Copy link

ghost commented Aug 11, 2016

"location_cache": true needs to be set in your config, if not, please do so. Otherwise, what is your whole config?

@pensiero
Copy link
Contributor Author

I edited only the config.json file in this way:

{
    "auth_service": "google",
    "username": "XXX@gmail.com",
    "password": "XXX",
    "location": "48.59324626,9.90760185",
    "gmapkey": "XXX",
    "libencrypt_location": "",
    "tasks": [
      {
        "type": "HandleSoftBan"
      },
      {
        "type": "CollectLevelUpReward"
      },
      {
        "type": "IncubateEggs",
        "config": {
          "longer_eggs_first": true
        }
      },
      {
        "type": "TransferPokemon"
      },
      {
        "type": "NicknamePokemon",
        "config": {
          "enabled": false,
          "nickname_template": "{iv_pct}_{iv_ads}"
        }
      },
      {
        "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": "RecycleItems",
        "config": {
          "min_empty_space": 15,
          "item_filter": {
            "Pokeball":       { "keep" : 100 },
            "Potion":         { "keep" : 10 },
            "Super Potion":   { "keep" : 20 },
            "Hyper Potion":   { "keep" : 30 },
            "Revive":         { "keep" : 30 },
            "Razz Berry":     { "keep" : 100 }
          }
        }
      },
      {
        "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": 6.36,
    "action_wait_min": 1,
    "action_wait_max": 5,
    "debug": false,
    "test": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "evolve_captured": "NONE",
    "catch_randomize_reticle_factor": 1.0,
    "catch_randomize_spin_factor": 1.0,
    "logging_color": true,
    "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"},
      "// 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}
    },
    "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": {}

    }
}

And then launched

docker run --name=pokego-bot1 --rm -it -v /home/app/PokemonGo-Bot/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot

@pensiero
Copy link
Contributor Author

pensiero commented Aug 11, 2016

Where the location_cache should be saved?
Maybe exiting with CMD-C breaks something?

@lukaszraczylo
Copy link

That's the "magic" of docker. Every time you restart the container it starts from the state 0, unless you actually map for example cache folder / cache file to your local filesystem ( same as you do with config.json @pensiero example )

@pensiero
Copy link
Contributor Author

What is the cache folder?

@readtimeout
Copy link

@pensiero
Copy link
Contributor Author

@readtimeout why?

@readtimeout
Copy link

@pensiero i think mistake

@lukaszraczylo
Copy link

@pensiero $POKEMONGOFOLDER/data
Simply run your docker with additional

-v /home/app/PokemonGo-Bot/data:/usr/src/app/data

In your case it would be

docker run --name=pokego-bot1 --rm -it -v /home/app/PokemonGo-Bot/data:/usr/src/app/data -v /home/app/PokemonGo-Bot/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot

@pensiero
Copy link
Contributor Author

Thanks @lukaszraczylo, I created #3604

@pensiero
Copy link
Contributor Author

@lukaszraczylo your edit works, however probably the cache is totally not working, as @readtimeout said

@VeNoMouS
Copy link

VeNoMouS commented Aug 11, 2016

yeaaaa, @brantje's PR also created an anonying as hell debug on the CLI, and I was wondering why my map wasn't updating, @readtimeout is indeed correct, enabled that loop again updates the map.

@douglascamata just making you aware of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants