Bot doesn't release like expected
Expected Behavior
Bot should release any pokemon with cp below 400 and iv below 0.9 and then should only keep one with the best iv.
Actual Behavior
Bot only keeps pokemon with best iv and doesn't care about the other configuration.
Steps to Reproduce
Use this in the release config part:
"release": {
"any": {"release_below_cp": 400, "release_below_iv": 0.9, "logic": "or"},
"any": { "keep_best_iv": 1 }
}
Other Information
Linux 4.4.11+ armv6l Git Commit: bdaddec9ee64691e5b0a8bda55bf76f83442232f
You cant put any twice. It will override the previous any
It's basically an collection organized as:
"key": "value"
Where key always has to be unique, or else it will be overidden by the latest value for that key
Is it implemented like that today. Your configuration may be confusing: Does it mean you want to keep only the best iv, but only if it has come greater than 400 or iv greater than 0.9. And if not keep nothing ? Or does it mean that you want to keep all Pokémon with cp greater than 400 or iv greater than 0.9, and if none exists with such criteria, you still want to keep the best cp ?
To avoid this kind of headaches, it looks like parameters are exclusive. If you choose to keep the best cp/iv, other parameters won't be used.
"release": {
"any": {"release_below_cp": 400, "release_below_iv": 0.9, "keep_best_iv": 1, "logic": "or"},
"// anything else": { }
}
I tried that, but that is also not working…
Does it mean you want to keep only the best iv, but only if it has come greater than 400 or iv greater than 0.9. And if not keep nothing ?
Yeah that's exactly, what I want.
"catch": {
"any": {"catch_above_cp": 400, "catch_above_iv": 0.9, "logic": "or"},
"// anything else": { }
},
"release": {
"any": {"keep_best_iv": 1},
"// anything else": { }
}
That should do the trick
Yeah but then I wouldn't get the XP for catching...
@letomcat I'm afraid thats currently the only way of implementing the logic you want
I recommend replacing any with the pokemon that you want, and just copy paste it for-each pokemon.
@berong91 that's not how JSON works
@berong91 Lol that doesn't look good. You're exchanging your higher cp dratinis right there!
Hah I'm not sure how they parse "logic" : "and/or" and , into a real statement, so I just assume there's some kind of parser to convert each release json object into one statement. Like the above statement will turn into
(a and b or c) or ...
@berong91 well, like I explained in a comment above, a key must be unique, so defining logic twice, does absolutely nothing except overriding the previous value. order is not a factor here.
The bot just has no logic implemented to handle this all within the release rule alone, you'd have to combine it with the catch rule as I wrote in my example
@xorinzor Interesting. I read something about applying tree structure for the JSON config file a few minutes ago, now it's clearly to me that it's out of the current scope.
But still, then I'm curious about the order of logic checking? It must be hard coding somewhere in the code right, like what is the order of checking conditions, if we have all of them release_below_cp, release_below_iv and keep_best_iv at the same time.
@berong91 It's not a matter of which to check first, but rather, what to do if keep_best_iv is true or false.
Currently, as far as I'm aware, when keep_best_iv is true it will always keep the highest IV, and release others, (the same for keep_best_cp).
When false it will fallback to the release_below_cp and release_below_iv values
Doing all this within only the release rule, allows any type of pokemon to be caught though.
This could result in a bunch of pokemon from (for example) CP 100, 110 or 150. But if you had a pokemon from 500 but it's IV was lower, it would be released in favor of the lower-cp/higher-iv pokemon.
By limiting the catch rule to higher CP you would end up with a bunch of (for example) 500, 550, 600 pokemon, of which it would select the highest IV pokemon.
That's why you have to combine the catch and release rules to implement the logic OP wants
#1530 I guess this suggestion will solve this problem