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

Unbound Error? #2902

Closed
fglo11 opened this issue Aug 7, 2016 · 7 comments
Closed

Unbound Error? #2902

fglo11 opened this issue Aug 7, 2016 · 7 comments

Comments

@fglo11
Copy link

fglo11 commented Aug 7, 2016

Expected Behavior

Bot to run

Actual Behavior

2016-08-07 14:35:45,098 [ cli] [INFO] PokemonGO Bot v1.0
Traceback (most recent call last):
File "pokecli.py", line 493, in
main()
File "pokecli.py", line 126, in main
if bot:
UnboundLocalError: local variable 'bot' referenced before assignment

Steps to Reproduce

Other Information

OS: MAC OS X 10.11.6
Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here) 153ea21

Python: Python 2.7.12

@kyleboe
Copy link

kyleboe commented Aug 7, 2016

First off, wherever you are running git log -n 1 --pretty=format:"%H" from is not the correct directory. You need to be running it from within the cloned PokemonGo-Bot directory.

Run that command from the correct directory and edit your post so we can have the necessary info to debug the problem.

(it should look something like this:)
image

@fglo11
Copy link
Author

fglo11 commented Aug 7, 2016

@kyleboe Edited: Sorry about that. Thank you

@kyleboe
Copy link

kyleboe commented Aug 7, 2016

I would recommend switching to the latest commit in the dev branch.

git checkout dev or git pull origin dev should do the trick.

The commit you are on is close to 24 hours old and there have been a number of changes during that time.

@fglo11
Copy link
Author

fglo11 commented Aug 7, 2016

@kyleboe updated successfully to b5b3e70

still receiving.
2016-08-07 15:33:17,443 [ cli] [INFO] PokemonGO Bot v1.0 Traceback (most recent call last): File "pokecli.py", line 493, in <module> main() File "pokecli.py", line 126, in main if bot: UnboundLocalError: local variable 'bot' referenced before assignment

@mjmadsen
Copy link
Contributor

mjmadsen commented Aug 7, 2016

This won't solve whatever is causing your problem to happen, but fixed variable problem (#2912).

For one reason or another, the main try is failing for you. Can you post your config?

@fglo11
Copy link
Author

fglo11 commented Aug 7, 2016

@mjmadsen actually just got my config to pass through JSONLint.com. I will still post below. Currently getting this read out.
2016-08-07 16:53:20,479 [ cli] [INFO] PokemonGO Bot v1.0 2016-08-07 16:53:20,481 [ cli] [INFO] No config argument specified, checking for /configs/config.json 2016-08-07 16:53:20,482 [ cli] [INFO] Configuration initialized 2016-08-07 16:53:20,483 [pokemongo_bot.health_record.bot_event] [INFO] Health check is enabled. For more logrmation: 2016-08-07 16:53:20,483 [pokemongo_bot.health_record.bot_event] [INFO] https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev#analytics 2016-08-07 16:53:20,494 [requests.packages.urllib3.connectionpool] [INFO] Starting new HTTP connection (1): www.google-analytics.com 2016-08-07 16:53:22,511 [PokemonGoBot] [INFO] [set_start_location] Setting start location. 2016-08-07 16:53:22,512 [PokemonGoBot] [INFO] [x] Coordinates found in passed in location, not geocoding. 2016-08-07 16:53:22,512 [PokemonGoBot] [INFO] [location_found] Location found: 34.0087, -118.4982 (34.0087, -118.4982, 0.0) 2016-08-07 16:53:22,512 [PokemonGoBot] [INFO] [position_update] Now at (34.0087, -118.4982, 0) 2016-08-07 16:53:22,512 [PokemonGoBot] [INFO] [login_started] Login procedure started. Traceback (most recent call last): File "pokecli.py", line 493, in <module> main() File "pokecli.py", line 127, in main report_summary(bot) File "pokecli.py", line 136, in report_summary metrics.capture_stats() File "/Users/Fglosson/PokemonGo-Bot/pokemongo_bot/metrics.py", line 73, in capture_stats request = self.bot.api.create_request() File "/Users/Fglosson/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 28, in create_request self._position_alt File "/Users/Fglosson/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 44, in __init__ PGoApiRequest.__init__(self, *args) TypeError: __init__() takes exactly 5 arguments (6 given) 2016-08-07 16:53:28,328 [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/) Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/usr/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/usr/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/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1097, in _send_request self.endheaders(body) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in endheaders self._send_output(message_body) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 895, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) 2016-08-07 16:53:28,330 [sentry.errors.uncaught] [ERROR] [u'TypeError: __init__() takes exactly 5 arguments (6 given)', u' File "pokecli.py", line 493, in <module>', u' File "pokecli.py", line 127, in main', u' File "pokecli.py", line 136, in report_summary', u' File "pokemongo_bot/metrics.py", line 73, in capture_stats', u' File "pokemongo_bot/api_wrapper.py", line 28, in create_request', u' File "pokemongo_bot/api_wrapper.py", line 44, in __init__']

My config
`{
"auth_service": "google",
"username": "4xforrest",
"password": "xxx",
"location": "34.0087, -118.4982",
"gmapkey": "xxx",
"tasks": [{
"type": "HandleSoftBan"
}, {
"type": "CollectLevelUpReward"
}, {
"type": "IncubateEggs",
"config": {
"longer_eggs_first": true
}
}, {
"type": "TransferPokemon"
}, {
"type": "EvolvePokemon",
"config": {
"evolve_all": "none",
"first_evolve_by": "cp",
"evolve_above_cp": 500,
"evolve_above_iv": 0.8,
"logic": "or",
"evolve_speed": 20,
"use_lucky_egg": false
}
}, {
"type": "RecycleItems",
"config": {
"item_filter": {
"Pokeball": {
"keep": 100
},
"Potion": {
"keep": 10
},
"Super Potion": {
"keep": 20
},
"Hyper Potion": {
"keep": 30
},
"Revive": {
"keep": 30
},
"Razz Berry": {
"keep": 100
}
}
}
}, {
"type": "CatchVisiblePokemon"
}, {
"type": "CatchLuredPokemon"
}, {
"type": "SpinFort"
}, {
"type": "FollowCluster",
"config": {
"radius": 50,
"lured": true
}
}],
"forts": {
"avoid_circles": true,
"max_circle_size": 50
},
"websocket_server": false,
"walk": 4.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"evolve_captured": "NONE",
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"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": 0,
"release_below_iv": 0,
"logic": "or"
},
"// 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": {},

    "// S-Tier pokemons (if pokemon can be evolved into tier, list the representative)": {},
    "Mewtwo": {},
    "Dragonite": {},
    "Snorlax": {},
    "// Mew evolves to Mewtwo": {},
    "Mew": {},
    "Arcanine": {},
    "Vaporeon": {},
    "Gyarados": {},
    "Exeggutor": {},
    "Muk": {},
    "Weezing": {},
    "Flareon": {}

}

}`

and my git is now b5b3e70

@RedViper9
Copy link
Contributor

Are you still having problems?

@k4n30 k4n30 closed this as completed Aug 16, 2016
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

5 participants