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.
Checks if the unit can attack another unit.
unit.canAttack(otherUnit) : true | false
Checks if the object is the same as another object.
unit.isUnit(otherUnit) : true | nil
Checks if the unit is friendly with another unit.
unit.friendOf(otherUnit) : true | false
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
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.
Returns buff information. Identical to UnitBuff.
unit.buff(spell[, sourceObject]) : "buff", ... | nil
Time remaining on a buff.
unit.buffRemains(spell[, sourceObject]) : remains | 0
Number of stacks of the given buff.
unit.buffStacks(spell[, sourceObject]) : stacks | 0
Time the buff has been active.
unit.buffUptime(spell[, sourceObject]) : uptime | 0
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
Returns debuff information. Identical to UnitDebuff.
unit.debuff(spell[, sourceObject]) : "debuff", ... | nil
Time remaining on a debuff.
unit.debuffRemains(spell[, sourceObject]) : remains | 0
Number of stacks of the given debuff.
unit.debuffStacks(spell[, sourceObject]) : stacks | 0
Time the debuff has been active.
unit.debuffUptime(spell[, sourceObject]) : uptime | 0
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
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
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
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
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
Checks if objects are in line of sight of each other.
unit.losOf(otherUnit) : isLoS | false
Sister Attribute: los - checks between player and object
Current 3D position of the object.
unit.position() : x, y, z | nil
Estimated position after given time, based on current velocity and direction.
unit.predictPosition(timeInSeconds) : x, y, z | curX, curY, curZ | nil
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
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
Faces the unit or angle as given.
unit.face() : void
player.face(unit) : void
player.face(angle) : void
Sets the unit as focus.
unit.setFocus() : void
Sets the unit as target.
unit.setTarget() : void
Next: Learn about Player Attributes for player-specific information.