rubenvereecken / pokemongo-api

Pokemon Go API for Python
Other
359 stars 120 forks source link

Correctly calling catchPokemon #35

Closed f998601 closed 8 years ago

f998601 commented 8 years ago

Hello, I am having problems with trying to execute session.catchPokemon(130, 1) where I get TabError: inconsistent use of tabs and spaces in indentation

obiben commented 8 years ago

That`s because you have a tab instead of spaces. In your editor of choice, make sure settings use 4 spaces for each tabs instead of "actual tabs" (the \t character).

There'll usually be a ¶ button to show special characters. You'll see an arrow instead of dots where you put your tabs in.

f998601 commented 8 years ago

Can't belive i've missed that, well it is clearly visible that I am new to python, but after inserting spaces I've received: File "C:\Users\Mstr\Downloads\pokemongo-api-master\pogo\session.py", line 356, in catchPokemon encounter_id=pokemon.encounter_id, AttributeError: 'int' object has no attribute 'encounter_id' As far as I can see I should not pass the pokemon as an Id, but what datatype should I pass it as? and does 'Pokemon Go' have any protection against targeting a pokemon that is not "in your area" or is this not accounted for in their backend?

obiben commented 8 years ago

I don't know whether there's a limit in distance. In any case, you should be passing a pokemon returned by one of the functions made to search for pokemons.

f998601 commented 8 years ago

I appreciate your help, one thing I do not understand, after going through the code in demo.py, it should clean the inventory and pokemons/transfer, but this function is not running when calling the script?

obiben commented 8 years ago

They're demo functions that you're free to use at your own convenience in a program of your own. This is meant to be an API to build things of your own.