PokemonGoF / PokemonGo-Bot

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

pokecli.py: error: argument -a/--auth_service is required #3285

Closed midnightsun183 closed 8 years ago

midnightsun183 commented 8 years ago

Expected Behavior

Log in and run. Entered:

docker run --name=pokego-bot1 --rm -it -v $(pwd)/configs/config-account1.json:/usr/src/app/configs/config.json pokemongo-bot

Actual Behavior

usage: pokecli.py [-h] [-cf CONFIG] -a AUTH_SERVICE [-u USERNAME]
                  [-ws WEBSOCKET.SERVER_URL]
                  [-wss WEBSOCKET.START_EMBEDDED_SERVER]
                  [-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
                  [-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN] [-w WALK]
                  [-k GMAPKEY] [-e SHOW_EVENTS] [-d DEBUG] [-t TEST]
                  [-du DISTANCE_UNIT] [-ec EVOLVE_CAPTURED]
                  [-rt RECONNECTING_TIMEOUT] [-hr HEALTH_RECORD]
                  [-ac FORTS.AVOID_CIRCLES] [-mcs FORTS.MAX_CIRCLE_SIZE]
                  [--catch_randomize_reticle_factor CATCH_RANDOMIZE_RETICLE_FACTOR]
                  [--catch_randomize_spin_factor CATCH_RANDOMIZE_SPIN_FACTOR]
                  [--map_object_cache_time MAP_OBJECT_CACHE_TIME]
pokecli.py: error: argument -a/--auth_service is required

I'm assuming I've made an error in config.json in either auth_service or username.

Other Information

Config:

{
    "auth_service": "google",
    "username": “midnightsun183”,
    "password": “**************”,
    "location": "40.7128, 74.0059",
    "gmapkey": "A************************",
    "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": "RecycleItems",
        "config": {
          "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": 4.16,
    "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": "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": 2, "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": {}

    }
}

OS: OS X Yosemite 10.10.2 Python Version: Python 2.7.12

Dauth commented 8 years ago

if you have 2fa enabled then you need to set your google apps password

midnightsun183 commented 8 years ago

thanks Dauth for the suggestion, but it didn't work.

Deactivated 2fa, I've also tried setting up a new google account, using "email@gmail", "email@gmail.com", ptc sign in, new ptc account sign in, used -a and, --auth_service in config.json as well as pokecli.py. I've also restarted the bot, done a re-build; still nothing.

Any suggestions?

midnightsun183 commented 8 years ago

FML now this:

From docker terminal

  File "pokecli.py", line 182
    required=required(“auth_service"),

Which would indicate a problem with pokecli.py ... but that is the same as source from GitHub.

From Pokecli.py

 # Read passed in Arguments

    required = lambda x: not x in load

    add_config(

        parser,

        load,

        short_flag="-a",

        long_flag="--auth_service",

        help="Auth Service ('ptc' or 'google')",

        required=required(“auth_service"),

        default=None
ghost commented 8 years ago

i'm also having this issue.

PraeceptorXS commented 8 years ago

You need to change the quotation marks around yourusername and password. The quotes autocorrect into slanted quotation marks, and invalidates the json. You need to either paste the json into a json validator like this or simply copy and paste the correct quotes " <-- this, in place of the faulty ones. That should solve the issue,

PraeceptorXS commented 8 years ago

@midnightsun183 Also, I noticed that your username is not an email, if you are not logging in with your google account, chance the auth_service: "google" from "google" to "ptc" for the pokemon trainer account. If that isn't clear, I made a config file for you guys here: Its similar to the one I use, and it will catch anything above cp 400 or iv 0.4, automatically sell pokemon below your highest cp one, and gets around 25k xp/hour.

ghost commented 8 years ago

I have the correct quotations and my bot worked great yesterday but now it is also doing this. Any ideas?

midnightsun183 commented 8 years ago

Ok I think I've got it. Here's what I did.

Step 1:

Clear all Docker images docker rmi $(docker images -q)

Step 2:

Change the italicized quotation marks to " " on username & password (also check the rest of the config.json for them).

Also check Pokecli.py [Also try using a differnt code editor, for some reason it doesn't always show]

Step 3:

cd to "PokemonGo-Bot" directory

Step 4:

Rebuild the image: docker build -t pokemongo-bot .

Step 6:

To run PokemonGo-Bot Docker image you've created:

docker run --name=pokego-bot1 --rm -it -v $(pwd)/configs/config-account1.json:/usr/src/app/configs/config.json pokemongo-bot

Step7:

If you change anything, or reconfigure anything; restart from step 1.

THANKS!

Big thanks to @PraeceptorXS, @Dauth

midnightsun183 commented 8 years ago

Ok I think I've got it. Here's what I did.

Step 1:

Clear all Docker images docker rmi $(docker images -q)

Step 2:

Change the italicized quotation marks to " " on username & password (also check the rest of the config.json for them).

Also check Pokecli.py [Also try using a different code editor, for some reason it doesn't always show correctly]

Step 3:

cd to "PokemonGo-Bot" directory

Step 4:

Rebuild the image: docker build -t pokemongo-bot .

Step 6:

To run PokemonGo-Bot Docker image you've created:

docker run --name=pokego-bot1 --rm -it -v $(pwd)/configs/config-account1.json:/usr/src/app/configs/config.json pokemongo-bot

Step7:

If you change anything, or reconfigure anything; restart from step 1.

THANKS!

Big thanks to @PraeceptorXS, @Dauth