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)
end

Casting

Casts a skill, at a target or your current one. False if you don't have the skill.
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.
What you're casting: {id, skill_id, name, target_agent_id}.
Whether you're casting anything, or that skill.

Skills and the skill bar

Your character's skills. See Skill.
One of your skills, by id or name.
The skill in a skill bar slot.
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}.
Skills queued to cast next.
The slot set to auto-attack.
Sets which slot auto-attacks.
Time left on weapon swap.
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.
Whether you're dodging.
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

Dodge directions
EVADE_UPEVADE_DOWNEVADE_LEFTEVADE_RIGHTEVADE_UP_LEFTEVADE_UP_RIGHTEVADE_DOWN_LEFTEVADE_DOWN_RIGHT

pet

The ranger's pet. Everything returns nil (or false) when you aren't a ranger.

Whether you have a pet.
The pet out now.
Your selected pets, each {id, name}.
pet.mode()integer?
The pet's mode.
Switches the pet's mode.
Time left until you can swap pets.
Whether you can swap pets.
Swaps pets.
pet.skills()Skill[]?
The pet's skills.
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.

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.