diff --git a/.gitignore b/.gitignore index d9e1f1c..99bf4dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ **/__pycache__ .idea/ -clashroyalebuildabot/screenshots -clashroyalebuildabot/labels -clashroyalebuildabot/logs +clashroyalebuildabot/debug .venv .vscode *.egg-info diff --git a/clashroyalebuildabot/__init__.py b/clashroyalebuildabot/__init__.py index f95e914..773e526 100644 --- a/clashroyalebuildabot/__init__.py +++ b/clashroyalebuildabot/__init__.py @@ -1,10 +1,10 @@ # Exports for clashroyalebuildabot +from . import constants from .bot import Action from .bot import Bot from .bot import PeteBot from .bot import RandomBot from .bot import TwoSixHogCycle -from .data import constants from .namespaces import Cards from .namespaces import Units from .screen import Screen diff --git a/clashroyalebuildabot/bot/bot.py b/clashroyalebuildabot/bot/bot.py index 738c0c8..00e47e3 100644 --- a/clashroyalebuildabot/bot/bot.py +++ b/clashroyalebuildabot/bot/bot.py @@ -3,20 +3,20 @@ from loguru import logger from clashroyalebuildabot.bot.action import Action -from clashroyalebuildabot.data.constants import ALLY_TILES -from clashroyalebuildabot.data.constants import DISPLAY_CARD_DELTA_X -from clashroyalebuildabot.data.constants import DISPLAY_CARD_HEIGHT -from clashroyalebuildabot.data.constants import DISPLAY_CARD_INIT_X -from clashroyalebuildabot.data.constants import DISPLAY_CARD_WIDTH -from clashroyalebuildabot.data.constants import DISPLAY_CARD_Y -from clashroyalebuildabot.data.constants import DISPLAY_HEIGHT -from clashroyalebuildabot.data.constants import LEFT_PRINCESS_TILES -from clashroyalebuildabot.data.constants import RIGHT_PRINCESS_TILES -from clashroyalebuildabot.data.constants import SCREEN_CONFIG -from clashroyalebuildabot.data.constants import TILE_HEIGHT -from clashroyalebuildabot.data.constants import TILE_INIT_X -from clashroyalebuildabot.data.constants import TILE_INIT_Y -from clashroyalebuildabot.data.constants import TILE_WIDTH +from clashroyalebuildabot.constants import ALLY_TILES +from clashroyalebuildabot.constants import DISPLAY_CARD_DELTA_X +from clashroyalebuildabot.constants import DISPLAY_CARD_HEIGHT +from clashroyalebuildabot.constants import DISPLAY_CARD_INIT_X +from clashroyalebuildabot.constants import DISPLAY_CARD_WIDTH +from clashroyalebuildabot.constants import DISPLAY_CARD_Y +from clashroyalebuildabot.constants import DISPLAY_HEIGHT +from clashroyalebuildabot.constants import LEFT_PRINCESS_TILES +from clashroyalebuildabot.constants import RIGHT_PRINCESS_TILES +from clashroyalebuildabot.constants import SCREEN_CONFIG +from clashroyalebuildabot.constants import TILE_HEIGHT +from clashroyalebuildabot.constants import TILE_INIT_X +from clashroyalebuildabot.constants import TILE_INIT_Y +from clashroyalebuildabot.constants import TILE_WIDTH from clashroyalebuildabot.screen import Screen from clashroyalebuildabot.state.detector import Detector diff --git a/clashroyalebuildabot/bot/example/custom_bot.py b/clashroyalebuildabot/bot/example/custom_bot.py index b745cd8..b876958 100644 --- a/clashroyalebuildabot/bot/example/custom_bot.py +++ b/clashroyalebuildabot/bot/example/custom_bot.py @@ -6,10 +6,10 @@ from clashroyalebuildabot.bot import Bot from clashroyalebuildabot.bot.example.custom_action import CustomAction -from clashroyalebuildabot.data.constants import DISPLAY_HEIGHT -from clashroyalebuildabot.data.constants import DISPLAY_WIDTH -from clashroyalebuildabot.data.constants import SCREENSHOT_HEIGHT -from clashroyalebuildabot.data.constants import SCREENSHOT_WIDTH +from clashroyalebuildabot.constants import DISPLAY_HEIGHT +from clashroyalebuildabot.constants import DISPLAY_WIDTH +from clashroyalebuildabot.constants import SCREENSHOT_HEIGHT +from clashroyalebuildabot.constants import SCREENSHOT_WIDTH from clashroyalebuildabot.namespaces.cards import Cards diff --git a/clashroyalebuildabot/bot/pete/pete_bot.py b/clashroyalebuildabot/bot/pete/pete_bot.py index b502a21..4deb088 100644 --- a/clashroyalebuildabot/bot/pete/pete_bot.py +++ b/clashroyalebuildabot/bot/pete/pete_bot.py @@ -3,10 +3,10 @@ from clashroyalebuildabot.bot.bot import Bot from clashroyalebuildabot.bot.pete.pete_action import PeteAction -from clashroyalebuildabot.data.constants import DISPLAY_HEIGHT -from clashroyalebuildabot.data.constants import DISPLAY_WIDTH -from clashroyalebuildabot.data.constants import SCREENSHOT_HEIGHT -from clashroyalebuildabot.data.constants import SCREENSHOT_WIDTH +from clashroyalebuildabot.constants import DISPLAY_HEIGHT +from clashroyalebuildabot.constants import DISPLAY_WIDTH +from clashroyalebuildabot.constants import SCREENSHOT_HEIGHT +from clashroyalebuildabot.constants import SCREENSHOT_WIDTH class PeteBot(Bot): diff --git a/clashroyalebuildabot/bot/two_six_hog_cycle/two_six_hog_cycle_bot.py b/clashroyalebuildabot/bot/two_six_hog_cycle/two_six_hog_cycle_bot.py index f8a89ec..162827c 100644 --- a/clashroyalebuildabot/bot/two_six_hog_cycle/two_six_hog_cycle_bot.py +++ b/clashroyalebuildabot/bot/two_six_hog_cycle/two_six_hog_cycle_bot.py @@ -5,10 +5,10 @@ from clashroyalebuildabot.bot.two_six_hog_cycle.two_six_hog_cycle_action import ( TwoSixHogCycleAction, ) -from clashroyalebuildabot.data.constants import DISPLAY_HEIGHT -from clashroyalebuildabot.data.constants import DISPLAY_WIDTH -from clashroyalebuildabot.data.constants import SCREENSHOT_HEIGHT -from clashroyalebuildabot.data.constants import SCREENSHOT_WIDTH +from clashroyalebuildabot.constants import DISPLAY_HEIGHT +from clashroyalebuildabot.constants import DISPLAY_WIDTH +from clashroyalebuildabot.constants import SCREENSHOT_HEIGHT +from clashroyalebuildabot.constants import SCREENSHOT_WIDTH from clashroyalebuildabot.namespaces.cards import Cards diff --git a/clashroyalebuildabot/config/config.yml b/clashroyalebuildabot/config.yaml similarity index 100% rename from clashroyalebuildabot/config/config.yml rename to clashroyalebuildabot/config.yaml diff --git a/clashroyalebuildabot/data/constants.py b/clashroyalebuildabot/constants.py similarity index 92% rename from clashroyalebuildabot/data/constants.py rename to clashroyalebuildabot/constants.py index 9ef4a23..0cca8df 100644 --- a/clashroyalebuildabot/data/constants.py +++ b/clashroyalebuildabot/constants.py @@ -5,10 +5,12 @@ from clashroyalebuildabot.namespaces import Units # Directories -SRC_DIR = os.path.dirname(os.path.dirname(__file__)) -DATA_DIR = os.path.join(SRC_DIR, "data") -SCREENSHOTS_DIR = os.path.join(SRC_DIR, "screenshots") -LABELS_DIR = os.path.join(SRC_DIR, "labels") +SRC_DIR = os.path.dirname(__file__) +DEBUG_DIR = os.path.join(SRC_DIR, "debug") +MODELS_DIR = os.path.join(SRC_DIR, "models") +IMAGES_DIR = os.path.join(SRC_DIR, "images") +SCREENSHOTS_DIR = os.path.join(DEBUG_DIR, "screenshots") +LABELS_DIR = os.path.join(DEBUG_DIR, "labels") # Display dimensions DISPLAY_WIDTH = 720 @@ -73,8 +75,6 @@ DISPLAY_CARD_DELTA_X = 136 # Cards -HAND_SIZE = 5 -DECK_SIZE = 8 CARD_Y = 543 CARD_INIT_X = 84 CARD_WIDTH = 61 @@ -196,8 +196,6 @@ ] # Units -UNIT_Y_START = 0.05 -UNIT_Y_END = 0.80 DETECTOR_UNITS = [ Units.ARCHER, Units.BARBARIAN, @@ -233,10 +231,3 @@ Units.WALL_BREAKER, Units.X_BOW, ] - -# Multihash coefficients -MULTI_HASH_SCALE = 0.355 -MULTI_HASH_INTERCEPT = 163 - -# Side -SIDE_SIZE = 16 diff --git a/clashroyalebuildabot/data/__init__.py b/clashroyalebuildabot/data/__init__.py deleted file mode 100644 index 6319425..0000000 --- a/clashroyalebuildabot/data/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Exports for data submodule -from . import constants - -__all__ = ["constants"] diff --git a/clashroyalebuildabot/data/images/cards/archer_queen.jpg b/clashroyalebuildabot/images/cards/archer_queen.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/archer_queen.jpg rename to clashroyalebuildabot/images/cards/archer_queen.jpg diff --git a/clashroyalebuildabot/data/images/cards/archers.jpg b/clashroyalebuildabot/images/cards/archers.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/archers.jpg rename to clashroyalebuildabot/images/cards/archers.jpg diff --git a/clashroyalebuildabot/data/images/cards/archers_ev1.jpg b/clashroyalebuildabot/images/cards/archers_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/archers_ev1.jpg rename to clashroyalebuildabot/images/cards/archers_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/arrows.jpg b/clashroyalebuildabot/images/cards/arrows.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/arrows.jpg rename to clashroyalebuildabot/images/cards/arrows.jpg diff --git a/clashroyalebuildabot/data/images/cards/balloon.jpg b/clashroyalebuildabot/images/cards/balloon.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/balloon.jpg rename to clashroyalebuildabot/images/cards/balloon.jpg diff --git a/clashroyalebuildabot/data/images/cards/bandit.jpg b/clashroyalebuildabot/images/cards/bandit.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bandit.jpg rename to clashroyalebuildabot/images/cards/bandit.jpg diff --git a/clashroyalebuildabot/data/images/cards/barbarian_barrel.jpg b/clashroyalebuildabot/images/cards/barbarian_barrel.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/barbarian_barrel.jpg rename to clashroyalebuildabot/images/cards/barbarian_barrel.jpg diff --git a/clashroyalebuildabot/data/images/cards/barbarian_hut.jpg b/clashroyalebuildabot/images/cards/barbarian_hut.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/barbarian_hut.jpg rename to clashroyalebuildabot/images/cards/barbarian_hut.jpg diff --git a/clashroyalebuildabot/data/images/cards/barbarian_launcher.jpg b/clashroyalebuildabot/images/cards/barbarian_launcher.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/barbarian_launcher.jpg rename to clashroyalebuildabot/images/cards/barbarian_launcher.jpg diff --git a/clashroyalebuildabot/data/images/cards/barbarians.jpg b/clashroyalebuildabot/images/cards/barbarians.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/barbarians.jpg rename to clashroyalebuildabot/images/cards/barbarians.jpg diff --git a/clashroyalebuildabot/data/images/cards/barbarians_ev1.jpg b/clashroyalebuildabot/images/cards/barbarians_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/barbarians_ev1.jpg rename to clashroyalebuildabot/images/cards/barbarians_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/bats.jpg b/clashroyalebuildabot/images/cards/bats.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bats.jpg rename to clashroyalebuildabot/images/cards/bats.jpg diff --git a/clashroyalebuildabot/data/images/cards/bats_ev1.jpg b/clashroyalebuildabot/images/cards/bats_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bats_ev1.jpg rename to clashroyalebuildabot/images/cards/bats_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/battle_healer.jpg b/clashroyalebuildabot/images/cards/battle_healer.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/battle_healer.jpg rename to clashroyalebuildabot/images/cards/battle_healer.jpg diff --git a/clashroyalebuildabot/data/images/cards/battle_ram.jpg b/clashroyalebuildabot/images/cards/battle_ram.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/battle_ram.jpg rename to clashroyalebuildabot/images/cards/battle_ram.jpg diff --git a/clashroyalebuildabot/data/images/cards/blank.jpg b/clashroyalebuildabot/images/cards/blank.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/blank.jpg rename to clashroyalebuildabot/images/cards/blank.jpg diff --git a/clashroyalebuildabot/data/images/cards/bomb_tower.jpg b/clashroyalebuildabot/images/cards/bomb_tower.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bomb_tower.jpg rename to clashroyalebuildabot/images/cards/bomb_tower.jpg diff --git a/clashroyalebuildabot/data/images/cards/bomber.jpg b/clashroyalebuildabot/images/cards/bomber.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bomber.jpg rename to clashroyalebuildabot/images/cards/bomber.jpg diff --git a/clashroyalebuildabot/data/images/cards/bowler.jpg b/clashroyalebuildabot/images/cards/bowler.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/bowler.jpg rename to clashroyalebuildabot/images/cards/bowler.jpg diff --git a/clashroyalebuildabot/data/images/cards/cannon.jpg b/clashroyalebuildabot/images/cards/cannon.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/cannon.jpg rename to clashroyalebuildabot/images/cards/cannon.jpg diff --git a/clashroyalebuildabot/data/images/cards/cannon_cart.jpg b/clashroyalebuildabot/images/cards/cannon_cart.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/cannon_cart.jpg rename to clashroyalebuildabot/images/cards/cannon_cart.jpg diff --git a/clashroyalebuildabot/data/images/cards/card_champion_unknown.jpg b/clashroyalebuildabot/images/cards/card_champion_unknown.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/card_champion_unknown.jpg rename to clashroyalebuildabot/images/cards/card_champion_unknown.jpg diff --git a/clashroyalebuildabot/data/images/cards/card_legendary_unknown.jpg b/clashroyalebuildabot/images/cards/card_legendary_unknown.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/card_legendary_unknown.jpg rename to clashroyalebuildabot/images/cards/card_legendary_unknown.jpg diff --git a/clashroyalebuildabot/data/images/cards/clone.jpg b/clashroyalebuildabot/images/cards/clone.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/clone.jpg rename to clashroyalebuildabot/images/cards/clone.jpg diff --git a/clashroyalebuildabot/data/images/cards/dark_prince.jpg b/clashroyalebuildabot/images/cards/dark_prince.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/dark_prince.jpg rename to clashroyalebuildabot/images/cards/dark_prince.jpg diff --git a/clashroyalebuildabot/data/images/cards/dart_goblin.jpg b/clashroyalebuildabot/images/cards/dart_goblin.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/dart_goblin.jpg rename to clashroyalebuildabot/images/cards/dart_goblin.jpg diff --git a/clashroyalebuildabot/data/images/cards/earthquake.jpg b/clashroyalebuildabot/images/cards/earthquake.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/earthquake.jpg rename to clashroyalebuildabot/images/cards/earthquake.jpg diff --git a/clashroyalebuildabot/data/images/cards/electro_dragon.jpg b/clashroyalebuildabot/images/cards/electro_dragon.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/electro_dragon.jpg rename to clashroyalebuildabot/images/cards/electro_dragon.jpg diff --git a/clashroyalebuildabot/data/images/cards/electro_giant.jpg b/clashroyalebuildabot/images/cards/electro_giant.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/electro_giant.jpg rename to clashroyalebuildabot/images/cards/electro_giant.jpg diff --git a/clashroyalebuildabot/data/images/cards/electro_spirit.jpg b/clashroyalebuildabot/images/cards/electro_spirit.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/electro_spirit.jpg rename to clashroyalebuildabot/images/cards/electro_spirit.jpg diff --git a/clashroyalebuildabot/data/images/cards/electro_wizard.jpg b/clashroyalebuildabot/images/cards/electro_wizard.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/electro_wizard.jpg rename to clashroyalebuildabot/images/cards/electro_wizard.jpg diff --git a/clashroyalebuildabot/data/images/cards/elite_barbarians.jpg b/clashroyalebuildabot/images/cards/elite_barbarians.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/elite_barbarians.jpg rename to clashroyalebuildabot/images/cards/elite_barbarians.jpg diff --git a/clashroyalebuildabot/data/images/cards/elixir_collector.jpg b/clashroyalebuildabot/images/cards/elixir_collector.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/elixir_collector.jpg rename to clashroyalebuildabot/images/cards/elixir_collector.jpg diff --git a/clashroyalebuildabot/data/images/cards/elixir_golem.jpg b/clashroyalebuildabot/images/cards/elixir_golem.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/elixir_golem.jpg rename to clashroyalebuildabot/images/cards/elixir_golem.jpg diff --git a/clashroyalebuildabot/data/images/cards/executioner.jpg b/clashroyalebuildabot/images/cards/executioner.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/executioner.jpg rename to clashroyalebuildabot/images/cards/executioner.jpg diff --git a/clashroyalebuildabot/data/images/cards/fire_spirit.jpg b/clashroyalebuildabot/images/cards/fire_spirit.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/fire_spirit.jpg rename to clashroyalebuildabot/images/cards/fire_spirit.jpg diff --git a/clashroyalebuildabot/data/images/cards/fire_spirits.jpg b/clashroyalebuildabot/images/cards/fire_spirits.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/fire_spirits.jpg rename to clashroyalebuildabot/images/cards/fire_spirits.jpg diff --git a/clashroyalebuildabot/data/images/cards/fireball.jpg b/clashroyalebuildabot/images/cards/fireball.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/fireball.jpg rename to clashroyalebuildabot/images/cards/fireball.jpg diff --git a/clashroyalebuildabot/data/images/cards/firecracker.jpg b/clashroyalebuildabot/images/cards/firecracker.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/firecracker.jpg rename to clashroyalebuildabot/images/cards/firecracker.jpg diff --git a/clashroyalebuildabot/data/images/cards/firecracker_ev1.jpg b/clashroyalebuildabot/images/cards/firecracker_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/firecracker_ev1.jpg rename to clashroyalebuildabot/images/cards/firecracker_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/fisherman.jpg b/clashroyalebuildabot/images/cards/fisherman.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/fisherman.jpg rename to clashroyalebuildabot/images/cards/fisherman.jpg diff --git a/clashroyalebuildabot/data/images/cards/flying_machine.jpg b/clashroyalebuildabot/images/cards/flying_machine.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/flying_machine.jpg rename to clashroyalebuildabot/images/cards/flying_machine.jpg diff --git a/clashroyalebuildabot/data/images/cards/freeze.jpg b/clashroyalebuildabot/images/cards/freeze.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/freeze.jpg rename to clashroyalebuildabot/images/cards/freeze.jpg diff --git a/clashroyalebuildabot/data/images/cards/furnace.jpg b/clashroyalebuildabot/images/cards/furnace.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/furnace.jpg rename to clashroyalebuildabot/images/cards/furnace.jpg diff --git a/clashroyalebuildabot/data/images/cards/giant.jpg b/clashroyalebuildabot/images/cards/giant.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/giant.jpg rename to clashroyalebuildabot/images/cards/giant.jpg diff --git a/clashroyalebuildabot/data/images/cards/giant_skeleton.jpg b/clashroyalebuildabot/images/cards/giant_skeleton.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/giant_skeleton.jpg rename to clashroyalebuildabot/images/cards/giant_skeleton.jpg diff --git a/clashroyalebuildabot/data/images/cards/giant_snowball.jpg b/clashroyalebuildabot/images/cards/giant_snowball.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/giant_snowball.jpg rename to clashroyalebuildabot/images/cards/giant_snowball.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_barrel.jpg b/clashroyalebuildabot/images/cards/goblin_barrel.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_barrel.jpg rename to clashroyalebuildabot/images/cards/goblin_barrel.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_cage.jpg b/clashroyalebuildabot/images/cards/goblin_cage.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_cage.jpg rename to clashroyalebuildabot/images/cards/goblin_cage.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_drill.jpg b/clashroyalebuildabot/images/cards/goblin_drill.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_drill.jpg rename to clashroyalebuildabot/images/cards/goblin_drill.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_gang.jpg b/clashroyalebuildabot/images/cards/goblin_gang.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_gang.jpg rename to clashroyalebuildabot/images/cards/goblin_gang.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_giant.jpg b/clashroyalebuildabot/images/cards/goblin_giant.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_giant.jpg rename to clashroyalebuildabot/images/cards/goblin_giant.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblin_hut.jpg b/clashroyalebuildabot/images/cards/goblin_hut.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblin_hut.jpg rename to clashroyalebuildabot/images/cards/goblin_hut.jpg diff --git a/clashroyalebuildabot/data/images/cards/goblins.jpg b/clashroyalebuildabot/images/cards/goblins.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/goblins.jpg rename to clashroyalebuildabot/images/cards/goblins.jpg diff --git a/clashroyalebuildabot/data/images/cards/golden_knight.jpg b/clashroyalebuildabot/images/cards/golden_knight.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/golden_knight.jpg rename to clashroyalebuildabot/images/cards/golden_knight.jpg diff --git a/clashroyalebuildabot/data/images/cards/golem.jpg b/clashroyalebuildabot/images/cards/golem.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/golem.jpg rename to clashroyalebuildabot/images/cards/golem.jpg diff --git a/clashroyalebuildabot/data/images/cards/graveyard.jpg b/clashroyalebuildabot/images/cards/graveyard.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/graveyard.jpg rename to clashroyalebuildabot/images/cards/graveyard.jpg diff --git a/clashroyalebuildabot/data/images/cards/guards.jpg b/clashroyalebuildabot/images/cards/guards.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/guards.jpg rename to clashroyalebuildabot/images/cards/guards.jpg diff --git a/clashroyalebuildabot/data/images/cards/heal.jpg b/clashroyalebuildabot/images/cards/heal.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/heal.jpg rename to clashroyalebuildabot/images/cards/heal.jpg diff --git a/clashroyalebuildabot/data/images/cards/heal_spirit.jpg b/clashroyalebuildabot/images/cards/heal_spirit.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/heal_spirit.jpg rename to clashroyalebuildabot/images/cards/heal_spirit.jpg diff --git a/clashroyalebuildabot/data/images/cards/hog_rider.jpg b/clashroyalebuildabot/images/cards/hog_rider.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/hog_rider.jpg rename to clashroyalebuildabot/images/cards/hog_rider.jpg diff --git a/clashroyalebuildabot/data/images/cards/hungry_dragon.jpg b/clashroyalebuildabot/images/cards/hungry_dragon.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/hungry_dragon.jpg rename to clashroyalebuildabot/images/cards/hungry_dragon.jpg diff --git a/clashroyalebuildabot/data/images/cards/hunter.jpg b/clashroyalebuildabot/images/cards/hunter.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/hunter.jpg rename to clashroyalebuildabot/images/cards/hunter.jpg diff --git a/clashroyalebuildabot/data/images/cards/ice_golem.jpg b/clashroyalebuildabot/images/cards/ice_golem.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/ice_golem.jpg rename to clashroyalebuildabot/images/cards/ice_golem.jpg diff --git a/clashroyalebuildabot/data/images/cards/ice_spirit.jpg b/clashroyalebuildabot/images/cards/ice_spirit.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/ice_spirit.jpg rename to clashroyalebuildabot/images/cards/ice_spirit.jpg diff --git a/clashroyalebuildabot/data/images/cards/ice_spirit_ev1.jpg b/clashroyalebuildabot/images/cards/ice_spirit_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/ice_spirit_ev1.jpg rename to clashroyalebuildabot/images/cards/ice_spirit_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/ice_wizard.jpg b/clashroyalebuildabot/images/cards/ice_wizard.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/ice_wizard.jpg rename to clashroyalebuildabot/images/cards/ice_wizard.jpg diff --git a/clashroyalebuildabot/data/images/cards/inferno_dragon.jpg b/clashroyalebuildabot/images/cards/inferno_dragon.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/inferno_dragon.jpg rename to clashroyalebuildabot/images/cards/inferno_dragon.jpg diff --git a/clashroyalebuildabot/data/images/cards/inferno_tower.jpg b/clashroyalebuildabot/images/cards/inferno_tower.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/inferno_tower.jpg rename to clashroyalebuildabot/images/cards/inferno_tower.jpg diff --git a/clashroyalebuildabot/data/images/cards/knight.jpg b/clashroyalebuildabot/images/cards/knight.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/knight.jpg rename to clashroyalebuildabot/images/cards/knight.jpg diff --git a/clashroyalebuildabot/data/images/cards/knight_ev1.jpg b/clashroyalebuildabot/images/cards/knight_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/knight_ev1.jpg rename to clashroyalebuildabot/images/cards/knight_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/lava_hound.jpg b/clashroyalebuildabot/images/cards/lava_hound.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/lava_hound.jpg rename to clashroyalebuildabot/images/cards/lava_hound.jpg diff --git a/clashroyalebuildabot/data/images/cards/lightning.jpg b/clashroyalebuildabot/images/cards/lightning.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/lightning.jpg rename to clashroyalebuildabot/images/cards/lightning.jpg diff --git a/clashroyalebuildabot/data/images/cards/little_prince.jpg b/clashroyalebuildabot/images/cards/little_prince.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/little_prince.jpg rename to clashroyalebuildabot/images/cards/little_prince.jpg diff --git a/clashroyalebuildabot/data/images/cards/lumberjack.jpg b/clashroyalebuildabot/images/cards/lumberjack.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/lumberjack.jpg rename to clashroyalebuildabot/images/cards/lumberjack.jpg diff --git a/clashroyalebuildabot/data/images/cards/magic_archer.jpg b/clashroyalebuildabot/images/cards/magic_archer.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/magic_archer.jpg rename to clashroyalebuildabot/images/cards/magic_archer.jpg diff --git a/clashroyalebuildabot/data/images/cards/mega_knight.jpg b/clashroyalebuildabot/images/cards/mega_knight.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mega_knight.jpg rename to clashroyalebuildabot/images/cards/mega_knight.jpg diff --git a/clashroyalebuildabot/data/images/cards/mega_minion.jpg b/clashroyalebuildabot/images/cards/mega_minion.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mega_minion.jpg rename to clashroyalebuildabot/images/cards/mega_minion.jpg diff --git a/clashroyalebuildabot/data/images/cards/mighty_miner.jpg b/clashroyalebuildabot/images/cards/mighty_miner.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mighty_miner.jpg rename to clashroyalebuildabot/images/cards/mighty_miner.jpg diff --git a/clashroyalebuildabot/data/images/cards/miner.jpg b/clashroyalebuildabot/images/cards/miner.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/miner.jpg rename to clashroyalebuildabot/images/cards/miner.jpg diff --git a/clashroyalebuildabot/data/images/cards/minion_horde.jpg b/clashroyalebuildabot/images/cards/minion_horde.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/minion_horde.jpg rename to clashroyalebuildabot/images/cards/minion_horde.jpg diff --git a/clashroyalebuildabot/data/images/cards/minions.jpg b/clashroyalebuildabot/images/cards/minions.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/minions.jpg rename to clashroyalebuildabot/images/cards/minions.jpg diff --git a/clashroyalebuildabot/data/images/cards/minipekka.jpg b/clashroyalebuildabot/images/cards/minipekka.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/minipekka.jpg rename to clashroyalebuildabot/images/cards/minipekka.jpg diff --git a/clashroyalebuildabot/data/images/cards/mirror.jpg b/clashroyalebuildabot/images/cards/mirror.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mirror.jpg rename to clashroyalebuildabot/images/cards/mirror.jpg diff --git a/clashroyalebuildabot/data/images/cards/monk.jpg b/clashroyalebuildabot/images/cards/monk.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/monk.jpg rename to clashroyalebuildabot/images/cards/monk.jpg diff --git a/clashroyalebuildabot/data/images/cards/mortar.jpg b/clashroyalebuildabot/images/cards/mortar.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mortar.jpg rename to clashroyalebuildabot/images/cards/mortar.jpg diff --git a/clashroyalebuildabot/data/images/cards/mortar_ev1.jpg b/clashroyalebuildabot/images/cards/mortar_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mortar_ev1.jpg rename to clashroyalebuildabot/images/cards/mortar_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/mother_witch.jpg b/clashroyalebuildabot/images/cards/mother_witch.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/mother_witch.jpg rename to clashroyalebuildabot/images/cards/mother_witch.jpg diff --git a/clashroyalebuildabot/data/images/cards/musketeer.jpg b/clashroyalebuildabot/images/cards/musketeer.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/musketeer.jpg rename to clashroyalebuildabot/images/cards/musketeer.jpg diff --git a/clashroyalebuildabot/data/images/cards/night_witch.jpg b/clashroyalebuildabot/images/cards/night_witch.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/night_witch.jpg rename to clashroyalebuildabot/images/cards/night_witch.jpg diff --git a/clashroyalebuildabot/data/images/cards/party_hut.jpg b/clashroyalebuildabot/images/cards/party_hut.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/party_hut.jpg rename to clashroyalebuildabot/images/cards/party_hut.jpg diff --git a/clashroyalebuildabot/data/images/cards/party_rocket.jpg b/clashroyalebuildabot/images/cards/party_rocket.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/party_rocket.jpg rename to clashroyalebuildabot/images/cards/party_rocket.jpg diff --git a/clashroyalebuildabot/data/images/cards/pekka.jpg b/clashroyalebuildabot/images/cards/pekka.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/pekka.jpg rename to clashroyalebuildabot/images/cards/pekka.jpg diff --git a/clashroyalebuildabot/data/images/cards/phoenix.jpg b/clashroyalebuildabot/images/cards/phoenix.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/phoenix.jpg rename to clashroyalebuildabot/images/cards/phoenix.jpg diff --git a/clashroyalebuildabot/data/images/cards/poison.jpg b/clashroyalebuildabot/images/cards/poison.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/poison.jpg rename to clashroyalebuildabot/images/cards/poison.jpg diff --git a/clashroyalebuildabot/data/images/cards/prince.jpg b/clashroyalebuildabot/images/cards/prince.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/prince.jpg rename to clashroyalebuildabot/images/cards/prince.jpg diff --git a/clashroyalebuildabot/data/images/cards/princess.jpg b/clashroyalebuildabot/images/cards/princess.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/princess.jpg rename to clashroyalebuildabot/images/cards/princess.jpg diff --git a/clashroyalebuildabot/data/images/cards/rage.jpg b/clashroyalebuildabot/images/cards/rage.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/rage.jpg rename to clashroyalebuildabot/images/cards/rage.jpg diff --git a/clashroyalebuildabot/data/images/cards/raging_prince.jpg b/clashroyalebuildabot/images/cards/raging_prince.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/raging_prince.jpg rename to clashroyalebuildabot/images/cards/raging_prince.jpg diff --git a/clashroyalebuildabot/data/images/cards/ram_rider.jpg b/clashroyalebuildabot/images/cards/ram_rider.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/ram_rider.jpg rename to clashroyalebuildabot/images/cards/ram_rider.jpg diff --git a/clashroyalebuildabot/data/images/cards/rascals.jpg b/clashroyalebuildabot/images/cards/rascals.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/rascals.jpg rename to clashroyalebuildabot/images/cards/rascals.jpg diff --git a/clashroyalebuildabot/data/images/cards/rocket.jpg b/clashroyalebuildabot/images/cards/rocket.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/rocket.jpg rename to clashroyalebuildabot/images/cards/rocket.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_delivery.jpg b/clashroyalebuildabot/images/cards/royal_delivery.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_delivery.jpg rename to clashroyalebuildabot/images/cards/royal_delivery.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_ghost.jpg b/clashroyalebuildabot/images/cards/royal_ghost.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_ghost.jpg rename to clashroyalebuildabot/images/cards/royal_ghost.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_giant.jpg b/clashroyalebuildabot/images/cards/royal_giant.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_giant.jpg rename to clashroyalebuildabot/images/cards/royal_giant.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_giant_ev1.jpg b/clashroyalebuildabot/images/cards/royal_giant_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_giant_ev1.jpg rename to clashroyalebuildabot/images/cards/royal_giant_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_hogs.jpg b/clashroyalebuildabot/images/cards/royal_hogs.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_hogs.jpg rename to clashroyalebuildabot/images/cards/royal_hogs.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_recruits.jpg b/clashroyalebuildabot/images/cards/royal_recruits.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_recruits.jpg rename to clashroyalebuildabot/images/cards/royal_recruits.jpg diff --git a/clashroyalebuildabot/data/images/cards/royal_recruits_ev1.jpg b/clashroyalebuildabot/images/cards/royal_recruits_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/royal_recruits_ev1.jpg rename to clashroyalebuildabot/images/cards/royal_recruits_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/santa_hog_rider.jpg b/clashroyalebuildabot/images/cards/santa_hog_rider.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/santa_hog_rider.jpg rename to clashroyalebuildabot/images/cards/santa_hog_rider.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeleton_army.jpg b/clashroyalebuildabot/images/cards/skeleton_army.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeleton_army.jpg rename to clashroyalebuildabot/images/cards/skeleton_army.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeleton_barrel.jpg b/clashroyalebuildabot/images/cards/skeleton_barrel.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeleton_barrel.jpg rename to clashroyalebuildabot/images/cards/skeleton_barrel.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeleton_dragons.jpg b/clashroyalebuildabot/images/cards/skeleton_dragons.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeleton_dragons.jpg rename to clashroyalebuildabot/images/cards/skeleton_dragons.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeleton_king.jpg b/clashroyalebuildabot/images/cards/skeleton_king.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeleton_king.jpg rename to clashroyalebuildabot/images/cards/skeleton_king.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeletons.jpg b/clashroyalebuildabot/images/cards/skeletons.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeletons.jpg rename to clashroyalebuildabot/images/cards/skeletons.jpg diff --git a/clashroyalebuildabot/data/images/cards/skeletons_ev1.jpg b/clashroyalebuildabot/images/cards/skeletons_ev1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/skeletons_ev1.jpg rename to clashroyalebuildabot/images/cards/skeletons_ev1.jpg diff --git a/clashroyalebuildabot/data/images/cards/sparky.jpg b/clashroyalebuildabot/images/cards/sparky.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/sparky.jpg rename to clashroyalebuildabot/images/cards/sparky.jpg diff --git a/clashroyalebuildabot/data/images/cards/spear_goblins.jpg b/clashroyalebuildabot/images/cards/spear_goblins.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/spear_goblins.jpg rename to clashroyalebuildabot/images/cards/spear_goblins.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_archers.jpg b/clashroyalebuildabot/images/cards/super_archers.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_archers.jpg rename to clashroyalebuildabot/images/cards/super_archers.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_hog_rider.jpg b/clashroyalebuildabot/images/cards/super_hog_rider.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_hog_rider.jpg rename to clashroyalebuildabot/images/cards/super_hog_rider.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_ice_golem.jpg b/clashroyalebuildabot/images/cards/super_ice_golem.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_ice_golem.jpg rename to clashroyalebuildabot/images/cards/super_ice_golem.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_lava_hound.jpg b/clashroyalebuildabot/images/cards/super_lava_hound.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_lava_hound.jpg rename to clashroyalebuildabot/images/cards/super_lava_hound.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_magic_archer.jpg b/clashroyalebuildabot/images/cards/super_magic_archer.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_magic_archer.jpg rename to clashroyalebuildabot/images/cards/super_magic_archer.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_mini_pekka.jpg b/clashroyalebuildabot/images/cards/super_mini_pekka.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_mini_pekka.jpg rename to clashroyalebuildabot/images/cards/super_mini_pekka.jpg diff --git a/clashroyalebuildabot/data/images/cards/super_witch.jpg b/clashroyalebuildabot/images/cards/super_witch.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/super_witch.jpg rename to clashroyalebuildabot/images/cards/super_witch.jpg diff --git a/clashroyalebuildabot/data/images/cards/terry.jpg b/clashroyalebuildabot/images/cards/terry.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/terry.jpg rename to clashroyalebuildabot/images/cards/terry.jpg diff --git a/clashroyalebuildabot/data/images/cards/tesla.jpg b/clashroyalebuildabot/images/cards/tesla.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/tesla.jpg rename to clashroyalebuildabot/images/cards/tesla.jpg diff --git a/clashroyalebuildabot/data/images/cards/the_log.jpg b/clashroyalebuildabot/images/cards/the_log.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/the_log.jpg rename to clashroyalebuildabot/images/cards/the_log.jpg diff --git a/clashroyalebuildabot/data/images/cards/three_musketeers.jpg b/clashroyalebuildabot/images/cards/three_musketeers.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/three_musketeers.jpg rename to clashroyalebuildabot/images/cards/three_musketeers.jpg diff --git a/clashroyalebuildabot/data/images/cards/tombstone.jpg b/clashroyalebuildabot/images/cards/tombstone.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/tombstone.jpg rename to clashroyalebuildabot/images/cards/tombstone.jpg diff --git a/clashroyalebuildabot/data/images/cards/tornado.jpg b/clashroyalebuildabot/images/cards/tornado.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/tornado.jpg rename to clashroyalebuildabot/images/cards/tornado.jpg diff --git a/clashroyalebuildabot/data/images/cards/valkyrie.jpg b/clashroyalebuildabot/images/cards/valkyrie.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/valkyrie.jpg rename to clashroyalebuildabot/images/cards/valkyrie.jpg diff --git a/clashroyalebuildabot/data/images/cards/wall_breakers.jpg b/clashroyalebuildabot/images/cards/wall_breakers.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/wall_breakers.jpg rename to clashroyalebuildabot/images/cards/wall_breakers.jpg diff --git a/clashroyalebuildabot/data/images/cards/warmth.jpg b/clashroyalebuildabot/images/cards/warmth.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/warmth.jpg rename to clashroyalebuildabot/images/cards/warmth.jpg diff --git a/clashroyalebuildabot/data/images/cards/witch.jpg b/clashroyalebuildabot/images/cards/witch.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/witch.jpg rename to clashroyalebuildabot/images/cards/witch.jpg diff --git a/clashroyalebuildabot/data/images/cards/wizard.jpg b/clashroyalebuildabot/images/cards/wizard.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/wizard.jpg rename to clashroyalebuildabot/images/cards/wizard.jpg diff --git a/clashroyalebuildabot/data/images/cards/x_bow.jpg b/clashroyalebuildabot/images/cards/x_bow.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/x_bow.jpg rename to clashroyalebuildabot/images/cards/x_bow.jpg diff --git a/clashroyalebuildabot/data/images/cards/zap.jpg b/clashroyalebuildabot/images/cards/zap.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/zap.jpg rename to clashroyalebuildabot/images/cards/zap.jpg diff --git a/clashroyalebuildabot/data/images/cards/zappies.jpg b/clashroyalebuildabot/images/cards/zappies.jpg similarity index 100% rename from clashroyalebuildabot/data/images/cards/zappies.jpg rename to clashroyalebuildabot/images/cards/zappies.jpg diff --git a/clashroyalebuildabot/data/images/digits/0.jpg b/clashroyalebuildabot/images/digits/0.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/0.jpg rename to clashroyalebuildabot/images/digits/0.jpg diff --git a/clashroyalebuildabot/data/images/digits/1.jpg b/clashroyalebuildabot/images/digits/1.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/1.jpg rename to clashroyalebuildabot/images/digits/1.jpg diff --git a/clashroyalebuildabot/data/images/digits/2.jpg b/clashroyalebuildabot/images/digits/2.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/2.jpg rename to clashroyalebuildabot/images/digits/2.jpg diff --git a/clashroyalebuildabot/data/images/digits/3.jpg b/clashroyalebuildabot/images/digits/3.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/3.jpg rename to clashroyalebuildabot/images/digits/3.jpg diff --git a/clashroyalebuildabot/data/images/digits/4.jpg b/clashroyalebuildabot/images/digits/4.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/4.jpg rename to clashroyalebuildabot/images/digits/4.jpg diff --git a/clashroyalebuildabot/data/images/digits/5.jpg b/clashroyalebuildabot/images/digits/5.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/5.jpg rename to clashroyalebuildabot/images/digits/5.jpg diff --git a/clashroyalebuildabot/data/images/digits/6.jpg b/clashroyalebuildabot/images/digits/6.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/6.jpg rename to clashroyalebuildabot/images/digits/6.jpg diff --git a/clashroyalebuildabot/data/images/digits/7.jpg b/clashroyalebuildabot/images/digits/7.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/7.jpg rename to clashroyalebuildabot/images/digits/7.jpg diff --git a/clashroyalebuildabot/data/images/digits/8.jpg b/clashroyalebuildabot/images/digits/8.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/8.jpg rename to clashroyalebuildabot/images/digits/8.jpg diff --git a/clashroyalebuildabot/data/images/digits/9.jpg b/clashroyalebuildabot/images/digits/9.jpg similarity index 100% rename from clashroyalebuildabot/data/images/digits/9.jpg rename to clashroyalebuildabot/images/digits/9.jpg diff --git a/clashroyalebuildabot/data/images/screen/end_of_game.jpg b/clashroyalebuildabot/images/screen/end_of_game.jpg similarity index 100% rename from clashroyalebuildabot/data/images/screen/end_of_game.jpg rename to clashroyalebuildabot/images/screen/end_of_game.jpg diff --git a/clashroyalebuildabot/data/images/screen/lobby.jpg b/clashroyalebuildabot/images/screen/lobby.jpg similarity index 100% rename from clashroyalebuildabot/data/images/screen/lobby.jpg rename to clashroyalebuildabot/images/screen/lobby.jpg diff --git a/clashroyalebuildabot/data/numbers_S_128x32.onnx b/clashroyalebuildabot/models/numbers_S_128x32.onnx similarity index 100% rename from clashroyalebuildabot/data/numbers_S_128x32.onnx rename to clashroyalebuildabot/models/numbers_S_128x32.onnx diff --git a/clashroyalebuildabot/data/side.onnx b/clashroyalebuildabot/models/side.onnx similarity index 100% rename from clashroyalebuildabot/data/side.onnx rename to clashroyalebuildabot/models/side.onnx diff --git a/clashroyalebuildabot/data/units_M_480x352.onnx b/clashroyalebuildabot/models/units_M_480x352.onnx similarity index 100% rename from clashroyalebuildabot/data/units_M_480x352.onnx rename to clashroyalebuildabot/models/units_M_480x352.onnx diff --git a/clashroyalebuildabot/screen.py b/clashroyalebuildabot/screen.py index ec058f8..d510df8 100644 --- a/clashroyalebuildabot/screen.py +++ b/clashroyalebuildabot/screen.py @@ -5,15 +5,13 @@ from PIL import Image import yaml -from clashroyalebuildabot.data.constants import SCREENSHOT_HEIGHT -from clashroyalebuildabot.data.constants import SCREENSHOT_WIDTH +from clashroyalebuildabot.constants import SCREENSHOT_HEIGHT, SRC_DIR +from clashroyalebuildabot.constants import SCREENSHOT_WIDTH class Screen: def __init__(self): - config_path = os.path.join( - os.path.dirname(__file__), "config", "config.yml" - ) + config_path = os.path.join(SRC_DIR, "config.yaml") with open(config_path, encoding="utf-8") as file: config = yaml.safe_load(file) diff --git a/clashroyalebuildabot/state/card_detector.py b/clashroyalebuildabot/state/card_detector.py index ba5f79f..66a53df 100644 --- a/clashroyalebuildabot/state/card_detector.py +++ b/clashroyalebuildabot/state/card_detector.py @@ -4,15 +4,17 @@ from PIL import Image from scipy.optimize import linear_sum_assignment -from clashroyalebuildabot.data.constants import CARD_CONFIG -from clashroyalebuildabot.data.constants import DATA_DIR -from clashroyalebuildabot.data.constants import HAND_SIZE -from clashroyalebuildabot.data.constants import MULTI_HASH_INTERCEPT -from clashroyalebuildabot.data.constants import MULTI_HASH_SCALE +from clashroyalebuildabot.constants import CARD_CONFIG, SRC_DIR +from clashroyalebuildabot.constants import MULTI_HASH_INTERCEPT +from clashroyalebuildabot.constants import MULTI_HASH_SCALE from clashroyalebuildabot.namespaces.cards import Cards class CardDetector: + HAND_SIZE = 5 + MULTI_HASH_SCALE = 0.355 + MULTI_HASH_INTERCEPT = 163 + def __init__(self, cards, hash_size=8, grey_std_threshold=5): self.cards = cards self.hash_size = hash_size @@ -23,8 +25,8 @@ def __init__(self, cards, hash_size=8, grey_std_threshold=5): def _calculate_multi_hash(self, image): gray_image = self._calculate_hash(image) - light_image = MULTI_HASH_SCALE * gray_image + MULTI_HASH_INTERCEPT - dark_image = (gray_image - MULTI_HASH_INTERCEPT) / MULTI_HASH_SCALE + light_image = self.MULTI_HASH_SCALE * gray_image + self.MULTI_HASH_INTERCEPT + dark_image = (gray_image - self.MULTI_HASH_INTERCEPT) / self.MULTI_HASH_SCALE multi_hash = np.vstack([gray_image, light_image, dark_image]).astype( np.float32 ) @@ -40,18 +42,18 @@ def _calculate_hash(self, image): def _calculate_card_hashes(self): card_hashes = np.zeros( - (len(self.cards), 3, self.hash_size * self.hash_size, HAND_SIZE), + (len(self.cards), 3, self.hash_size * self.hash_size, self.HAND_SIZE), dtype=np.float32, ) for i, card in enumerate(self.cards): path = os.path.join( - DATA_DIR, "images", "cards", f"{card.name}.jpg" + SRC_DIR, "images", "cards", f"{card.name}.jpg" ) pil_image = Image.open(path) multi_hash = self._calculate_multi_hash(pil_image) card_hashes[i] = np.tile( - np.expand_dims(multi_hash, axis=2), (1, 1, HAND_SIZE) + np.expand_dims(multi_hash, axis=2), (1, 1, self.HAND_SIZE) ) return card_hashes diff --git a/clashroyalebuildabot/state/debugger.py b/clashroyalebuildabot/state/debugger.py index f228ab5..e4165b2 100644 --- a/clashroyalebuildabot/state/debugger.py +++ b/clashroyalebuildabot/state/debugger.py @@ -3,9 +3,9 @@ from PIL import ImageDraw from PIL import ImageFont -from clashroyalebuildabot.data.constants import CARD_CONFIG -from clashroyalebuildabot.data.constants import LABELS_DIR -from clashroyalebuildabot.data.constants import SCREENSHOTS_DIR +from clashroyalebuildabot.constants import CARD_CONFIG +from clashroyalebuildabot.constants import LABELS_DIR +from clashroyalebuildabot.constants import SCREENSHOTS_DIR from clashroyalebuildabot.namespaces.units import NAME2UNIT diff --git a/clashroyalebuildabot/state/detector.py b/clashroyalebuildabot/state/detector.py index e0e9610..49d7634 100644 --- a/clashroyalebuildabot/state/detector.py +++ b/clashroyalebuildabot/state/detector.py @@ -1,32 +1,31 @@ import os -from clashroyalebuildabot.data.constants import DATA_DIR -from clashroyalebuildabot.data.constants import DECK_SIZE +from clashroyalebuildabot.constants import MODELS_DIR from clashroyalebuildabot.state.card_detector import CardDetector from clashroyalebuildabot.state.debugger import Debugger from clashroyalebuildabot.state.number_detector import NumberDetector from clashroyalebuildabot.state.screen_detector import ScreenDetector -from clashroyalebuildabot.state.side_detector import SideDetector from clashroyalebuildabot.state.unit_detector import UnitDetector class Detector: + DECK_SIZE = 8 + def __init__(self, cards, debug=False): - if len(cards) != DECK_SIZE: - raise ValueError(f"You must specify all {DECK_SIZE} of your cards") + if len(cards) != self.DECK_SIZE: + raise ValueError(f"You must specify all {self.DECK_SIZE} of your cards") self.cards = cards self.debug = debug self.card_detector = CardDetector(self.cards) self.number_detector = NumberDetector( - os.path.join(DATA_DIR, "numbers_S_128x32.onnx") + os.path.join(MODELS_DIR, "numbers_S_128x32.onnx") ) self.unit_detector = UnitDetector( - os.path.join(DATA_DIR, "units_M_480x352.onnx"), self.cards + os.path.join(MODELS_DIR, "units_M_480x352.onnx"), self.cards ) self.screen_detector = ScreenDetector() - self.side_detector = SideDetector(os.path.join(DATA_DIR, "side.onnx")) self.debugger = None if self.debug: diff --git a/clashroyalebuildabot/state/number_detector.py b/clashroyalebuildabot/state/number_detector.py index cec11b8..dd26e8d 100644 --- a/clashroyalebuildabot/state/number_detector.py +++ b/clashroyalebuildabot/state/number_detector.py @@ -1,11 +1,11 @@ import numpy as np -from clashroyalebuildabot.data.constants import ELIXIR_BOUNDING_BOX -from clashroyalebuildabot.data.constants import KING_HP -from clashroyalebuildabot.data.constants import KING_LEVEL_2_X -from clashroyalebuildabot.data.constants import NUMBER_CONFIG -from clashroyalebuildabot.data.constants import NUMBER_HEIGHT -from clashroyalebuildabot.data.constants import NUMBER_WIDTH +from clashroyalebuildabot.constants import ELIXIR_BOUNDING_BOX +from clashroyalebuildabot.constants import KING_HP +from clashroyalebuildabot.constants import KING_LEVEL_2_X +from clashroyalebuildabot.constants import NUMBER_CONFIG +from clashroyalebuildabot.constants import NUMBER_HEIGHT +from clashroyalebuildabot.constants import NUMBER_WIDTH from clashroyalebuildabot.state.onnx_detector import OnnxDetector diff --git a/clashroyalebuildabot/state/screen_detector.py b/clashroyalebuildabot/state/screen_detector.py index 58c1806..1976900 100644 --- a/clashroyalebuildabot/state/screen_detector.py +++ b/clashroyalebuildabot/state/screen_detector.py @@ -3,8 +3,7 @@ import numpy as np from PIL import Image -from clashroyalebuildabot.data.constants import DATA_DIR -from clashroyalebuildabot.data.constants import SCREEN_CONFIG +from clashroyalebuildabot.constants import SCREEN_CONFIG, IMAGES_DIR class ScreenDetector: @@ -19,7 +18,7 @@ def _calculate_screen_hashes(self): dtype=np.int32, ) for i, name in enumerate(SCREEN_CONFIG.keys()): - path = os.path.join(DATA_DIR, "images", "screen", f"{name}.jpg") + path = os.path.join(IMAGES_DIR, "screen", f"{name}.jpg") image = Image.open(path) hash_ = np.array( image.resize( diff --git a/clashroyalebuildabot/state/side_detector.py b/clashroyalebuildabot/state/side_detector.py index 70f636b..a5d00bb 100644 --- a/clashroyalebuildabot/state/side_detector.py +++ b/clashroyalebuildabot/state/side_detector.py @@ -1,14 +1,14 @@ import numpy as np from PIL import Image -from clashroyalebuildabot.data.constants import SIDE_SIZE from clashroyalebuildabot.state.onnx_detector import OnnxDetector class SideDetector(OnnxDetector): - @staticmethod - def _preprocess(image): - image = image.resize((SIDE_SIZE, SIDE_SIZE), Image.Resampling.BICUBIC) + SIDE_SIZE = 16 + + def _preprocess(self, image): + image = image.resize((self.SIDE_SIZE, self.SIDE_SIZE), Image.Resampling.BICUBIC) image = np.array(image, dtype=np.float32) / 255 return np.expand_dims(image, axis=0) diff --git a/clashroyalebuildabot/state/unit_detector.py b/clashroyalebuildabot/state/unit_detector.py index 7a8af6d..3c19973 100644 --- a/clashroyalebuildabot/state/unit_detector.py +++ b/clashroyalebuildabot/state/unit_detector.py @@ -2,22 +2,23 @@ import numpy as np -from clashroyalebuildabot.data.constants import DATA_DIR -from clashroyalebuildabot.data.constants import DETECTOR_UNITS -from clashroyalebuildabot.data.constants import UNIT_Y_END -from clashroyalebuildabot.data.constants import UNIT_Y_START +from clashroyalebuildabot.constants import DETECTOR_UNITS, MODELS_DIR +from clashroyalebuildabot.constants import UNIT_Y_END +from clashroyalebuildabot.constants import UNIT_Y_START from clashroyalebuildabot.state.onnx_detector import OnnxDetector from clashroyalebuildabot.state.side_detector import SideDetector class UnitDetector(OnnxDetector): MIN_CONF = 0.3 + UNIT_Y_START = 0.05 + UNIT_Y_END = 0.80 def __init__(self, model_path, cards): super().__init__(model_path) self.cards = cards - self.side_detector = SideDetector(os.path.join(DATA_DIR, "side.onnx")) + self.side_detector = SideDetector(os.path.join(MODELS_DIR, "side.onnx")) self.possible_ally_units = self._get_possible_ally_units() def _get_possible_ally_units(self): @@ -41,9 +42,9 @@ def _preprocess(self, image): image = image.crop( ( 0, - UNIT_Y_START * image.height, + self.UNIT_Y_START * image.height, image.width, - UNIT_Y_END * image.height, + self.UNIT_Y_END * image.height, ) ) image = self.resize(image) @@ -54,8 +55,8 @@ def _preprocess(self, image): return image, padding def _post_process(self, pred, height, image): - pred[:, [1, 3]] *= UNIT_Y_END - UNIT_Y_START - pred[:, [1, 3]] += UNIT_Y_START * height + pred[:, [1, 3]] *= self.UNIT_Y_END - self.UNIT_Y_START + pred[:, [1, 3]] += self.UNIT_Y_START * height clean_pred = {"ally": {}, "enemy": {}} for p in pred: name, category, target, transport = DETECTOR_UNITS[round(p[5])] diff --git a/main.py b/main.py index a4bfa60..4fec531 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ +import os from datetime import datetime import sys import threading @@ -6,6 +7,7 @@ from loguru import logger from clashroyalebuildabot.bot.example.custom_bot import CustomBot +from clashroyalebuildabot.constants import DEBUG_DIR from clashroyalebuildabot.namespaces.cards import Cards from clashroyalebuildabot.updater import Updater @@ -41,7 +43,7 @@ def main(): if __name__ == "__main__": - logger.add("bot.log", rotation="500 MB") + logger.add(os.path.join(DEBUG_DIR, "bot.log"), rotation="500 MB") title_thread = threading.Thread(target=update_terminal_title, daemon=True) title_thread.start() main()