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

FollowPath alt error #4493

Closed
kustavo opened this issue Aug 21, 2016 · 6 comments
Closed

FollowPath alt error #4493

kustavo opened this issue Aug 21, 2016 · 6 comments

Comments

@kustavo
Copy link

kustavo commented Aug 21, 2016

Expected Behavior

Run Bot with FollowPath

Actual Behavior

Problem when I use FollowPath, it occurs in first bot move

Your FULL config.json (remove your username, password, gmapkey and any other private info)

{
"auth_service": "ptc",
"username": xxxxxxxxxxx
"password": xxxxxxxxxxx
"location": "40.76541677965853, -73.97563576698303, 22",
"gmapkey": xxxxxxxxxxx
"encrypt_location": "",
"websocket_server": false,
"heartbeat_threshold": 10,

"tasks": [
    {"type": "HandleSoftBan"},

    {"type": "SleepSchedule",
        "config": {
            "enabled": true,
            "time": "22:42",
            "duration":"8:45",
            "time_random_offset": "00:22",
            "duration_random_offset": "00:38"}},

    {"type": "RandomPause",
        "config": {
            "enabled": true,
            "min_duration": "00:01:00",
            "max_duration": "00:10:00",
            "min_interval": "00:20:00",
            "max_interval": "01:30:00"}},

    {"type": "CompleteTutorial",
        "config": {
            "enabled": true,
            "// set a name": "",
            "nickname": "xxxxxxxxxxx}},

    {"type": "CollectLevelUpReward"},

    {"type": "IncubateEggs",
        "config": {
            "longer_eggs_first": true}},

    {"type": "UpdateLiveStats",
        "config": {
            "enabled": true,
            "min_interval": 60,
            "stats": ["username", "uptime", "km_walked", "xp_earned", "xp_per_hour", "stops_visited", "pokemon_caught", "captures_per_hour", "highest_cp_pokemon", "most_perfect_pokemon"],
            "terminal_log": true,
            "terminal_title": true}},

    {"type": "UpdateLiveInventory",
        "config": {
            "enabled": true,
            "min_interval": 120,
            "show_all_multiple_lines": false,
            "items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]}},

    {"type": "TransferPokemon",
        "config": {
            "min_free_slot": 3,
            "transfer_wait_min": 4,
            "transfer_wait_max": 6}},

    {"type": "NicknamePokemon",
        "config": {
            "enabled": true,
            "nickname_template": "{iv_pct}_{iv_ads}"}},

    {"type": "EvolvePokemon",
        "config": {
            "evolve_all": "none",
            "first_evolve_by": "cp",
            "evolve_above_cp": 900,
            "evolve_above_iv": 0.9,
            "logic": "or",
            "evolve_speed": 30,
            "use_lucky_egg": false}},

    {"type": "RecycleItems",
        "config": {
            "min_empty_space": 10,
            "max_balls_keep": 150,
            "max_potions_keep": 50,
            "max_berries_keep": 70,
            "max_revives_keep": 70,
            "item_filter": {
                "Pokeball":       { "keep" : 100 },
                "Potion":         { "keep" : 10 },
                "Super Potion":   { "keep" : 20 },
                "Hyper Potion":   { "keep" : 30 },
                "Revive":         { "keep" : 30 },
                "Razz Berry":     { "keep" : 100 }},
            "recycle_wait_min": 4,
            "recycle_wait_max": 6}},

    {"type": "CatchPokemon",
        "config": {
            "catch_visible_pokemon": true,
            "catch_lured_pokemon": true,
            "min_ultraball_to_keep": 5,
            "berry_threshold": 0.35,
            "vip_berry_threshold": 0.9,
            "catch_throw_parameters": {
                "excellent_rate": 0.1,
                "great_rate": 0.3,
                "nice_rate": 0.3,
                "normal_rate": 0.3,
                "spin_success_rate" : 0.4,
                "hit_rate": 0.75},
            "catch_simulation": {
                "flee_count": 3,
                "flee_duration": 3,
                "catch_wait_min": 3,
                "catch_wait_max": 6,
                "berry_wait_min": 2,
                "berry_wait_max": 4,
                "changeball_wait_min": 3,
                "changeball_wait_max": 5}}},

    {"type": "SpinFort",
        "config": {
            "spin_wait_min": 2,
            "spin_wait_max": 5}},

    {"type": "FollowPath",
        "config": {
        "path_mode": "loop",
        "path_start_mode": "closest",
        "path_file": "configs/path.json"}}

],

"map_object_cache_time": 5,
"forts": {
    "avoid_circles": true,
    "max_circle_size": 50,
    "cache_recent_forts": true},

"pokemon_bag": {
    "// if 'show_at_start' is true, it will log all the pokemons in the bag (not eggs) at bot start": {},
    "show_at_start": true,
    "// if 'show_count' is true, it will show the amount of each pokemon (minimum 1)": {},
    "show_count": false,
    "// 'pokemon_info' parameter define which info to show for each pokemon": {},
    "// the available options are": {},
    "// ['cp', 'iv_ads', 'iv_pct', 'ivcp', 'ncp', 'level', 'hp', 'moveset', 'dps']": {},
    "pokemon_info": ["cp", "iv_pct"]},

"walk_max": 3.9,
"walk_min": 1.0,
"alt_min": 7.0,
"alt_max": 35.0,
"gps_default_altitude": 8.0,
"replicate_gps_xy_noise": false,
"replicate_gps_z_noise": false,
"gps_xy_noise_range": 0.000125,
"gps_z_noise_range": 5.5,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"logging_color": true,
"daily_catch_limit": 800,

"catch": {
    "any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
    "// Example of always catching Rattata:": {},
    "// Rattata": { "always_catch" : true }
},

"release": {
    "any":         {"release_below_cp": 900, "release_below_iv": 85, "logic": "or"},
    "any":         {"keep_best_cp": 1, "keep_best_iv": 1},
    "Rattata":     {"keep_best_cp": 5, "keep_best_iv": 5},
    "Pidgey":      {"keep_best_cp": 10, "keep_best_iv": 10},
    "Weedle":      {"keep_best_cp": 5, "keep_best_iv": 5},
    "Caterpie":    {"keep_best_cp": 5, "keep_best_iv": 5},
    "Eevee":       {"keep_best_cp": 2, "keep_best_iv": 2},
    "Zubat":       {"keep_best_cp": 2, "keep_best_iv": 1},

    "// Example of always releasing Rattata:": {},
    "// Rattata": {"always_release": true},
    "// Example of keeping 3 stronger (based on CP) Pidgey:": {},
    "// Pidgey": {"keep_best_cp": 3},
    "// Example of keeping 2 stronger (based on IV) Zubat:": {},
    "// Zubat": {"keep_best_iv": 2},
    "// Also, it is working with any": {},
    "// any": {"keep_best_iv": 3},
    "// Example of keeping the 2 strongest (based on CP) and 3 best (based on IV) Zubat:": {},
    "// Zubat": {"keep_best_cp": 2, "keep_best_iv": 3}
},

"vips" : {
    "// Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
    "any":          {"catch_above_cp": 1200, "catch_above_iv": 0.9, "logic": "or" },
    "Lapras":       {},
    "Moltres":      {},
    "Zapdos":       {},
    "Articuno":     {},
    "Mewtwo":       {},
    "Dragonite":    {},
    "Snorlax":      {},
    "Mew":          {},
    "Arcanine":     {},
    "Vaporeon":     {},
    "Gyarados":     {},
    "Exeggutor":    {},
    "Muk":          {},
    "Weezing":      {},
    "Flareon":      {}
}

}

path.json file

[
    {"location": "40.76541677965853, -73.97563576698303, 22"},
    {"location": "40.76538021307231, -73.97502958774567, 22"},
    {"location": "40.765148624225766, -73.97421687841415, 23"},
    {"location": "40.76573165776276, -73.9736670255661, 23"},
    {"location": "40.766052628746415, -73.9733237028122, 23"},
    {"location": "40.76645485601841, -73.97337734699249, 24"},
    {"location": "40.766643780108936, -73.97302329540253, 24"},
    {"location": "40.766968809545446, -73.97195309400558, 24"},
    {"location": "40.76729688452079, -73.9714689552784, 22"},
    {"location": "40.767571125517435, -73.9711457490921, 22"},
    {"location": "40.76785755379453, -73.97099286317825, 22"},
    {"location": "40.76812671399359, -73.97119134664536, 23"},
    {"location": "40.76861018391515, -73.97095263004303, 23"},
    {"location": "40.76927241011572, -73.97086411714554, 23"},
    {"location": "40.77008901125176, -73.97116988897324, 22"},
    {"location": "40.76983509406315, -73.97237151861191, 22"},
    {"location": "40.769868611187626, -73.97272825241089, 22"},
    {"location": "40.77080809946503, -73.97223472595215, 22"},
    {"location": "40.771665307449766, -73.97183775901794, 21"},
    {"location": "40.77241281628654, -73.97183239459991, 21"},
    {"location": "40.77284750505814, -73.97183239459991, 21"},
    {"location": "40.77210406365598, -73.97335857152939, 22"},
    {"location": "40.77222390859742, -73.97380381822586, 22"},
    {"location": "40.77301812978003, -73.97421687841415, 23"},
    {"location": "40.77290234876653, -73.97463530302048, 23"},
    {"location": "40.77286781754798, -73.9751449227333, 23"},
    {"location": "40.77275406752473, -73.97630095481873, 22"},
    {"location": "40.770795911594035, -73.9777010679245, 22"},
    {"location": "40.7705684042586, -73.97842526435852, 22"},
    {"location": "40.77003619655644, -73.97831797599792, 23"},
    {"location": "40.76987775221865, -73.97877931594849, 22"},
    {"location": "40.768813321488174, -73.979412317276, 22"},
    {"location": "40.76820390690611, -73.98091435432434, 22"},
    {"location": "40.76761480083096, -73.98104041814804, 22"},
    {"location": "40.76731618299831, -73.98042619228363, 22"},
    {"location": "40.766956620970255, -73.97888123989105, 22"},
    {"location": "40.76633093777489, -73.97813022136688, 22"},
    {"location": "40.76611763533916, -73.97733092308044, 22"}

]

Output when issue occurred

Traceback (most recent call last):
  File "pokecli.py", line 674, in <module>
    main()
  File "pokecli.py", line 118, in main
    bot.tick()
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/pokemongo_bot/__init__.py", line 541, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/pokemongo_bot/cell_workers/follow_path.py", line 143, in work
    'current_position': (lat, lng, alt),
UnboundLocalError: local variable 'alt' referenced before assignment
2016-08-21 14:10:34,450 [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 895, in _send_output
    msg += message_body
  File "/media/gustavo/Arquivos/Downloads/_000_Programas/Pokemon/Bot/PokemonGo-Bot/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-21 14:10:34,453 [sentry.errors.uncaught] [ERROR] [u"UnboundLocalError: local variable 'alt' referenced before assignment", u'  File "pokecli.py", line 674, in <module>', u'  File "pokecli.py", line 118, in main', u'  File "pokemongo_bot/__init__.py", line 541, in tick', u'  File "pokemongo_bot/cell_workers/follow_path.py", line 143, in work']
Dom Ago 21 14:10:34 BRT 2016 Pokebot  Stopped.
Press any button or wait 20 seconds to continue.

Steps to Reproduce

sudo ./run.sh

Other Information

OS: Linux

Branch: Ubuntu

Git Commit: 601e21d

Python Version: 2.7

Any other relevant files/configs (eg: path files)

Short Description

Possible solution

How it would help others

@sfbakin
Copy link

sfbakin commented Aug 22, 2016

I also had this trigger today, same error but OS Windows Py 2.7

@Gobberwart
Copy link
Contributor

Gobberwart commented Aug 22, 2016

DELETED. No longer relevant.

@alexyaoyang
Copy link
Contributor

Fixed on latest dev 👍

@LoadCroc
Copy link

@Gobberwart
tried that with this main released hour or so ago didn't work

Traceback (most recent call last):
File "C:\Program Files (x86)\pokemon\FileChecker\pokecli.py", line 46, in
from pokemongo_bot import inventory
File "C:\Program Files (x86)\pokemon\FileChecker\pokemongo_bot__init__.py", line 19, in
import cell_workers
File "C:\Program Files (x86)\pokemon\FileChecker\pokemongo_bot\cell_workers__init__.py", line 16, in
from follow_path import FollowPath
File "C:\Program Files (x86)\pokemon\FileChecker\pokemongo_bot\cell_workers\follow_path.py", line 115
alt = 0
^
IndentationError: unexpected indent

@alexyaoyang
Copy link
Contributor

alexyaoyang commented Aug 22, 2016

@LoadCroc The latest dev code do not have that line alt = 0. Pull again or clone the entire project again.

@Gobberwart
Copy link
Contributor

Correct. Disregard my previous comment, as it was just a bandaid for something which has since been fixed.

Pull the latest dev code and it should work.

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

6 participants