Lootdata = { "Guild Rune", "Ancient Memento", "Phirius Shell", "Energy of Justice" } mustDelete = { } local function Lootstuff() RoMScript('SetBootFrameAutoTake(true);') -- --deactivate ingame-autolooting RoMScript('isAutoTakeBooty:Enable();') -- and disable the checkbutton inventory:update() item = nil repeat unloot = true local time, moreToCome, msg = EventMonitorCheck("Loot") if time ~= nil then mi18, ip = string.find(msg, "You obtained") if ip ~= nil then local itemfullstring = string.sub(msg, ip+2, -2); -- local itemsid, color, itemsname = sendMacro('igf_parseItemLink(itemfullstring)'); local a1, a2 = string.find(msg, "|Hitem") local idcheck = string.sub(msg, a1, -2) local id = tonumber(string.sub(idcheck, 8, 12), 16); local name_from = string.find(msg, "[", 1, true); local name_to = string.find(msg, "]", 1, true); local name = string.sub(msg, name_from+1, name_to-1) local stuff = inventory:findItem(id) for k, v in ipairs(Lootdata) do if v == name then unloot = "false" end end if unloot == "false" then break end -- for k in pairs(stuff) do -- printf(k) -- end item:update(id) if unloot == "true" then if not (item.ItemCount > 5) then item:delete(id) end end for k, v in ipairs(mustDelete) do if v == name then item:delete(id) end end -- printf(id) -- printf(msg) -- printf("/n") -- printf(name) -- printf("/n") -- printf(itemfullstring) break end else break end until moreToCome == false end function startLootstuff() --RoMScript('SetBootFrameAutoTake(true);') --RoMScript('isAutoTakeBooty:Enable();') unregisterTimer("Looter"); printf("This session will be loot monitored\n"); EventMonitorStart("Loot", "CHAT_MSG_SYSTEM_GET"); registerTimer("Looter", secondsToTimer(2), Lootstuff); end function stopLootstuff() printf("This session will no longer be loot monitored\n"); RoMScript('SetBootFrameAutoTake(false);') -- --deactivate ingame-autolooting RoMScript('isAutoTakeBooty:Disable();') unregisterTimer("Looter"); EventMonitorStop("Loot"); end function Lootstuffadd(_name,_addremove) if _addremove == nil then addremove = "add" end addremove = string.lower(_addremove) if( _name ) then name = trim(_name); end; if addremove == "add" then table.insert(Lootdata, name); for k,v in ipairs(Lootdata) do printf(k.." "..v.."\n") end end if addremove == "remove" then for k,v in ipairs(Lootdata) do if v == name then table.remove(Lootdata, k); prinf("Removed "..v.."from Loot\n") end printf(k.." "..v.."\n") end end end function Lootstuffremove(_name,_addremove) if _addremove == nil then addremove = "add" end addremove = string.lower(_addremove) if( _name ) then name = trim(_name); end; if addremove == "add" then table.insert(mustDelete, name); for k,v in ipairs(mustDelete) do printf(k.." "..v.."\n") end end if addremove == "remove" then for k,v in ipairs(mustDelete) do if v == name then table.remove(mustDelete, k); prinf("Removed "..v.."from Loot\n") end printf(k.." "..v.."\n") end end end