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

Release_config not work at all

Open crusardri opened this issue 10 years ago • 18 comments

Expected Behavior

Transfer pokemons with CP lower than X and IV lower than Y

Actual Behavior

Console: [2016-07-24 14:09:43] [x] Captured Primeape! [CP 950] [IV 0.58] [2016-07-24 14:09:43] [x] Captured Primeape! [CP 950] release_config.json "Primeape": { "release_under_cp": 900, "release_under_iv": 1, "cp_iv_logic": "and" }, In-game image

Steps to Reproduce

Start the bot lol

Other Information

OS: Windows 10 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here) Last dev downloaded a few minutes ago. (Seriously, i don't know how i can use git command)

crusardri avatar Jul 24 '16 12:07 crusardri

You chose the option AND which means:

[CP 950] [IV 0.58] if(CP<900 AND IV<1): release since CP>900 the result will be false

If you use the OR option this will change

Witzbold avatar Jul 24 '16 12:07 Witzbold

but still, kinda confuse.

He want to hunt CP 900+ Primeape with IV potential = 1 How to config then?

We should improve this logic

earthchie avatar Jul 24 '16 12:07 earthchie

in my config say Don't transfer a primeape with 900 or more AND IV 1 or more, and the bot don't transfer a primeape 950 (OK) with IV 0.58 (not OK)

crusardri avatar Jul 24 '16 12:07 crusardri

i see that you are right, do 0.99 until its fixed :)

fredrik-hellmangroup avatar Jul 24 '16 12:07 fredrik-hellmangroup

still not working with AND and IV 0.99, but work fine with OR

crusardri avatar Jul 24 '16 12:07 crusardri

[2016-07-24 14:09:43] [x] Captured Primeape! [CP 950] [IV 0.58]
[2016-07-24 14:09:43] [x] Captured Primeape! [CP 950]
release_config.json
"Primeape": { "release_under_cp": 900, "release_under_iv": 1, "cp_iv_logic": "and" },

This means: if cp < 900 AND iv < 1 THEN release. And that is what happened. CP wasn't under 900, so it didn't release.

douglascamata avatar Jul 24 '16 14:07 douglascamata

In that case, the release config is broken, the primeape is 950, OK but the IV is lower than 1

crusardri avatar Jul 24 '16 14:07 crusardri

for me it seems that release_config.json is never used with the new -cf config_file.json logic

mehdi-S avatar Jul 24 '16 14:07 mehdi-S

@crusardri dude... it's a logic AND. It's working as expected. if cp < 900 AND iv < 1. CP is less than 900? False. IV is less than 1? True. False AND True = False, so it won't release. Nothing is broken, it's boolean math.

douglascamata avatar Jul 24 '16 14:07 douglascamata

Math logic: OR 0 0 = 0 0 1 = 1 1 0 = 1 1 1 = 1

AND 0 0 = 0 0 1 =0 1 0 = 0 1 1 = 1

Pokemon used: Primeape PC 950 (>900) IV 0.58 (<1) [2016-07-24 14:09:43] [x] Captured Primeape! [CP 950] [IV 0.58] My config "Primeape": { "release_under_cp": 900, "release_under_iv": 1, "cp_iv_logic": "and" }, Expected Behavior if primeape is PC >900 AND IV >1, keep Actual Behavior if primeape is PC >900 OR IV >1, keep

crusardri avatar Jul 24 '16 14:07 crusardri

@crusardri:

  1. IV condition is False and CP condition is True, right? Agree on this?
  2. False AND True is False
  3. Returning False means it SHOULD NOT transfer.

douglascamata avatar Jul 24 '16 14:07 douglascamata

Just check the code, it's clear:

if 'release_under_cp' in release_config:
                min_cp = release_config['release_under_cp']
                if cp < min_cp:
                    release_results['cp'] = True

Transforming into text: if pokemon cp is lower than 'release_under_cp', it should be released based on that criteria. Same happens to IV.

Your pokemon CP = 950 and IV = 0.58, config is CP 900 and IV 1.

950 < 900 = FALSE 0.58 < 0.1 = TRUE

False AND True = False = not release.

douglascamata avatar Jul 24 '16 14:07 douglascamata

ahhh, ok, i understand now, but it don't have any sense. Why the config is for transfer instead of keep it?

crusardri avatar Jul 24 '16 14:07 crusardri

The file is named release_config.json and the name of the key is release_under_cp...

douglascamata avatar Jul 24 '16 14:07 douglascamata

IMHO, it's pretty clear what it means.

douglascamata avatar Jul 24 '16 14:07 douglascamata

@douglascamata and how did you manage to use release_config file with the config_file logic ?

mehdi-S avatar Jul 24 '16 14:07 mehdi-S

Ok, it's my fault, close the issue if you want. @mehdi-S release when the pokemon have PC lower than X and IV lower than Y, or release when the pokemon have PC lower than X or IV lower than Y

PC is 950 and IV is 0.58 the config says PC 900 and IV 1 950 > 900 = false 0,58 < 1 = true OR = X + Y AND = X * Y

OR: false + true = true, release it AND: flase * true = false, keep it

crusardri avatar Jul 24 '16 14:07 crusardri

@mehdi-S I don't know about config_file logic + release_config.json file. I implemented the release_config.json logic before the config_file one. I just woke up a few minutes ago and saw it there, so...

douglascamata avatar Jul 24 '16 15:07 douglascamata