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

Improve log messages while walking to forts

Open HeIix opened this issue 10 years ago • 6 comments

Expected Behavior

After starting the bot, move to next pokestop while catching pokemon.

Actual Behavior

Does not catch pokemon and outputs the following:

I removed PokeStop name and lat/lon to maintain anonymity.

[20:39:53] Starting PokemonGo Bot.... [20:39:54] [x] Found fort a3186fabf81d47f69e1433f4928b273c.16 at distance 0.02km [20:39:54] [x] Need to move closer to Pokestop [20:39:57] [x] Found fort a3186fabf81d47f69e1433f4928b273c.16 at distance 0.02km [20:39:57] [x] Need to move closer to Pokestop [20:40:01] [x] Found fort a3186fabf81d47f69e1433f4928b273c.16 at distance 0.01km [20:40:01] [x] Need to move closer to Pokestop [20:40:04] [x] Found fort a3186fabf81d47f69e1433f4928b273c.16 at distance 0.01km [20:40:04] [o] Arrived at Pokestop [20:40:05] Now at Pokestop: [20:40:05] Spinning ... [20:40:05] Possibly searching too often - taking a short rest :) [20:40:05] Scanning area for objects.... [20:40:05] Walking from () to [] 0.01km [20:40:12] [x] Found fort 78618cf46d344592a76869b8d14d2dc0.16 at distance 0.09km [20:40:12] [x] Need to move closer to Pokestop

Steps to Reproduce

Starting the bot on "all" mode.

Other Information

OS: Debian Git Commit: f9468efb454c0e32d87fa7bfc1d398d4c1d65fcf

HeIix avatar Jul 27 '16 20:07 HeIix

Same problem.

git log f9468efb454c0e32d87fa7bfc1d398d4c1d65fcf

endeavor7 avatar Jul 27 '16 21:07 endeavor7

I don't believe this is an issue. Prior to this, the bot used to have a progress bar (which didn't work correctly) showing distance to Pokestop. Now it just shows the distance logged out line by line. I believe the repeat may have to deal with the update and steps. If it wasn't truncated to two decimal positions, I think you would see a difference (maybe a third decimal position) between them.

Dekryptid avatar Jul 27 '16 21:07 Dekryptid

Yeah, I believe this is intended behavior. There are probably ways we can improve the log messages though.

elicwhite avatar Jul 27 '16 22:07 elicwhite

Is the movement speed appearing ridiculously low for a reason? I even went so far as to change the config file speed to 50.0 and it still took almost 5 minutes to move 0.1km.

endeavor7 avatar Jul 27 '16 22:07 endeavor7

modification of the format_dist function to use an appropriate unit seems to clean it up

def format_dist(distance, unit='m'):
    metric = ('mm', 'cm', 'm', 'km')
    imperial = ('ft', 'yd', 'mi')
    system = reversed(metric)
    if unit in imperial:
        system = reversed(imperial)
    for unit in system:
        d = convert(distance, 'm', unit)
        if d >= 1:
            return dist_to_str(d, unit)
    return dist_to_str(convert(distance, 'm', unit), unit)

output looks like

[17:15:24] [x] Found fort 6c135167e4634d459efcd1db451b9f93.16 at distance 85.68m
[17:15:24] [x] Need to move closer to Pokestop
[17:15:28] [x] Found fort 6c135167e4634d459efcd1db451b9f93.16 at distance 83.65m
[17:15:28] [x] Need to move closer to Pokestop
[17:15:31] [x] Found fort 6c135167e4634d459efcd1db451b9f93.16 at distance 79.72m
[17:15:31] [x] Need to move closer to Pokestop
[17:15:35] [x] Found fort 6c135167e4634d459efcd1db451b9f93.16 at distance 78.16m

Simage avatar Jul 27 '16 23:07 Simage

Found fort 4968a19d699d40549694c095e7fe3e74.16 at distance 0.04km (initial distance 0.05km) progress [||||||||| ] 27%

would this be an improvement?

EDIT: extra spaces being dropped by the commentbox i guess

klingan avatar Jul 29 '16 08:07 klingan