-- ItemPreview_ListData.id.tip.left[6] Lootdata = { "Guild Rune", "Ancient Memento", "Phirius Shell", "Energy of Justice" } mustDelete = { "Totem-hunting Axe", } local function Lootstuff() keep = "gold" -- false is default or "gold" will drop items under 1k but keep items over 1k -- local variables = RoMScript('igf: 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) id = tonumber(string.sub(idcheck, 8, 12), 16); local name_from = string.find(msg, "[", 1, true); local name_to = string.find(msg, "]", 1, true); name = string.sub(msg, name_from+1, name_to-1) local stuff = inventory:findItem(id) -- table.Lootomatic_Settings = RoMScript('getfilter()') -- table.ItemPreview_ListData = RoMScript('getloottxt()') -- local valuestring = ItemPreview_ListData[id]["tip"]["left"][6] -- local v1, v2 = string.find(valuestring, "Gold") -- local v3, v4 = string.find(valuestring, "Worth:") -- if v1 then -- local value = string.sub(valuestring, v4+2, v1-2) -- end --for i in Lootomatic_Settings["ItemFilter"] do -- checkLootomatic = Lootomatic_Settings["ItemFilter"][i]["Name"] -- if checkLootomatic == name then -- lootable = Lootomatic_Settings["ItemFilter"][i]["Loot"] -- if lootable == 3 then -- unloot = "false" -- end -- end -- end local filtercheck = RoMScript('getfilter(name)') local value = RoMScript('getloottxt(id)') if (filtercheck) then if filtercheck == "false" then unloot = "false" end end if (value) then -- if (value ~= "false") then if value ~= "false" then if value > 1000 and keep == "gold" then unloot = "false" end end end -- end 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("..name..") if unloot == "true" then if not (inventory:itemTotalCount(id) > 5) then local item = inventory:findItem(id) item:delete("..name..") end for k, v in ipairs(mustDelete) do if v == name then local item = inventory:findItem(id) item:delete(id) end end end -- printf(id) -- printf(msg) -- printf("/n") -- printf(name) -- printf("/n") -- printf(itemfullstring) break end else break end until moreToCome == false end --function getValue(_id) -- ItemPreview_ListData = RoMScript('getloottxt()') -- local valuestring = ItemPreview_ListData[_id]["tip"]["left"][6] -- if valuestring ~= nil then -- checks if there is something there -- local v1, v2 = string.find(valuestring, "Gold") -- local v3, v4 = string.find(valuestring, "Worth:") -- if v1 then -- local value = string.sub(valuestring, v4+2, v1-2) -- end -- if v1 == nil then -- finds value if weapon or shield -- valuestring = ItemPreview_ListData[_id]["tip"]["left"][7] -- if valuestring then -- v1, v2 = string.find(valuestring, "Gold") -- v3, v4 = string.find(valuestring, "Worth:") -- value = string.sub(valuestring, v4+2, v1-2) -- end -- end -- local v5, v6 = string.find(value, ",") -- if v5 then -- removes the comma in thousands value as no item is over 9999 -- local value1 = string.sub(value, v5+1, v5+3) -- local value2 = string.sub(value, v5-1, v5-1) -- value = tonumber(value) -- -- value = value2,value1 -- end -- value = tonumber(value) -- else -- value = "false" -- end -- -- return value --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