PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Log in Color

Open DimaVIII opened this issue 10 years ago • 27 comments

How to activate the log in color as it was before the api update?

DimaVIII avatar Aug 07 '16 06:08 DimaVIII

The colors have been stripped. There is no easy toggle at the moment.

ColdSunERA avatar Aug 07 '16 06:08 ColdSunERA

Why was the color removed in the first place?

celus avatar Aug 07 '16 06:08 celus

It's somewhere in https://github.com/keyphact/pgoapi right?

DimaVIII avatar Aug 07 '16 06:08 DimaVIII

No. It isn't in the pgoapi, and there is no easy way to turn it in.

ColdSunERA avatar Aug 07 '16 06:08 ColdSunERA

They stripped the color before the change if I recall then the API changed. It's sort of a mess right now compared to before. I don't know if they plan to move this info to the map or not. The old map you could just drop clones of folders with different configs for different bots and open each index to see where they were at. They changed that as well so I haven't bothered to look again.

I do miss that color coding as I run multiple monitors so if I'm walking by or happen to be at the desk I know exactly what's going and if things are running correctly. I'll have to look and see if the map is any good like before.

Baconnaise avatar Aug 07 '16 07:08 Baconnaise

It is such a mess right now without colors... Please somebody bring them back

iruy avatar Aug 07 '16 11:08 iruy

+1 I favor the colors as well! Much easier to read back

tvb avatar Aug 07 '16 12:08 tvb

Quick and dirty fix: Save this as colorizer.sh in the PokemonGo-Bot directory:

#!/bin/bash

red=$(tput bold;tput setaf 1)            
green=$(tput setaf 2)                    
yellow=$(tput bold;tput setaf 3)         
fawn=$(tput setaf 3)
blue=$(tput bold;tput setaf 4)           
purple=$(tput setaf 5)
pink=$(tput bold;tput setaf 5)           
cyan=$(tput bold;tput setaf 6)           
gray=$(tput setaf 7)                     
white=$(tput bold;tput setaf 7)          
normal=$(tput sgr0)                      

sep=`echo -e '\001'` # use \001 as a separator instead of '/'

while [ -n "$1" ] ; do
  color=${!1}
  pattern="$2"
  shift 2

  rules="$rules;s$sep\($pattern\)$sep$color\1$normal${sep}g"
done

#stdbuf -o0 -i0 sed -u -e "$rules"
sed -u -e "$rules"

(from https://stackoverflow.com/questions/241325/color-regex-matches-without-dropping-misses)

Then run something like this: python pokecli.py 2>&1 | ./colorizer.sh red ".*PokemonCatchWorker.*" blue ".*TransferPokemon.*" green ".*IncubateEggs.*" yellow ".*SpinFort.*" pink ".*CollectLevelUpReward.*"

nikmess avatar Aug 07 '16 12:08 nikmess

Then run something like this: python pokecli.py 2>&1 | ./colorizer.sh red ".PokemonCatchWorker." blue ".TransferPokemon." green ".IncubateEggs." yellow ".SpinFort." pink ".CollectLevelUpReward."

If you're using Mac you may need to install gnu-sed using brew. Then you must change sed -u -e "$rules" to gsed -u -e "$rules"

Kyokoo avatar Aug 07 '16 14:08 Kyokoo

anyone know how to do this in windows? python pokecli.py 2>&1 | ./colorizer.sh red ".*PokemonCatchWorker.*" blue ".*TransferPokemon.*" green ".*IncubateEggs.*" yellow ".*SpinFort.*" pink ".*CollectLevelUpReward.*" end up giving an error

crvfts avatar Aug 07 '16 14:08 crvfts

That script works only on *nix systems. You might want to have a look at Cygwin, which gives you a unix style terminal under Windows. edit: or if you used Git for Windows to clone this repo, you can just as well use the MINGW64 shell that comes with it - which is what I'm doing.

nikmess avatar Aug 07 '16 15:08 nikmess

@nikmess works perfectly with Git for Windows! I was previously attempting to run the line from Windows command line.

Thank you for your help!

crvfts avatar Aug 07 '16 15:08 crvfts

@nikmess Using your script I donc have any stats when session end :/

Kyokoo avatar Aug 07 '16 15:08 Kyokoo

It seems the problem is not (only?) my script, but rather the mingw shell. Killing "python pokecli.py" with ^c gives no stats either in mingw.

nikmess avatar Aug 07 '16 15:08 nikmess

Or you can just use my cell workers. I added colors and they are working fine.

cell_workers.zip

serberus7 avatar Aug 07 '16 16:08 serberus7

@serberus7 not working for Windows 10 unfortunately.

4xx31 avatar Aug 07 '16 16:08 4xx31

Lol @Zedronar then what is this? lol

serberus7 avatar Aug 07 '16 17:08 serberus7

@serberus7 Must be something wrong with my configuration then.

4xx31 avatar Aug 07 '16 17:08 4xx31

For anyone on OSX, go to the directory, and type

source bin/activate 
brew install gsed
sudo vim colorizer.sh

then inside vim copy paste this version of @nikmess 's script

#!/bin/bash

red=$(tput bold;tput setaf 1)            
green=$(tput setaf 2)                    
yellow=$(tput bold;tput setaf 3)         
fawn=$(tput setaf 3)
blue=$(tput bold;tput setaf 4)           
purple=$(tput setaf 5)
pink=$(tput bold;tput setaf 5)           
cyan=$(tput bold;tput setaf 6)           
gray=$(tput setaf 7)                     
white=$(tput bold;tput setaf 7)          
normal=$(tput sgr0)                      

sep=`echo -e '\001'` # use \001 as a separator instead of '/'

while [ -n "$1" ] ; do
  color=${!1}
  pattern="$2"
  shift 2

  rules="$rules;s$sep\($pattern\)$sep$color\1$normal${sep}g"
done

#stdbuf -o0 -i0 gsed -u -e "$rules"
gsed -u -e "$rules"

type :wq to save and quit the file

then type sudo chmod 777 colorizer.sh

After that you can use @nikmess 's script again python pokecli.py 2>&1 | ./colorizer.sh red ".*PokemonCatchWorker.*" blue ".*TransferPokemon.*" green ".*IncubateEggs.*" yellow ".*SpinFort.*" pink ".*CollectLevelUpReward.*"

Sayujya avatar Aug 07 '16 18:08 Sayujya

@serberus7 Works great. Thank you.

Win7x64.

Baconnaise avatar Aug 07 '16 19:08 Baconnaise