ACRs

Helpers

acr.util, acr.targeting, acr.encounters and acr.widgets.

Conditions are small functions, usually built from these helpers. Skill and bar lookups are cached for the rest of the game tick, so a condition can call them as often as it likes.

local util = acr.util

Skill(IGNITE)
    :when(function() return util.energy("evoker_skill_charge") == 30 end)
    :when(function() return util.cooldown(SCEPTER_FIRE_2) > 0 end)

You

util.me()Agent?
Your character.
Your core profession, as professions.*.
Where you are.
Whether you're in combat. util.not_in_combat() is the opposite.
Whether you're alive.
Your health, 0 to 100.
Your endurance.
A profession resource, like util.energy("thief_initiative"); 0 without it. The names are those of agent:profession_energy().
Whether you have a boon, condition or effect.
Its stacks on you, 0 without it.
Its time left on you in milliseconds, 0 without it.
Whether you're knocked down, floating, stunned, dazed, launched or pushed.
Whether you look at pos, within max_angle radians.

Skills

The _on_bar versions only look at your skill bar; the others find any skill you have, on the bar or not.

Whether the skill is on your bar right now.
Whether the skill is off cooldown. util.ready_on_bar(id) also needs it on the bar.
Whether the skill is ready, or will be within ms milliseconds, counting alacrity.
Its cooldown left in milliseconds, 0 when ready. util.cooldown_on_bar(id) is nil when it isn't on the bar.
Its cooldown minus what alacrity will save; math.huge when unknown.
Whether it went on cooldown within the last ms milliseconds.
Its charges. Also util.ammo_on_bar(id) and util.ammo_cooldown(id).
Ready, and the target within its range and radius.
Whether every skill in the list is on cooldown or being cast.
The skill on your bar, as combat.skill returns it. util.any_skill(id) finds it anywhere.
Its definition, as content.skill returns it, kept for good once found. util.skill_info(id) is its info, util.skill_name(id) its name.
Whether its definition says it's instant. Also util.is_ground_targeted(id).
Whether quickness speeds it up right now.

Casting

The skill you're casting. util.current_order() is the whole order.
Whether you're casting this skill.
The skills queued on your bar. util.in_queue(id) checks one.
Whether you can swap weapons. util.weapon_swap_ready_before(ms) counts the next ms milliseconds.
When enabled, true only once you stood still for 300 ms; always true otherwise. For skills that need you to stand still.

The target

The selected agent, if it's still there.
Its collision radius, 0 without a target.
Whether it's within range of you.
Whether it's within the skill's range plus most of its radius.
When enabled, true only while the target's edge is within range; always true otherwise.
Whether the target has a buff. util.target_buff_stacks(id_or_name) counts its stacks.
Turns you towards the target. Use it as a pre_execute.
Where an agent will be soon, from how it moves.
Whether pos is in your cone, angle radians wide and length long.
The distance between two positions, ignoring height.

Pets

Your pet or mech.
Whether a pet skill is ready. util.pet_skill(id) returns it.
Whether the pet is using it. util.pet_in_queue(id) checks its queue.
Whether the pet is within distance of the target.

Weapons

A weapon set is {main, off} or {two_handed}, as inventory.WEAPON_TYPE_*.

The active weapon set.
A weapon set by id: 4 and 5 on land, 0 and 1 underwater.
Whether these are the active weapons.
Whether two sets are the same; a lone weapon matches in either hand.
A set as text: "Scepter + Dagger", or "Empty".

Timers

util.now()integer
Milliseconds since the host started.
A timer that finishes delay ms after it's started; not started yet. util.started_timer(delay) starts it now.
Starts it, unless it's running. timer:force_start() restarts it, timer:reset() stops it.
Whether it's been started. timer:finished() says whether it's done.
Milliseconds left: delay before it's started, 0 once finished. timer:elapsed() is the time since the start.
Runs a function at most once every cd ms.
Runs fn(...) if cd ms passed since it last ran, and says whether it did.
fn(), worked out once per game tick, for conditions that scan many agents.

targeting

acr.targeting decides what the runner attacks, with the same lists as the Rust ACRs.

The selection, when it's something to attack: hostile or neutral, alive, and not on the blacklists.
Whether attacking it is pointless now: an invulnerability buff, or a character or gadget that can't be hurt.
Whether its break bar can be hit now.
A downed player in reach that fewer than five players are reviving.

The lists are plain tables you can add to: INVULNERABLE_BUFFS, INVULNERABLE_BUFF_IDS, INVULNERABLE_CHARACTERS, INVULNERABLE_GADGETS, CHARACTER_BLACKLIST, GADGET_BLACKLIST and CANNOT_CC_WHEN_INVULN, each a set of names (or ids): targeting.CHARACTER_BLACKLIST["Seeker"] = true.

encounters

acr.encounters has boss checks, for a build's target_is_invuln.

Matthias' Blood Shield stacks, 0 on anyone else.
Nikare or Kenut behind a barrier: break it with CC, damage does nothing.
Cardinal Sabir behind a barrier.
function MyBuild:target_is_invuln()
    return encounters.matthias_stacks() > 5 or encounters.largos_cc_phase()
end

widgets

acr.widgets draws a build's settings in its draw_settings.

The skill's icon on a green (on) or red (off) button, with its name or label beside it. Clicking turns settings[key] on or off. A checkbox until the icon is loaded.
A checkbox for settings[key], with a tooltip when hovered.
function MyBuild:draw_settings()
    local s = self.settings
    ui.text("CC Settings:")
    widgets.skill_toggle(s, "rifle3", RIFLE_3, "CC - Net Shot")
    widgets.checkbox(s, "return_to_me", "Return to Me")
end