PokemonGoF / PokemonGo-Bot

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

TO DEVS #5850

Closed Jcolomar closed 7 years ago

Jcolomar commented 7 years ago

Hi. As u know, a new API model wil be soon ready. That means while pogodevs RE are still try crack the last API, pokefarmer RE's has done, and they'll rent hash service to others by supscription. My question is if this proyect will adapt to this new service, or not.

After few days testing pokefarmer desktop, only can say this proyect still is best ever bot made. More configurable, thousands of options and very easy to use.

Thx to all

MerlionRock commented 7 years ago

That would depend how the API is implemented and how the subscription is done.

But don't expect it to be free anymore. Most likely would expect you to purchase the hashing key yourself and input into the config file. Something along this line.

Forget it. PF is just trying to be monopoly the whole bot thing.

MerlionRock commented 7 years ago

By the way, correction, pogodevs RE team are with PF. Basically they agree with their renting model.

This renting service will be the model they will be doing for now till end.

Jcolomar commented 7 years ago

Pokemongo-map is ready. U can patch urself very easyly to work with last api 0.51 before official announcement and patch

In requirements.txt: (remove) git+https://github.com/pogodevorg/pgoapi.git#egg=pgoapi (add) git+https://github.com/pogodevorg/pgoapi.git@develop#egg=pgoapi

Add api.activate_hash_server('key') on search.py line 498.

And it works.

Waiting changes here!!!

Greetings

MerlionRock commented 7 years ago

Currently trying to get it work with the new api, if anyone know how to solve incompatible websocket issue, please let me know.

Jcolomar commented 7 years ago

u mean bot or map?

MerlionRock commented 7 years ago

bot

Jcolomar commented 7 years ago

ohhh nice. I was looking for also. But my knowledge in pyhon is 0.

pogarek commented 7 years ago

I was able to start the bot with new api, but then it fails on inventory update. Steps done.

  1. bought a key
  2. changed git+https://github.com/pogodevorg/pgoapi.git#egg=pgoapi to git+https://github.com/pogodevorg/pgoapi.git@develop#egg=pgoapi in requirements
  3. changed "from pgoapi.protos.POGOProtos.Networking.Requests.RequestType_pb2 import RequestType" to "from pgoapi.protos.pogoprotos.networking.requests.request_type_pb2 import RequestType" in api_wrapper.py
  4. changed " from pgoapi.protos.POGOProtos.Enums import BadgeType_pb2" to "from pgoapi.protos.pogoprotos.enums import badge_type_pb2" in init.py
  5. added self.api.activate_hash_server('my_Key') in init.py , after self._setup_api() on line 147

The bots starts, logging in and fails on getting inventory:

File "e:\Poke\PokemonGo-Bot\pokemongo_bot\inventory.py", line 991, in init assert max(int(self.cp_exact), 10) == self.cp AssertionError [2016-12-28 11:54:55] [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/)

It looks like more work is needed here. I'm to new to Python and PogoApi to fix it myself.

camnomis commented 7 years ago

@pogarek that is a known issue, see #5830

Jcolomar commented 7 years ago

C:\Juegos\PokemonGO\PokemonGo-Bot>pokecli.py Traceback (most recent call last): File "C:\Juegos\PokemonGO\PokemonGo-Bot\pokecli.py", line 51, in from pokemongo_bot import PokemonGoBot, TreeConfigBuilder File "C:\Juegos\PokemonGO\PokemonGo-Bot\pokemongo_bot__init__.py", line 148 self.api.activate_hash_server('XXXXXXXXXXXXXXX') ^ IndentationError: unexpected indent

pogarek commented 7 years ago

@camnomis thanks. commenting the line makes bot running, but not moving - as it is in the #5830 .

It seems that I was wrong: earlier mentioned steps uses 0.45 api so step 5 seems to be like adding self.api.activate_hash_server('mykey') as a new line before self.login() in init.py . However after that I get an error from hashing service: "400 : Bad request, error = Invalid hash request. Please follow all requirements/guidelines."

after fixing captcha on phone and commenting line from #5830 , bot works and moves.

Jcolomar commented 7 years ago

Now with fresh install only have errors if i add self.api.activate_hash_server('XXXXXXXX')

pogarek commented 7 years ago

merging all my comments to share what I've done, to get bot running:

  1. bought a key
  2. changed -e git+https://github.com/pogodevorg/pgoapi.git#egg=pgoapi to git+https://github.com/pogodevorg/pgoapi.git@develop#egg=pgoapi in requirements
  3. changed "from pgoapi.protos.POGOProtos.Networking.Requests.RequestType_pb2 import RequestType" to "from pgoapi.protos.pogoprotos.networking.requests.request_type_pb2 import RequestType" in api_wrapper.py
  4. changed "from pgoapi.protos.POGOProtos.Enums import BadgeType_pb2" to "from pgoapi.protos.pogoprotos.enums import badge_type_pb2" in init.py
  5. added PGoApi.activate_hash_server(self,'mykey') in api_wrapper.py after line 41 (PGoApi.init(self, device_info=device_info))
  6. commented out line 152 (response = request.call()) in pgoapi.py in python installation (<python)_root>\Lib\site-packages\pgoapi\pgoapi.py)
  7. commented line mentioned in #5830
  8. fixed captcha on phone.

bot works. :) P.S. I also needed to use this: https://github.com/PokemonGoF/PokemonGo-Bot/pull/5834/files , to have Ditto supported.

camnomis commented 7 years ago

Following @pogarek latest instructions, I can't find 6 to make the change, I am using OSX, is this the python root in the bot, or the system wide python root?

Either way I am getting the error message

ImportError: No module named pogoprotos.networking.envelopes.request_envelope_pb2

But not sure if this is related to missing step 6

pogarek commented 7 years ago

@camnomis by default (at least on windows) requirements.txt has -e flag on pgoapi git, which was copying pgoapi python lib to src directory (if I recall corecctly). Removing -e installas pgoapi lib to the python directory. So I don't know how python get installed on mac, but I would search there..

MerlionRock commented 7 years ago

@camnomis I make the changes at [userdir]/PokemonGo-Bot/src/pgoapi/pgoapi

But I still end up with 400 : Bad request, error = Invalid hash request. Please follow all requirements/guidelines.

MerlionRock commented 7 years ago

This project might need some major changes... including updating pokemon.json to support all Gen 2 pokemons.

Major tasks ahead....

pogarek commented 7 years ago

@MerlionRock look for the error in the console : you should see a path to pgoapi.py there. Yes, project will need changes like:

pogarek commented 7 years ago

Update: I've created a pokemon.json with 251 pokemons. I used the script above (which uses https://fevgames.net/pokedex/) and merged it (by another script - mine in this case) with data from http://www.serebii.net/pokemongo Enjoy the results: newpoke2.zip

I've also changed inventory.py : data_for around line 446 to: def data_for(cls, pokemon_id): for data in cls.STATIC_DATA: if data.id == pokemon_id: return data

camnomis commented 7 years ago

Fresh install and it seems to work, however with the API check it's still saying 0.45.0, I had assumed adding git+https://github.com/pogodevorg/pgoapi.git@develop#egg=pgoapi in the requirements would mean its the newer API, or is 0.45.0 still the latest to be cracked?

pogarek commented 7 years ago

To have 0.51 used by bot, you need to do all of below:

  1. buy a key
  2. change requirements.txt
  3. activate the key , as has been described above. Skipping any of above will provide 0.45 api

If someone get bot working on 0.51 and needs webui working as well , then , just, overwrite your files with these from the bundle: web.zip

Probably this is my last comment with attachment in this issue. :-)

camnomis commented 7 years ago

Key was purchased from

https://talk.pogodev.org/d/51-api-hashing-service-by-pokefarmer (HashBuddy 500 RPM)

requirements.txt has git+https://github.com/pogodevorg/pgoapi.git@develop#egg=pgoapi does it need the -e?

have added the following to api_wrapper.py:

PGoApi.__init__(self, device_info=device_info) PGoApi.activate_hash_server(self,'***************')

Error message is now:

Traceback (most recent call last): File "pokecli.py", line 51, in <module> from pokemongo_bot import PokemonGoBot, TreeConfigBuilder File "/Users/xxxxx/PokemonGo-Bot/pokemongo_bot/__init__.py", line 26, in <module> from .api_wrapper import ApiWrapper File "/Users/xxxxx/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 45 PGoApi.activate_hash_server(self,'***************') ^

stricnina commented 7 years ago

must be: PGoApi.init(self, device_info=device_info) PGoApi.activate_hash_server(self,'***')

AFTER, not the same line

camnomis commented 7 years ago

It is on a different line, the formatting of the post made it go on the same line in the comments.

There is a difference, not sure if this a Mac thing or not, were as init.py is init.py

Jcolomar commented 7 years ago

Thanks to pogarek first all for his help in discord to make bot run. Now to ppl want use WebIU with this bot, he makes also some changes and i add new pictures of new pokemons. web.zip

Images of new pokemons in web: pokedex

Full new pokemons: full pokedex

Enjoy

pogarek commented 7 years ago

After a few hours with learning a git , I've made a fork of bot and webui.. So you can get all, changed, files at https://github.com/pogarek/PokemonGo-Bot/tree/dev

MerlionRock commented 7 years ago

Got it working, but not bot not moving at all....

pogarek commented 7 years ago

@MerlionRock I have no idea.. For me the issue was captcha and new TOS, that I needed to accept in a game on a phone.. Someone mentioned on discord, that removing RandomPause and RandomAlivePause from config helps .

camnomis commented 7 years ago

@pogarek thanks for the effort, hopefully its working better for others than me.

Changed everything as per your commits and its still saying I am using 0.45.0, checked buddyauth portal and the key is still showing UNUSED/INACTIVE

pogarek commented 7 years ago

@camnomis if you use pokefarmer key, then it won't work for hashing. I didn't know about this portal ; my key is active. Also with my fork the hashkey needs to be provided in config or by parameter

dogeatdog commented 7 years ago

Thanks pogarek ! I cloned your fork (dev branch) and purchased a 150 RPM hashkey. My bot is now running :) Seems to work fine (for now :)).

@camnomis Did you also checkout the dev branch on pogarek's fork ? I purchased my key at https://talk.pogodev.org/d/51-api-hashing-service-by-pokefarmer, that worked.

MerlionRock commented 7 years ago

@pogarek Sadly it doesn't work. I wonder if it's related to OS since @camnomis and myself are both on Mac OS.

Any Mac user here get the bot going (and moving?)

pogarek commented 7 years ago

@MerlionRock @camnomis It seems that you have different errors.. Can you try to backup your configs for bot and webui, delete everything from bot directory (do a backup if you want), clone my dev repo and try again ?

camnomis commented 7 years ago

@pogarek I have spun up a new ubuntu VM (not sure what OS you are using), I have cloned

git clone -b dev https://github.com/pogarek/PokemonGo-Bot

Will let you know how it goes

camnomis commented 7 years ago

It works!

MerlionRock commented 7 years ago

Great! I'll try tomorrow. Now we need someone to commit the changes....

MerlionRock commented 7 years ago

It work for me too! Great. Err... anything I can do so that the changes can be committed to here?

venney commented 7 years ago

Server busy or offline, reconnecting in 989 seconds Does someone know what this is?

What I did,

  1. git clone -b dev https://github.com/pogarek/PokemonGo-Bot
  2. ./setup.sh -i
  3. Bought the key and input into "configs/config.json"
  4. ./run.sh

=== Log === (17673) wsgi starting up on http://127.0.0.1:4000 [2017-01-06 15:41:22] [PokemonGoBot] [INFO] Setting start location. [2017-01-06 15:41:22] [PokemonGoBot] [INFO] Favorite location found: linko ([u'25.059919', u'121.368751']) [2017-01-06 15:41:22] [PokemonGoBot] [INFO] Location found: Linko (25.059919, 121.368751, 8) [2017-01-06 15:41:22] [PokemonGoBot] [INFO] Now at (25.059919, 121.368751, 8) [2017-01-06 15:41:22] [PokemonGoBot] [INFO] Login procedure started. [2017-01-06 15:41:24] [PokemonGoBot] [INFO] Server busy or offline, reconnecting in 989 seconds ^C[2017-01-06 15:41:27] [PokemonGoBot] [INFO] Bot caught SIGINT. Shutting down.

pogarek commented 7 years ago

Probably it doesn't matter, but key should be in auth.config . Have you used a bot before in the same network that you are trying now ?

venney commented 7 years ago

Yes, I used a bot before and quite familiar with it. Sorry that key is actually in configs/auth.json as you said. ( I type the post too fast without checking).

I also checked that if my key is not activated. By registering my email address to buddyhash website, the log changed JUST ONCE: === log === [2017-01-06 16:03:52] [PokemonGoBot] [INFO] Login procedure started. [2017-01-06 16:04:01] [PokemonGoBot] [INFO] Login successful. [2017-01-06 16:04:01] [PokemonGoBot] [INFO] [2017-01-06 16:04:01] [PokemonGoBot] [INFO] Server busy or offline, reconnecting in 1009 seconds === log ===

Then all "server busy or offline" when running ./run.sh

Any idea ? Many thanks.

dogeatdog commented 7 years ago

I get that message a lot myself, but a much lower retry time (around 50-90 seconds). I always contributed this to the hashing server being overloaded. Not true?

Op vr 6 jan. 2017 om 09:15 schreef venney notifications@github.com

Yes, I used a bot before and quite familiar with it.

Sorry that key is actually in configs/auth.json as you said. ( I type the post too fast without checking).

I also checked that if my key is not activated.

By registering my email address to buddyhash website, the log changed JUST ONCE:

=== log ===

[2017-01-06 16:03:52] [PokemonGoBot] [INFO] Login procedure started.

[2017-01-06 16:04:01] [PokemonGoBot] [INFO] Login successful.

[2017-01-06 16:04:01] [PokemonGoBot] [INFO]

[2017-01-06 16:04:01] [PokemonGoBot] [INFO] Server busy or offline, reconnecting in 1009 seconds

=== log ===

Then all "server busy or offline" when running ./run.sh

Any idea ?

Many thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PokemonGoF/PokemonGo-Bot/issues/5850#issuecomment-270853682, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKpcu3mcE1JbhE1nwixyKQ2BURfzdR9ks5rPfgdgaJpZM4LU95q .

venney commented 7 years ago

@dogeatdog , So... I just try to run ./run.sh periodically 50-90 seconds, it will work then?

dogeatdog commented 7 years ago

Yes, but it might take a couple of retries. It will also disconnect a lot of times while the bot is running, but will reconnect eventually. I never had this issue with the unforked version, and since the main difference is the hashing server, I can only assume this is the reason.

I'll check my config and let you know the setting to change the time out shortly .

Op vr 6 jan. 2017 om 09:21 schreef venney notifications@github.com

@dogeatdog https://github.com/dogeatdog , So... I just try to run ./run.sh periodically 50-90 seconds, it will work then?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/PokemonGoF/PokemonGo-Bot/issues/5850#issuecomment-270854485, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKpciGwR_mdAFyfmq_B9gPnVX_GCuUhks5rPfmCgaJpZM4LU95q .

pogarek commented 7 years ago

At this moment of time it seems that there is an outage on hashing servers...

venney commented 7 years ago

Thanks for the information. So basically, what I did is already enough to run the bot, right? Many thanks for the help & contribution. :-)

pogarek commented 7 years ago

Yes. Np. :-) I'm newbie to python, but I know another languages . And changes needed to be done wasn't to much difficult - I just had time in a proper moment :-)

pogarek commented 7 years ago

Servers seems to be back online

dogeatdog commented 7 years ago

Yup, confirmed. Working here as well. I hope they do get their capacity up soon, since this is now a paid service, one might expect a stable server from the guys providing the hashing server(s).

venney commented 7 years ago

After two "login succesfully" & "server offline...", the bot starts at 3rd trial. it's running now and captured one pokemon... Great and thanks for the help. Hooray!

dogeatdog commented 7 years ago

@pogarek I'm not too familiar with github, but is it possible to enable the Issues on your fork ? Keeping communication about your fork through comments on an old issue on the original project is not ideal :)