|
|
|
|
@ -62,9 +62,60 @@ Available only if the addon is installed and enabled.
|
|
|
|
|
### Functions and syntax |
|
|
|
|
- Math operators: `+`, `-`, `*`, `/`, `^` |
|
|
|
|
- Money literals: `100g`, `50s`, `25c`, or combined `12g 34s 56c` |
|
|
|
|
- Functions: `min`, `max`, `avg`, `first`, `check`, `ifgt`, `ifgte`, `iflt`, `iflte`, `ifeq`, `round`, `roundup`, `rounddown` |
|
|
|
|
- Convert another item: `convert(priceSource, itemLink)` or `convert(priceSource, item:12345)` |
|
|
|
|
|
|
|
|
|
### Function: min(...) |
|
|
|
|
Returns the smallest of the provided values. Ignores invalid values. |
|
|
|
|
Example: `min(dbmarket, 250g)` |
|
|
|
|
|
|
|
|
|
### Function: max(...) |
|
|
|
|
Returns the largest of the provided values. Ignores invalid values. |
|
|
|
|
Example: `max(dbminbuyout, 100g)` |
|
|
|
|
|
|
|
|
|
### Function: avg(...) |
|
|
|
|
Returns the average (rounded) of the provided values. Ignores invalid values. |
|
|
|
|
Example: `avg(dbmarket, dbminbuyout)` |
|
|
|
|
|
|
|
|
|
### Function: first(...) |
|
|
|
|
Returns the first valid value from left to right. |
|
|
|
|
Example: `first(dbminbuyout, dbmarket, 100g)` |
|
|
|
|
|
|
|
|
|
### Function: check(checkValue, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `checkValue` is greater than 0, otherwise `elseValue`. |
|
|
|
|
Example: `check(dbminbuyout, dbminbuyout, dbmarket)` |
|
|
|
|
|
|
|
|
|
### Function: ifgt(a, b, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `a` is greater than `b`, otherwise `elseValue`. |
|
|
|
|
Example: `ifgt(dbminbuyout, 200g, dbminbuyout, dbmarket)` |
|
|
|
|
|
|
|
|
|
### Function: ifgte(a, b, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `a` is greater than or equal to `b`, otherwise `elseValue`. |
|
|
|
|
Example: `ifgte(dbmarket, 500g, 500g, dbmarket)` |
|
|
|
|
|
|
|
|
|
### Function: iflt(a, b, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `a` is less than `b`, otherwise `elseValue`. |
|
|
|
|
Example: `iflt(dbminbuyout, 50g, 50g, dbminbuyout)` |
|
|
|
|
|
|
|
|
|
### Function: iflte(a, b, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `a` is less than or equal to `b`, otherwise `elseValue`. |
|
|
|
|
Example: `iflte(dbmarket, 20g, dbmarket, 20g)` |
|
|
|
|
|
|
|
|
|
### Function: ifeq(a, b, ifValue, elseValue) |
|
|
|
|
Returns `ifValue` when `a` equals `b`, otherwise `elseValue`. |
|
|
|
|
Example: `ifeq(dbminbuyout, dbmarket, dbminbuyout, dbmarket)` |
|
|
|
|
|
|
|
|
|
### Function: round(value[, step]) |
|
|
|
|
Rounds to the nearest `step` (default `1`). |
|
|
|
|
Example: `round(dbmarket, 1g)` |
|
|
|
|
|
|
|
|
|
### Function: roundup(value[, step]) |
|
|
|
|
Rounds up to the nearest `step` (default `1`). |
|
|
|
|
Example: `roundup(dbmarket, 5g)` |
|
|
|
|
|
|
|
|
|
### Function: rounddown(value[, step]) |
|
|
|
|
Rounds down to the nearest `step` (default `1`). |
|
|
|
|
Example: `rounddown(dbmarket, 5g)` |
|
|
|
|
|
|
|
|
|
### Examples |
|
|
|
|
- `dbmarket * 0.9` (90% of market value) |
|
|
|
|
- `max(dbminbuyout, 100g)` (at least 100g) |
|
|
|
|
|