Page 1 of 1

Identifying bound items?

Posted: Fri Oct 22, 2010 11:58 am
by Velsharon
Is there a flag or variable identifying an item in a bag slot is bound or would I have to read in the tool tip of the bag slot item and search for the word "Bound"? Or is there another way?

Re: Identifying bound items?

Posted: Fri Oct 22, 2010 7:38 pm
by Andreas_B
You can parse the item link.

Code: Select all

local itemLink = RoMScript("GetBagItemLink("..index..")");
if ( itemLink ~= nil ) then
    local bound = tonumber(itemLink:match("^|H.-:[0-9a-f]+ ([0-9a-f])"), 16);
    if bound == 0 then
        -- bound
    elseif bound == 1 then
        -- nonbindable
    elseif bound == 2 then
        -- cs - item
    elseif bound == 3 then
        -- bound on equip    
    end;
end;

Re: Identifying bound items?

Posted: Fri Oct 22, 2010 8:11 pm
by rock5
The items do have a bound status flag. It's called BoundStatus. I think it can equal the values as listed by Andreas_B.

So, using Andreas_B example, you would do this insteas;

Code: Select all

    local bound = inventory.BagSlot[ slotnumber ].BoundStatus;
    if bound == 0 then
        -- bound
    elseif bound == 1 then
        -- nonbindable
    elseif bound == 2 then
        -- cs - item
    elseif bound == 3 then
        -- bound on equip   
    end;

Re: Identifying bound items?

Posted: Fri Oct 22, 2010 8:59 pm
by Velsharon
Thanks for the info guys.