Skip to content

Things that bite

The parts of this API that are surprising, and why they are the way they are. Most of them exist because the 3.3.5a client answers a slightly different question than the one you meant to ask.

Aura helpers return seconds, not booleans

Nyx.MyBuff and friends return seconds remaining, and 0 means an aura with no duration.

lua
local left = Nyx.MyBuff("Slice and Dice")
if not left or left < 2 then          -- correct
if not left then                      -- wrong: ignores "about to fall off"
if left then                          -- wrong: 0 is truthy in Lua

Returning a duration means one call answers both "is it up" and "how long", and nil unambiguously means absent.

Use MyBuff / MyDebuff for upkeep

Nyx.Debuff counts anyone's aura. Another rogue's Rupture on your target would stop you refreshing your own, and your DoT would silently never be up. Nyx.MyDebuff filters to your own casts.

Nyx.Known reads the spellbook

GetSpellInfo cannot answer "do I have this spell" — it resolves any name the client knows, learned or not. Nyx.Known scans the spellbook instead, so an untrained ability falls through your priority list rather than being attempted forever.

Melee range is not a distance

Melee range is max(reachA + reachB + 4/3, 5) — both hitboxes, with a five yard floor. That is the server's rule, and the server decides whether your swing lands. A large creature is reachable from noticeably further away than a critter.

Use Nyx.Objects.InMeleeRange(unit). The client's CheckInteractDistance fallback is 9.9 yards, nearly double melee, and produces "out of range" failures that waste global cooldowns.

Line of sight ignores trees, and fails open

Line of sight tests terrain and buildings only, never doodads — a tree does not block a spell in WoW, and the server agrees.

If the native is missing it returns clear, not blocked. Failing closed would silently stop every cast and look like a broken rotation rather than a missing check.

GUIDs are strings

They are 64-bit; a Lua number is a double. A numeric GUID loses precision silently, so every GUID here is a 16-character hex string. Compare them with ==, and never tonumber() one.

World coordinates only come from Nyx.Objects

UnitPosition does not exist on 3.3.5a. Nyx.Position and Nyx.Distance are kept for compatibility but return nil on this client. Use Nyx.Objects.Player(), Nyx.Objects.Distance(guid) and the x/y/z on unit tables.

The overlay draws every frame, the rotation ticks at 10 Hz

Drawings persist until replaced, so a drawing you stop issuing disappears on the next frame. If you draw from your own code, re-issue every frame rather than once.

Nyx.Engine only exists in the world

The natives are installed after the player is in the world, and the client throws its Lua state away between the login screen and the world. Guard on Nyx.Engine before touching it. Nyx.Objects.Available() does this for you.

API reference generated from source.