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
professions.*.util.not_in_combat() is the opposite.util.energy("thief_initiative"); 0 without it. The names are those of agent:profession_energy().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.
util.ready_on_bar(id) also needs it on the bar.ms milliseconds, counting alacrity.util.cooldown_on_bar(id) is nil when it isn't on the bar.math.huge when unknown.ms milliseconds.util.ammo_on_bar(id) and util.ammo_cooldown(id).combat.skill returns it. util.any_skill(id) finds it anywhere.content.skill returns it, kept for good once found. util.skill_info(id) is its info, util.skill_name(id) its name.util.is_ground_targeted(id).Casting
util.current_order() is the whole order.util.in_queue(id) checks one.util.weapon_swap_ready_before(ms) counts the next ms milliseconds.enabled, true only once you stood still for 300 ms; always true otherwise. For skills that need you to stand still.The target
range of you.enabled, true only while the target's edge is within range; always true otherwise.util.target_buff_stacks(id_or_name) counts its stacks.pre_execute.pos is in your cone, angle radians wide and length long.Pets
util.pet_skill(id) returns it.util.pet_in_queue(id) checks its queue.distance of the target.Weapons
A weapon set is {main, off} or {two_handed}, as inventory.WEAPON_TYPE_*.
"Scepter + Dagger", or "Empty".Timers
delay ms after it's started; not started yet. util.started_timer(delay) starts it now.timer:force_start() restarts it, timer:reset() stops it.timer:finished() says whether it's done.delay before it's started, 0 once finished. timer:elapsed() is the time since the start.cd ms.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 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.
function MyBuild:target_is_invuln()
return encounters.matthias_stacks() > 5 or encounters.largos_cc_phase()
endwidgets
acr.widgets draws a build's settings in its draw_settings.
label beside it. Clicking turns settings[key] on or off. A checkbox until the icon is loaded.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