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

TO DEVS #5850

Closed
Jcolomar opened this issue Dec 23, 2016 · 69 comments
Closed

TO DEVS #5850

Jcolomar opened this issue Dec 23, 2016 · 69 comments

Comments

@Jcolomar
Copy link
Contributor

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
Copy link
Contributor

MerlionRock commented Dec 24, 2016

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
Copy link
Contributor

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
Copy link
Contributor Author

Jcolomar commented Dec 27, 2016

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
Copy link
Contributor

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

@Jcolomar
Copy link
Contributor Author

u mean bot or map?

@MerlionRock
Copy link
Contributor

bot

@Jcolomar
Copy link
Contributor Author

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

@pogarek
Copy link
Contributor

pogarek commented Dec 28, 2016

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
Copy link

@pogarek that is a known issue, see #5830

@Jcolomar
Copy link
Contributor Author

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
Copy link
Contributor

pogarek commented Dec 28, 2016

@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
Copy link
Contributor Author

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

@pogarek
Copy link
Contributor

pogarek commented Dec 28, 2016

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 This line fails: assert max(int(self.cp_exact), 10) == self.cp #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
Copy link

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
Copy link
Contributor

pogarek commented Dec 29, 2016

@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
Copy link
Contributor

@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
Copy link
Contributor

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

Major tasks ahead....

@pogarek
Copy link
Contributor

pogarek commented Dec 29, 2016

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

@pogarek
Copy link
Contributor

pogarek commented Dec 29, 2016

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
Copy link

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
Copy link
Contributor

pogarek commented Dec 29, 2016

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
Copy link

camnomis commented Dec 29, 2016

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
Copy link

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

AFTER, not the same line

@camnomis
Copy link

camnomis commented Dec 29, 2016

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
Copy link
Contributor Author

Jcolomar commented Dec 29, 2016

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
Copy link
Contributor

pogarek commented Dec 29, 2016

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
Copy link
Contributor

MerlionRock commented Dec 30, 2016

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

@pogarek
Copy link
Contributor

pogarek commented Dec 30, 2016

@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
Copy link

@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

@dogeatdog
Copy link

dogeatdog commented Jan 6, 2017 via email

@venney
Copy link

venney commented Jan 6, 2017

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

@dogeatdog
Copy link

dogeatdog commented Jan 6, 2017 via email

@pogarek
Copy link
Contributor

pogarek commented Jan 6, 2017

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

@venney
Copy link

venney commented Jan 6, 2017

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

@pogarek
Copy link
Contributor

pogarek commented Jan 6, 2017

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
Copy link
Contributor

pogarek commented Jan 6, 2017

Servers seems to be back online

@dogeatdog
Copy link

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
Copy link

venney commented Jan 6, 2017

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
Copy link

@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 :)

@venney
Copy link

venney commented Jan 6, 2017

Is it possible to run the same hash key ( 150RPM ) by two bots ?
Does anyone try this?

@pogarek
Copy link
Contributor

pogarek commented Jan 6, 2017

@dogeatdog I didn't know that I can/need to enable it - I thought it is restricted to main repo. It is enabled now - thanks for the idea
@venney I have one 150RPM key used by 3 bots.

@MerlionRock
Copy link
Contributor

@venney Base on output by a different bot, per bot estimate using approximately 30RPM. Therefore, per key could likely used by 5 accounts. But this estimation is done base on a different bot. This bot might be using more RPM.

@pogarek
Copy link
Contributor

pogarek commented Jan 10, 2017

Guys, this/the main repo is updated now (included my changes) and it supports 0.51. :-)

@MerlionRock
Copy link
Contributor

@pogarek Finally!

@venney
Copy link

venney commented Jan 10, 2017

Mmm... Pogarek's fork was working fine yesterday.
Now I got API check error. Does anyone know what I miss?

========
0.51.0
We have detected a Pokemon API Change. The current API version 0.45.0 is no longer supported. Exiting...
Wed Jan 11 00:00:47 CST 2017 Pokebot Stopped.

@pogarek
Copy link
Contributor

pogarek commented Jan 10, 2017

HI Venney
The main repo (https://github.com/PokemonGoF/PokemonGo-Bot) got updated with mine (and other changes). So 0.51 is still working, but also a kill switch got implemented :-) It can be disabled in config:

"check_niantic_api": false

@venney
Copy link

venney commented Jan 10, 2017

Hi Pogarek,
Thanks. I will try. ( Currently, I copied your fork from other computer & not update it. Ha)
I knew this settings but we already download 0.51 stuffs from Internet when doing setup.sh -i.
So I think the checking should be passed.
But it turned out not from your saying. Why?

@pogarek
Copy link
Contributor

pogarek commented Jan 10, 2017

the check was done before 0.51 got implemented. I mean the check was awaiting to be merged.
I think it is , actually, ok that sends the message. User then try to investigate and discover that buying a hashing key is required ( I mean for new user) :)

@MerlionRock
Copy link
Contributor

@pogarek I agree. Just want to check if 0.45 still working? Is there a way to set the bot to run 0.45 for those who are adventurous?

Actually we can just update the installation script to include hash key input so that user will know that a hash key is required. In fact, you can also add in disclaimer that hash key is provided by 3rd party.

@pogarek
Copy link
Contributor

pogarek commented Jan 11, 2017

I don't think that bot will work in 0.45 ("check_niantic_api": false + no hash key provided).
Installation script ? do you mean .\setup.sh and windows_bat\PokemonGo-Bot-Configurator.bat ?

@MerlionRock
Copy link
Contributor

@pogarek Yes, I mean "./setup.sh -i" and PokemonGo-Bot-Configurator.bat

@pogarek
Copy link
Contributor

pogarek commented Jan 12, 2017

Yeah, we will update that.

@dogeatdog
Copy link

dogeatdog commented Jan 12, 2017

Uhm.. I appreciate it and all, but after the last setup.sh -u I couldn't get it to work anymore.

So, I created a fresh one :

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

Copied my old config.json and auth.json (with the hash key).

Added the check_niantic_api : false line in config.json

And now all I get is :

2017-01-12 18:43:53] [pgoapi.pgoapi] [ERROR] Request for new Access Token failed! Logged out...
[2017-01-12 18:43:53] [PokemonGoBot] [INFO] Not logged in, reconnecting in 63 seconds
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/dennis/dev/pogamaster/PokemonGo-Bot/pokemongo_bot/socketio_server/runner.py", line 34, in _start_listening_blocking
    listener = eventlet.listen((self.host, self.port))
  File "/home/dennis/dev/pogamaster/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/convenience.py", line 43, in listen
    sock.bind(addr)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use

Any idea on how I can fix this ? It worked perfectly until the last update..

@pogarek
Copy link
Contributor

pogarek commented Jan 12, 2017

check #5867
and my repo is on the same level as the main one here.

@dogeatdog
Copy link

Aha, missed that one. Just did another clean clone, this time from the main repo master. And now it's just the Server busy or offline message, which is normal when the hashing servers are working their asses off.. I'll let it run for a while and check later. If it still doesn't work, I'll give #5867 a try. Thanks for the support !

@venney
Copy link

venney commented Jan 13, 2017

I stay with Pogarek's working fork before. :-)
One simple question here:
Do you use the same IP (computer) to run more than 1 bot ? Is it safe?
( I ran two BOTs in two different computers now )

@pogarek
Copy link
Contributor

pogarek commented Jan 13, 2017

I have 3 bots on one cmputer

@venney
Copy link

venney commented Jan 13, 2017

@pogarek , Cool. Thanks.

@pogarek pogarek closed this as completed Feb 2, 2017
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

7 participants