According to LibQtip, AddLine returns a number so at 142:
Code:
line = tooltip:AddLine(npc.name, npc.item, format("%d/%d", count, 5))
then at 144 you:
Code:
tooltip:SetScript(line, "OnMouseUp", UseTomTom, npc)
QTips prototype for it SetScript function is:
Code:
function tipPrototype:SetScript(scriptType, handler)
RawSetScript(self, scriptType, handler)
...
I'm not sure
line as the first parameter of the SetScript call is correct.
Code:
tooltip:SetScript("OnMouseUp", UseTomTom)
I don't know LibQTip so maybe I'm missing something.