Characters
combat
Casting skills, the skill bar, movement and the ranger's pet.
combat gives your character orders: cast skills, dodge, jump, move and glide. A skill can be given by skill id or by name, and is looked up on your character's skills. A target can be an Agent or an agent id; without one, the skill goes to your current target.
local target = agents.selected()
if target and combat.is_ready("Signet of Might") then
combat.cast("Signet of Might")
end
if me:health().percent < 30 then
combat.evade(combat.EVADE_DOWN)
endCasting
Casts a skill, at a target or your current one. False if you don't have the skill.
combat.cast_at(skill, pos)boolean
Casts a ground-targeted skill at a position.
Casts a skill as if from a skill bar slot.
The same, at a position.
Casts a mastery skill.
Casts a mastery skill at a position.
Whether the skill has line of sight to a position.
Cancels the cast in progress.
combat.current_skill()table?
What you're casting:
{id, skill_id, name, target_agent_id}.Whether you're casting anything, or that skill.
Skills and the skill bar
combat.skills()Skill[]?
Your character's skills. See Skill.
combat.skill(skill)Skill?
One of your skills, by id or name.
The skill in a skill bar slot.
combat.is_ready(skill)boolean
Whether one of your skills is off cooldown and usable.
Any skill by id, whether or not you have it.
When a skill's effects happen during its cast: a list of
{trigger_type, time}.combat.queued_skills()Skill[]?
Skills queued to cast next.
The slot set to auto-attack.
Sets which slot auto-attacks.
Time left on weapon swap.
combat.weapon_swap_ready()boolean
Whether you can swap weapons.
Puts a utility, heal or elite skill in a slot.
Picks a weapon skill for a slot.
Puts an underwater skill in a slot.
Movement and actions
Dodges.
direction is one of the combat.EVADE_* constants, combat.EVADE_DOWN by default.combat.is_evading()boolean
Whether you're dodging.
Jumps.
Moves in a direction.
Moves in a direction while facing another.
The direction you've been ordered to move.
Turns to face a direction.
Stops moving.
Swaps weapon sets.
Puts your weapons away.
Interacts with an agent.
Picks up a ground item.
Revives an agent.
Finishes a downed agent.
Gliding
Opens the glider.
Closes it.
Glides faster.
Glides slower.
Dodge directions
EVADE_UPEVADE_DOWNEVADE_LEFTEVADE_RIGHTEVADE_UP_LEFTEVADE_UP_RIGHTEVADE_DOWN_LEFTEVADE_DOWN_RIGHTpet
The ranger's pet. Everything returns nil (or false) when you aren't a ranger.
pet.available()boolean
Whether you have a pet.
pet.active()Agent?
The pet out now.
pet.selected_pets()table[]?
Your selected pets, each
{id, name}.pet.mode()integer?
The pet's mode.
Switches the pet's mode.
pet.swap_cooldown()number?
Time left until you can swap pets.
pet.swap_ready()boolean
Whether you can swap pets.
Swaps pets.
pet.skills()Skill[]?
The pet's skills.
pet.skill(skill)Skill?
One pet skill, by id or name.
Sends the pet to attack.
Uses the pet's first skill.
pet.skill_2 and pet.skill_3 use the others.Calls the pet back.
Stows the pet.
Brings the pet out.
content_function
Special actions the game runs as content functions, such as fishing.
Evades.
content_function.evading()boolean
Whether that evade is in progress.
Starts reeling left.
stop_fishing_left stops.Starts reeling right.
stop_fishing_right stops.Starts a content function by id.
Stops it.