OSRS Plugin API
    Preparing search index...

    Enumeration ON_OBJ_OP

    Event id for taking an action on a item on the floor. Calls the OnObjOpCallback.

    -- Create a function
    local objOp = function(op, usedItemId, objtype, count, objCoordinate)
    local obj = osrs.Engine.Decoders.decodeObjType(objtype)
    if(usedItemId ~= -1) then
    local usedItem = osrs.Engine.Decoders.decodeObjType(usedItemId)
    osrs.printf("Used Item %s with Action: %s on Object name %s, id %d Count: %i at X: %i Level: %i Z: %i", usedItem:getName(), op, obj:getName(), objtype, count, objCoordinate.x, objCoordinate.level, objCoordinate.z)
    else
    osrs.printf("Action: %s on Object name %s, id %d with Count: %i at X: %i Level: %i Z: %i", op, obj:getName(), objtype, count, objCoordinate.x, objCoordinate.level, objCoordinate.z)
    end
    local objLevel, objMapX, objMapZ, objTileX, objTileZ = objCoordinate:getMapTile()
    osrs.printf('Object Map Tile - level: %d, x: %d, z: %d, x2: %d, z2: %d', objLevel, objMapX, objMapZ, objTileX, objTileZ)
    end

    -- Subscribe to the function
    osrs.Events.subscribe(objOp, osrs.Events.ON_OBJ_OP)