Pixelbotter.com - Forum

SUPPORTED GAMES => Clash Royale => Topic started by: Pixel on Oct 11, 2025, 06:28 PM

Title: Rule book & Intelli-deck
Post by: Pixel on Oct 11, 2025, 06:28 PM
CONFIG: RULEBOOK — WHAT IT DOES (AND WHEN)

Summary
When the bot is mid-match, each loop roughly does:


{"key":"hog-rider","template":"hog_rider_a","side":"left"}

It then calls apply_rules(hit, elixir_now) — this is where your Rulebook runs.
If no rule actually plays a card, it falls back to your global play_policy (e.g. leftmost_affordable).
Bobom line: the Rulebook runs only when an enemy unit is detected.


Matching logic (top → bobom)
Your rules are checked in order. The first rule that matches and can play wins.

Each rule contains:


If a rule matches but cannot play (e.g., not enough elixir or no affordable slot), you'll see:
[rule:skip] hog-rider no affordable/eligible slot for rule


Lane Resolution
Given the enemy appeared on hit["side"] ∈ {left, right, center}:


Examples:


Where to drop (depth)


Slot Selection (the play block)
The bot reads each hand slot's cost (templates: card_mana_cost_*.png), filters by affordability, then applies:


Guarded play: even after a slot is chosen, the bot re-reads the card cost and elixir; if it no longer fits, the play is aborted safely and the rule is treated as skipped.


Minimal example
rules:

if: ["hog-rider"]
lane: same
where: back
min_elixir: 3
play: { select: lowest_cost }

if: ["balloon", "baby-dragon", "inferno-dragon"]
lane: same
where: bridge
min_elixir: 3
play:
select: highest_cost_under
cost: 5

INTELLI-DECK — HOW IT WORKS

Goal
Use your deck list to recognize what you own, learn the opponent's cards during the match (up to 8 uniques), and auto-select counters you actually have.


What you configure

Tiny example
play_style: intelli_deck

decks:
1:
cards: ["knight","archers","minions","arrows","fireball","giant","musketeer","mini-p.e.k.k.a"]

counters:
hog_rider:
prefer_lane: same
where: back
cards: ["cannon","archers","knight"]

balloon:
prefer_lane: same
where: bridge
cards: ["musketeer","archers"]


What happens in match