Rule language
A rule is one line of text. It is what the addon saves, what the rule builder shows under As text, what a search box takes, and what a profile line carries. The builder writes it for you; this page is for reading it, typing it, or writing what the builder cannot.
rule = term / term / ... every term must holdterm = test a keyword and its value, or free text | !term not | ( rule | rule | ... ) any one of the alternatives/means “and”:cat 4/pct <60is armour and under 60% of its usual price.|means “or”, and only inside parentheses:(wool | silk).!turns the next term around:!quality poor. Plain negation: a test that is false because a value is missing is true when negated, so!pct <60also holds for an item with no usual price. To require one, say so:pct >=0/!pct <60.- Spaces around
/,|,!and the parentheses do not matter. Keywords and text are read in any case.
A test is a keyword, then its value. A keyword counts only as a whole word: required or ilvl40
is free text, not req or ilvl.
Free text
Section titled “Free text”A term that is not a keyword is free text. It matches an item whose name holds it, or whose
category, subcategory or slot is called exactly that, in your game’s language: linen, cloth.
name robe matches an item whose name holds “robe”, and nowhere else. Put the name in quotes when it
holds /, |, !, ( or ), or begins or ends with a space: name "of the eagle". The quotes
may follow name directly: name"of the eagle". Only /, | or ) can follow a quoted name.
quality
Section titled “quality”quality rare, quality uncommon+ (that or better), quality common-rare (a range). The
qualities, worst to best: poor, common, uncommon, rare, epic, legendary.
Item level: ilvl 40, ilvl 40+, ilvl 40-60, ilvl <60, ilvl <=60, ilvl >40, ilvl >=40.
The comparison may touch the keyword: ilvl>=40.
Required level, written like ilvl: req <=30.
The unit price, against an amount of money: price <5g, price <=1g50s. It needs a comparison
first: <, <=, > or >=.
The unit price as a percentage of the item’s usual price: pct <60,
pct <=62.5. False when the item has no usual price.
profit
Section titled “profit”What reselling at the usual price would leave after the auction house’s 5% cut, minus the price:
profit >=1g. False when the item has no usual price.
One item by its ID: item 2589. For several, use alternatives: (item 2589 | item 2592).
The item’s category, by the game’s own number, which reads the same in every language: cat 2
(weapons), cat 4 (armour). A word instead of a number, such as cat armor, is matched against the
category’s name in your game’s language; older rules were written that way, and the builder turns
such names into numbers when it can.
The subcategory, as category and subcategory numbers: sub 4.1 (armour, cloth). A name works as
for cat.
Where the item is worn, by the game’s equip location: slot INVTYPE_CHEST, written in any case.
A robe counts as worn on the chest. A name works as for cat.
Item lists are not supported, so a rule holding list does not read, whatever follows it. For
several items, use alternatives: (item 2589 | item 2592).
usable
Section titled “usable”usable, with no value: an item your character can use, by the game’s own answer for the character
you are playing (the same answer as the auction house’s “usable only” filter). The addon claims no
more than that: what the game counts as usable by your character is what it means. !usable is an
item your character cannot use: cat 4/!usable is armour you cannot wear.
It depends on the character, so a shared profile with usable matches differently for each
character that runs it, and the answers are asked again when your character levels up.
On a game client that cannot say what a character can use, a rule with usable still reads, but
the test never matches (and !usable always does). The Sniper and Search tabs and the rule builder
say so, and /ta check reports whether the client has the call.
Amounts of money
Section titled “Amounts of money”Gold, silver and copper, in that order, each at most once: 5g20s3c, 50s, 3c. A decimal is
allowed where it comes to whole copper: 1.5g is 1g50s. A bare number is gold: 5 is 5g. The
addon saves the shortest form, without spaces (1g50s).
Examples
Section titled “Examples”Each example is run through the addon’s own parser when these pages are built. “Saved as” is the text the addon keeps when it differs from what was typed.
| Rule | Saved as | Means |
|---|---|---|
linen | the same | Free text: "linen" in the item's name, or a category, subcategory or slot named exactly linen. |
name robe | the same | "robe" in the item's name, and nowhere else. |
name "of the eagle" | name of the eagle | A name in quotes may hold spaces and the characters / | ! ( ). The quotes are kept only when they are needed. |
quality rare | the same | Exactly rare. |
quality uncommon+ | the same | Uncommon or better. |
quality common-rare | the same | Common, uncommon or rare. |
ilvl 40-60 | the same | Item level 40 to 60, both included. |
ilvl >=40 | ilvl 40+ | Item level 40 or more. |
req <60 | req <=59 | Required level under 60. |
price <5g | the same | A unit price under 5 gold. |
price <= 1.5g | price <=1g50s | A unit price of at most 1 gold 50 silver. |
pct <60 | the same | Under 60% of the item's usual price. |
profit >=1g | the same | Reselling at the usual price, after the auction house's 5% cut, would leave at least 1 gold over the price. |
item 2589 | the same | The item with ID 2589 (Linen Cloth). |
cat 4/sub 4.1/pct <60 | the same | Armor, cloth, under 60% of its usual price. Categories are written by the game's own numbers. |
slot invtype_chest | slot INVTYPE_CHEST | Worn on the chest, robes included. |
(cat 2 | cat 4)/req <=30/pct <70 | the same | A weapon or armor, required level 30 or less, under 70% of its usual price. |
(wool | silk)/price <3s | the same | Wool or silk, under 3 silver each. |
cat 4/usable/pct <70 | the same | Armor your character can use, by the game's own answer, under 70% of its usual price. |
cat 4/!usable | the same | Armor your character cannot use. |
!pct <60 | the same | Not under 60% of its usual price. Also true for an item with no usual price yet. |
pct >=0/!pct <60 | the same | Has a usual price, and is not under 60% of it. |
When a rule does not read
Section titled “When a rule does not read”The addon points at the character where the problem starts and says what it expected. For example:
| Rule | What the addon says |
|---|---|
ilvl=40 | a level is a whole number, written like 40, 40+, 40-60, <60, <=60, >40 or >=40. |
price 5g | start with a comparison, <, <=, > or >=, then the value. |
quality shiny | quality is poor, common, uncommon, rare, epic or legendary, written like rare, uncommon+ or common-rare. |
price <5g20 | not an amount: write it like 5g20s3c, 1.5g, 50s or 5 (gold). |
wool | silk | | separates alternatives only inside ( and ). |
(wool | silk | this ( is never closed. |
name "robe | this quote is never closed. |
wool/ | a term is missing here. |
usable 1 | usable takes no value. |
Every message the parser can give:
- Enter an amount, such as 5g20s.
- An amount cannot be negative.
- An amount cannot include a fraction of a copper.
- Write gold, silver and copper in that order, each at most once.
- Not an amount: write it like 5g20s3c, 1.5g, 50s or 5 (gold).
- A term is missing here.
- This ( is never closed.
- This ) has no ( to close.
- | separates alternatives only inside ( and ).
- Expected / between terms here.
- This quote is never closed.
- Only /, | or ) can follow a quoted name.
- <keyword> needs a value.
- Usable takes no value.
- Quality is poor, common, uncommon, rare, epic or legendary, written like rare, uncommon+ or common-rare.
- A level is a whole number, written like 40, 40+, 40-60, <60, <=60, >40 or >=40.
- The first value of this range is larger than the second.
- Start with a comparison, <, <=, > or >=, then the value.
- A percentage is a number of 0 or more, such as 60 or 62.5.
- An item is its ID, a whole number such as 2589.
- Item lists are not supported: write several items as (item 2589 | item 2592).
How the builder writes rules
Section titled “How the builder writes rules”Each condition of the rule builder is one term, joined with /:
| Condition | Comparisons offered | Written as |
|---|---|---|
| Category | is any of | cat |
| Subcategory | is any of | sub |
| Slot | is any of | slot |
| Quality | at least, exactly, at most, between | quality |
| Item level | between, at least, at most | ilvl |
| Required level | between, at least, at most | req |
| Usable by my character | is, is not | usable |
| Price | at most, under, at least, over | price |
| Percent of usual | under, at most, at least, over | pct |
| Profit | at least, over, at most, under | profit |
| Name | contains | name |
| Item | is any of | item |
- A list condition with several values becomes alternatives: Category “Weapon” and “Armor” is
(cat 2 | cat 4). - not becomes
!. - “at least” and “at most” on levels become
40+and<=60; “between” becomes40-60. - “under”, “at most”, “at least” and “over” on money and percent become
<,<=,>=and>.
The builder cannot show free text, an “or” across different fields, groups inside groups, or a category, subcategory or slot written by a name that is not exactly one this game knows. Such a rule is kept and used, and edited as text.