Skip to content

Utility

ClickPostion(x,y,z)

Left click the ground at a given location (spell placing).

local x,y,z = ObjectPosition('target')
ClickPosition(x,y,z)

ClickToMove(x,y,z)

Click the ground at a given location.

local x,y,z = ObjectPosition('target')
ClickToMove(x,y,z)

WorldToScreen(x,y,z)

Returns Screen proportional coordinates for the given 3D world coordinates.

  • [-1,-1] is the TOP Left of the Screen
  • [0,0] is the center of the Screen
  • [1,1] is the bottom right corner of the screen
local sx,sy = WorldToScreen(ObjectPosition('player'))
print(sx,sy)

TraceLine(x1, y1, z1, x2, y2, z2, hitFlags)

Checks the line of sight between start and end positions

Returns either false when there is no collision or the world coordinates of the collision x,y,z

local x1, y1, z1 = ObjectPosition('player')
local x2, y2, z2 = ObjectPosition('target')
local x, y, z = TraceLine(x1, y1, z1, x2, y2, z2, 0x100111)
if x then print(x,y,z) end
if not x then print('No Collision, end coordinates are: ', x2,y2,z2)

Hit Flags:

M2Collision = 0x1
M2Render = 0x2
WMOCollision = 0x10
WMORender = 0x20
Terrain = 0x100
WaterWalkableLiquid = 0x10000
Liquid = 0x20000
EntityCollision = 0x100000
Unknown = 0x200000

ScreenToWorld(x, y, flags)

Returns 3D world coordinates for the given Screen Position or 0,0,0 if not valid data.

  • flags are collision flags to intercect with
  • x,y are GetCursorPosition() scaled coordinates
    -- default flags are 0x100111
    local x,y,z = ScreenToWorld(GetCursorPosition())

    -- just pass some random flags
    -- same results as default just enables the 7th bit as well which is ignored
    local cx,cy = GetCursorPosition()
    local x,y,z = ScreenToWorld(cx,cy,0x100151)

Distance(obj1, obj2 | x,y,z,x2,y2,z2)

Returns the distance between 2 objects or 2 different 3D locaitons. Can not be mixed. ie you can not use 'player', x y z.

if Distance('player', object) > 30 then 
    print ('You are not in range!')
end 

GetCorpsePosition()

Returns the x y z values of yor corpse lcoation.

NOTE: Experimental

local foo = GetCorpsePosition(obj) 
Go(x,y,z) 

GetMouseover(object)

Returns the object # of the current mouseover value.

local foo = GetMouseover(obj) 
Unlock('TargetUnit', foo)

SetMouseover(object)

Sets the object # to the current mouseover value.

SetMouseover(obj) 

Unlock('TargetUnit', 'mouseover')

SendMovementHeartbeat()

Force Update the Player Position and Direction

SetPlayerFacing(direction,forceUpdate)

Force the unit to face the direction specified.
direction is in radians and is normalized internally by direction = direction % (2*math.pi)
forceUpdate when true does a SendMovementHeartbeat() in place

local foo = ObjectFacing('target')
SetPlayerFacing(foo)
print ('Facing the same direction as your target!')

Unlock(function,...)

Run a protected wow function. First argument needs to be either a string inside _G that points to a function or a function reference.

Unlock('JumpOrAscendStart')
Unlock('CastSpellByName', 'Fireball', 'target')

local func = CastSpellByID

Unlock(func,75) -- cast Auto-Shot

GetAnglesBetweenPositions(x,y,z,a,b,c)

Returns the angle between 2 positions.

local x,y,z = ObjectPosition('player')
local a,b,c = ObjectPosition('target')
local angle = GetAnglesBetweenPositions(x,y,z,a,b,c) 

GetPositionFromPosition(x,y,z,distance,angleXY,angleXYZ)

UnitSpecializationID(object | unit)

Returns the units spec (retail only), see here for a list of spec IDs

local spec = UnitSpecializationID('party1')