Core Concepts

Object Functions

Complete reference guide to SYNQ object functions

Object functions are methods within SYNQ objects that require () to return a value. They perform calculations or operations and may accept parameters. Functions are non-case-sensitive and less performant than attributes, but more flexible.

General Functions

canAttack

Checks if the unit can attack another unit.

unit.canAttack(otherUnit) : true | false

isUnit

Checks if the object is the same as another object.

unit.isUnit(otherUnit) : true | nil

friendOf

Checks if the unit is friendly with another unit.

unit.friendOf(otherUnit) : true | false

hasTalent

Checks if the object has the given talent or PvP talent. Accepts talent name (non-case-sensitive) or SpellID. Only works with group members.

unit.hasTalent(talent) : true | false

Buffs & Debuffs

All buff/debuff functions accept SpellID or spell names (non-case-sensitive), and optionally a source object as the second parameter to check if that object was the caster.

buff

Returns buff information. Identical to UnitBuff.

unit.buff(spell[, sourceObject]) : "buff", ... | nil

buffRemains

Time remaining on a buff.

unit.buffRemains(spell[, sourceObject]) : remains | 0

buffStacks

Number of stacks of the given buff.

unit.buffStacks(spell[, sourceObject]) : stacks | 0

buffUptime

Time the buff has been active.

unit.buffUptime(spell[, sourceObject]) : uptime | 0

buffFrom

Returns list of active buffs matching the given spell IDs or names.

unit.buffFrom(spellList[, sourceObject]) : { buff, buff, ... } | nil

Similar: buffsFrom - Returns the count of active buffs from the list

debuff

Returns debuff information. Identical to UnitDebuff.

unit.debuff(spell[, sourceObject]) : "debuff", ... | nil

debuffRemains

Time remaining on a debuff.

unit.debuffRemains(spell[, sourceObject]) : remains | 0

debuffStacks

Number of stacks of the given debuff.

unit.debuffStacks(spell[, sourceObject]) : stacks | 0

debuffUptime

Time the debuff has been active.

unit.debuffUptime(spell[, sourceObject]) : uptime | 0

debuffFrom

Returns list of active debuffs matching the given spell IDs or names.

unit.debuffFrom(spellList[, sourceObject]) : { debuff, debuff, ... } | nil

Similar: debuffsFrom - Returns the count of active debuffs from the list

Spells / Casting

cooldown

Estimates cooldown of any unit's spell based on combat log tracking. SpellID is more performant than spell name.

unit.cooldown(spellID | spellName) : cooldown | 0

used

Checks if the unit cast the given spell in the past x seconds. SpellID is more performant than spell name.

unit.used(spellID | spellName[, durationSeconds]) : true | nil

Movement & Position

distanceTo

Distance between objects, accounting for combat reach and bounding radius.

unit.distanceTo(otherObject) : distance | 9999

Sister Attribute: distance - distance from player to object Similar: distanceToLiteral - same but ignores combat reach

facing

Checks if the object is facing another object. Default angle is 180 degrees (required for casting). Optional angle parameter in degrees.

unit.facing(otherUnit[, angle]) : isFacing | false

Sister Attribute: playerFacing[, Angle] - checks if player is facing the object

losOf

Checks if objects are in line of sight of each other.

unit.losOf(otherUnit) : isLoS | false

Sister Attribute: los - checks between player and object

position

Current 3D position of the object.

unit.position() : x, y, z | nil

predictPosition

Estimated position after given time, based on current velocity and direction.

unit.predictPosition(timeInSeconds) : x, y, z | curX, curY, curZ | nil

movingToward

Checks if unit is moving toward another unit. Optional angle and duration parameters.

unit.movingToward(otherUnit[, { angle = degrees, duration = seconds }]) : true | false

Defaults: duration = 0, angle = 30 degrees

movingAwayFrom

Checks if unit is moving away from another unit. Optional angle and duration parameters.

unit.movingAwayFrom(otherUnit[, { angle = degrees, duration = seconds }]) : true | false

Defaults: duration = 0, angle = 220 degrees

Actions

face

Faces the unit or angle as given.

unit.face() : void
player.face(unit) : void
player.face(angle) : void

setFocus

Sets the unit as focus.

unit.setFocus() : void

setTarget

Sets the unit as target.

unit.setTarget() : void

Next: Learn about Player Attributes for player-specific information.