Skip to content

Objects

Objects()

Returns a table of all of the current objects in the object manager.

local objects = Objects()

for v,k in pairs(objects) do
    print(UnitName(k))
end

ObjectManager(type)

Returns a table of all objects in the object manager of the specific type.

It is highly recommended to use this instead of doing Objects() followed by ObjectType for every object in the game as it greatly impacts performance with an order of magnitudes!

local foo = ObjectManager("Unit" or 5) or {}
print ('There are, ' .. #foo .. ' in the object manager')

~~ObjectByIndex(index)~~

Returns the object by using its index. (Please do not use this for the sake of performance!)

local foo = ObjectByIndex(index)

ObjectType(object)

Returns the numeric value for the given object as a type. (Please note that ObjectManager(type) performs this operation much faster in combation with Objects())

local foo = ObjectType(object)
if foo == 5 then
    print ('You are a UNIT')
end
  enums.om.type = IsRetail and { -- Retail Om Types
    Object = 0,
    Item = 1,
    Container = 2,
    AzeriteEmpoweredItem = 3,
    AzeriteItem = 4,
    Unit = 5,
    Player = 6,
    ActivePlayer = 7,
    GameObject = 8,
    DynamicObject = 9,
    Corpse = 10,
    AreaTrigger = 11,
    SceneObject = 12,
    Conversation = 13
  } or { -- Classic Types
    Object = 0,
    Item = 1,
    Container = 2,
    Unk3 = 3,
    Unk4 = 4,
    Unit = 5,
    Player = 6,
    ActivePlayer = 7,
    GameObject = 8,
    Unk9 = 9,
    Unk10 = 10,
    Unk11 = 11,
    Unk12 = 12,
    Unk13 = 13
  }

PlayerObject()

Returns the players object.

local foo = PlayerObject()

ObjectPointer(obj)

Returns the objects pointer. Not really needed, but some requested it.

local pointer = ObjectPointer(object) 

ObjectCreator(obj)

Returns the OBJECT of the creator (critters such as snakes you buy from the snake vendor in Org or Stormwind).

if ObjectExists(k) and ObjectType(k) == 5 then
    print ('Name:', ObjectName(k), 'PlayerObject:' .. PlayerObject(), 'ObjCreator:' .. ObjectCreator(k), 'ObjSummoner:' .. ObjectSummoner(k) )
    if ObjectCreator(k) ~= 0 then 
        print(ObjectName(ObjectCreator(k)))
    end
end

ObjectExists(object)

Returns whether or not the object is actually in the object manager. Returns a boolean.

if ObjectExists(obj) then
    print('Object is Valid!')
else
    print('Object is NOT Valid!')
end

ObjectID(object | unit)

Returns the objects UNIT ID.

local foo = ObjectID(obj)
print ('Object ID for this object is:', foo)

ObjectInteract(object)

Interact with the given object (as if you right clicked on the unit or object)

if ObjectName(obj) == 'Mailbox' then
    ObjectInteract(obj)
end

GameObjectType(object)

Returns the game objects type. This is more of a subtype.

1 - Door 
7 - Chair 
13 - Mailbox
for v,k in pairs(Objects()) do
    if ObjectType(k) == 8 then 
        print (GameObjectType(k))
    end 
end 

ObjectField(obj, hex, type)

Returns memory information.

local foo = ObjectField(object, 0xD568, 5)
print ('Summoned by:', foo)
1 - BYTE (1 byte)
2 - WORD (2 bytes)
3 - DWORD (4 bytes)
4 - float (decimal number)
5 - object id (number)

DynamicFlags(object)

Returns the objects dynamic flags.

if DynamicFlags(object) == 12 then 
    print ('You are falling?')
end

ObjectFacing(object)

Returns the direction of the object, that it is facing.

local foo = ObjectFacing(obj)
print ('Object is facing:', foo)

UnitFlags1(object | unit)

Returns the unit flag 1.

if UnitFlags1(obj) == 'foo' then 
    print ('Bar') 
end 

UnitFlags2(object | unit)

Returns the unit flag 2.

if UnitFlags2(obj) == 'foo' then 
    print ('Bar') 
end 

UnitFlags3(object | unit)

Returns the unit flag 3.

if UnitFlags3(obj) == 'foo' then 
    print ('Bar') 
end 

UnitMovementFlag(object | unit)

Returns the object / units movement flag.

if UnitMovementFlag(obj) == 1 then
    print ('You are moving forward')
        else 
    print ('You are not moving forward')
end 

ObjectName(object | unit)

Returns the name of the given object.

local foo = ObjectName(obj)
print('Object Name is:', foo)

ObjectLootable(object)

Returns true if the unit can be looted.

if ObjectLootable(obj) then
    InteractObject(obj)
    print('Auto looted!')
end

ObjectSkinnable()

Returns returns true if the unit can be skinned. False otherwise.

if ObjectSkinnable(object) then
    print ('Object can be skinned!')
end

ObjectSummoner()

Returns the OBJECT of the summoner of the unit (summoned as in pets).

if ObjectExists(k) and ObjectType(k) == 5 then
    print ('Name:',ObjectName(k), 'PlayerObject:' .. PlayerObject(), 'ObjCreator:' .. ObjectCreator(k), 'ObjSummoner:' .. ObjectSummoner(k) )
    if ObjectCreator(k) ~= 0 then print (ObjectName(ObjectCreator(k)) )
    end
end

ObjectRotation()

Returns the objects rotation.

local myRotation = ObjectRotation('player') 

ObjectYaw()

Returns the objects yaw.

local myYaw = ObjectYaw('player') 

PlayerTarget()

Returns the targets object

local foo = PlayerTarget()

UnitTarget(object)

Returns the OBJECTS target object

local foo = UnitTarget(object)