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

Coordinates

Open siembz opened this issue 10 years ago • 15 comments

Hi,

Why is the coordinates showing in the terminal ?

Moving towards pokestop Valberg Tower Valbergstårnet - 0.07km [17:42:48] {'distance_unit': '', 'distance': '', 'current_position': (58.97230424031362, 5.730717359423945), 'last_position': (58.97242817036925, 5.730551884795199)}

OSX

siembz avatar Aug 10 '16 15:08 siembz

Woud be nice if this could be an option in the config, this create's big logs with data most of the poeple don't need to see.

nielseulink avatar Aug 10 '16 16:08 nielseulink

i suspect someone just left a debugging message in their code when they committed

bigkraig avatar Aug 10 '16 20:08 bigkraig

#3431

nearalias avatar Aug 10 '16 20:08 nearalias

@nearalias Its still showing the message even if the debug is false skjermbilde 2016-08-11 kl 00 39 50 skjermbilde 2016-08-11 kl 00 39 28

siembz avatar Aug 10 '16 22:08 siembz

With the latest dev version it's still shows me the coordinates.

nielseulink avatar Aug 11 '16 07:08 nielseulink

It's because a bug in the step_walker.py

In the line 58 the method bot.event_manager.emit() is called without the formatted param.

` self.bot.event_manager.emit(

        'position_update',

        sender=self,

        level='debug',

        data={

            'current_position': (cLat, cLng),

            'last_position': (self.initLat, self.initLng),

            'distance': '',

            'distance_unit': ''

        }

    )

`

And it should be something like:

` self.bot.event_manager.emit(

        'position_update',

        sender=self,

        level='debug',

        formatted="Distance {distance}",

        data={

            'current_position': (cLat, cLng),

            'last_position': (self.initLat, self.initLng),

            'distance': self.dist,

            'distance_unit': ''

        }

    )

`

FranWatcher avatar Aug 11 '16 09:08 FranWatcher

Changing this to the above results in an terminal log line with "Distance" with nothing else behind it. But the distance itself is already logged in the line above. So the whole line should not be there.

[11:41:03] Moving towards pokestop xxxxxxxxxxxxxx - 0.08km
[11:41:03] Distance

BasvanH avatar Aug 11 '16 09:08 BasvanH

It depends on the type of walker task you are running. I guess you're running a "MoveToFort" walker and that's because you're already getting the distance info. I'm using a "FollowPath" and it's thankful some feedback. But you're right, you can comment the method bot.event_manager.emit() calling.

FranWatcher avatar Aug 11 '16 09:08 FranWatcher

i changed as suggested, to this

    self.bot.event_manager.emit(
        'position_update',
        sender=self,
        level='debug',
        formatted="Distance: {distance}",
        data={
            'current_position': (cLat, cLng),
            'last_position': (self.initLat, self.initLng),
            'distance': self.dist,
            'distance_unit': ''
        }
    )

i got this result,

[17:48:00] Moving towards pokestop Weird Statue - 0.05km [17:48:00] Distance: 54.9957639447 [17:48:03] Moving towards pokestop Weird Statue - 0.05km [17:48:03] Distance: 49.9464037463 [17:48:05] Moving towards pokestop Weird Statue - 0.05km [17:48:05] Distance: 45.3039129926

rzlan avatar Aug 11 '16 09:08 rzlan

Yes, it's still a little bit annoying. I gess you can try by commenting all the lines of the event_manager.emit method calling. But as I said in a previous message it depends on the type of walker you choose.

FranWatcher avatar Aug 11 '16 09:08 FranWatcher

i can live with this proper formatted view rather then the buggy type of msg previously :) commenting it out as u suggested .. worked!

[18:01:59] Moving towards pokestop Kinetik I, Tower 1 Lobby, PETR - 0.08km [18:02:01] Moving towards pokestop Kinetik I, Tower 1 Lobby, PETR - 0.08km [18:02:04] Moving towards pokestop Kinetik I, Tower 1 Lobby, PETR - 0.08km

thx Fran for this temporary fix...

rzlan avatar Aug 11 '16 09:08 rzlan

This is a big in the coloured logger that isn't respecting debug log level in the messages sent by bot's tasks. Just stop using it and you won't see this problem, because the coloured logger doesn't respect any logging level at all.

douglascamata avatar Aug 11 '16 10:08 douglascamata

@douglascamata how to disable the coloured logger, what are the other options ? Or just dont use the log at al?

hogendoorn avatar Aug 11 '16 11:08 hogendoorn

@flippamike "logging_color": false

relomy avatar Aug 11 '16 12:08 relomy

In colored_logging_handler.py you can add:

if event == 'position_update':
    return

under

# Replace message if necessary
if event == 'catchable_pokemon':
    message = 'Something rustles nearby!'

And it'll stop updating with that message.

Edit: hey it took 10 edits but I finally figured out how to do MD multiline code formatting.

relomy avatar Aug 11 '16 12:08 relomy