This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathCustomCatchConfig.py
62 lines (50 loc) · 2.02 KB
/
CustomCatchConfig.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import logging
log = logging.getLogger(__name__)
# Check your recent encounters .csv files in the stats/encounters/
# folder to see all available Pokémon fields to filter on
# return True to command the bot to catch the Pokémon
# TODO add option for a Discord webhook when a custom is caught
def CustomCatchConfig(pokemon: object):
"""
Catch the current encounter if it matches any of the following criteria
:param pokemon: Pokémon object of the current encounter
"""
try:
### Edit below this line ###
# Catch perfect IV Pokémon
if pokemon["IVSum"] == 186:
return True
# Catch zero IV Pokémon
if pokemon["IVSum"] == 0:
return True
ivs = [pokemon["hpIV"],
pokemon["attackIV"],
pokemon["defenseIV"],
pokemon["speedIV"],
pokemon["spAttackIV"],
pokemon["spDefenseIV"]]
# Catch Pokémon with 6 identical IVs of any value
if all(v == ivs[0] for v in ivs):
return True
# Catch Pokémon with 4 or more max IVs in any stat
#max_ivs = sum(1 for v in ivs if v == 31)
#if max_ivs > 4:
# return True
# Catch Pokémon with a good IV sum of greater than or equal to 170
#if pokemon["IVSum"] >= 170:
# return True
# Catch uncaught Pokémon, not yet registered in the dex
#if pokemon["hasSpecies"] == 0:
# return True
# Catch all Poochyena with a Pecha Berry
#if pokemon["name"] == "Poochyena" and pokemon["itemName"] == "Pecha Berry":
# return True
# Catch any Pokémon with perfect Atk, SpAtk and Speed
#if pokemon["attackIV"] == 31 and pokemon["spAttackIV"] == 31 and pokemon["speedIV"] == 31:
# return True
### Edit above this line ###
return False
except Exception as e:
log.exception(str(e))
log.error("Failed to check Pokemon, due to invalid custom catch settings...")
return False