pattern = string.gsub(string.gsub(value, "(%%s)", "(.+)"), "(%%d)", "(.+)");
local start, fin, arg1, arg2, arg3 = string.find(msg, pattern)
where value is i.e. LOOT_ITEM_SELF and msg is your loot event string.
Depending which loot event type you got, arg? is different and contains the owner, item and amount. In case of LOOT_ITEM_SELF arg1 contains the itemlink, rest is nil.
now you extract the needed info from the link.
this is how i realized a simple item tracker.
|