-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
First basic features of the pokemon optimizer #2956
Changes from all commits
204ad0e
c9b25d6
081d90d
4f3a744
235f6bf
ec83d2b
1fd60e7
1cc011c
a894a32
7490bf8
2a7a6cd
e2e71f1
4b0faaa
a205de8
8de542a
bb931f4
ef2bb53
e8fd901
ff1f5e4
0514a94
d34f74c
afcbf59
4d9375f
86fe6bb
7d6a24b
0552e95
49f83e6
15fb493
45905e5
f30cbf2
ae6c278
0530d80
3714221
b880f58
4b02024
cbb54d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"auth_service": "google", | ||
"username": "YOUR_USERNAME", | ||
"password": "YOUR_PASSWORD", | ||
"location": "SOME_LOCATION", | ||
"gmapkey": "GOOGLE_MAPS_API_KEY", | ||
"tasks": [ | ||
{ | ||
"type": "HandleSoftBan" | ||
}, | ||
{ | ||
"type": "CollectLevelUpReward" | ||
}, | ||
{ | ||
"type": "IncubateEggs", | ||
"config": { | ||
"longer_eggs_first": true | ||
} | ||
}, | ||
{ | ||
"type": "PokemonOptimizer", | ||
"config": { | ||
"transfer": true, | ||
"evolve": true, | ||
"use_lucky_egg": true, | ||
"evolve_only_with_lucky_egg": true, | ||
"minimum_evolve_for_lucky_egg": 90, | ||
"keep": [ | ||
{ | ||
"top": 1, | ||
"evolve": true, | ||
"// Available sorting keys are:": true, | ||
"// iv, cp, ncp, ivcp, max_cp, iv_attack, iv_defense, iv_stamina, hp_max, level": true, | ||
"sort": ["iv"] | ||
}, | ||
{ | ||
"top": 1, | ||
"evolve": true, | ||
"sort": ["ncp"] | ||
}, | ||
{ | ||
"top": 1, | ||
"evolve": false, | ||
"sort": ["cp"] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "RecycleItems", | ||
"config": { | ||
"min_empty_space": 15, | ||
"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", | ||
"config": { | ||
"ignore_item_count": true | ||
} | ||
}, | ||
{ | ||
"type": "MoveToFort", | ||
"config": { | ||
"lure_attraction": false, | ||
"lure_max_distance": 2000, | ||
"ignore_item_count": true | ||
} | ||
} | ||
], | ||
"map_object_cache_time": 5, | ||
"forts": { | ||
"avoid_circles": true, | ||
"max_circle_size": 50 | ||
}, | ||
"websocket_server": true, | ||
"walk": 4.16, | ||
"action_wait_min": 1, | ||
"action_wait_max": 4, | ||
"debug": false, | ||
"test": false, | ||
"health_record": false, | ||
"location_cache": true, | ||
"distance_unit": "km", | ||
"reconnecting_timeout": 15, | ||
"logging_color": true, | ||
"catch": { | ||
"any": { | ||
"always_catch": true | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,8 +387,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): | |
) | ||
|
||
# We could refresh here too, but adding 3 saves a inventory request | ||
candy = inventory.candies().get(pokemon.num) | ||
candy.add(3) | ||
candy = inventory.candies(True).get(pokemon.num) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refreshing is a bad behaviour. It would be great if we could make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The refresh is not for the candy, but for the Pokemon. If this refresh is not done, there is nobody in the loop accounting for the -1 space in the Pokemon bag. It leads to inventory full. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we need to modify the pokemon list itself then, not just a counter. The list is cached, so we remove an element from it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be adding a Pokemon. Do we have all the info required to fake insert the new Pokemon ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, but I think we do. |
||
self.emit_event( | ||
'gained_candy', | ||
formatted='You now have {quantity} {type} candy!', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anakin5 you added a required parameter (no optional parameter logic available yet) to
pokemon_evolved
event here, but the EvolvePokemon task doesn't send it, so an error will happen. You need to make EvolvePokemon send it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed