Reference › Function reference › Conditions

Conditions.totem.amount

dependency

Call as

Conditions.totem.amount(value)

Record the dependency Conditions.totem.amount, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

True when a totem condition's comparison is usable: value.value is a nonnegative finite number and value.operator is one of addon.operators.

Arguments

NameTypeWhat it does
valuetableSaved condition settings with operator and value fields.

Returns

1booleanTrue when the value passes the check.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

Source

Conditions/totem.lua, line 77. Read only in game; Duplicate makes an editable copy.

Conditions.totem.amount(value)
    return type(value.value)=="number" and value.value==value.value and value.value>=0 and value.value<math.huge
        and type(value.operator)=="string" and addon.isin(addon.operators,value.operator)

Back to Function reference