diff --git a/aard_inventory.changelog b/aard_inventory.changelog index e536e52..d02ca47 100644 --- a/aard_inventory.changelog +++ b/aard_inventory.changelog @@ -1,6 +1,21 @@ dbot.changelog = {} +dbot.changelog[2.0007] = +{ + { change = drlDbotChangeLogTypeMisc, + desc = +[[Adjusted set creation and analysis framework. It now supports using + separate equipment search "intensities" for a single set and for a + full analysis of 200 sets. This should give you the best possible + results for a single set while keeping the time to do a full analysis + more manageable. Also, the resolution of a full analysis is fairly + rough to begin with because it is dependent on stat bonus estimates. + It doesn't make sense to try to squeeze every possible fraction of + a fraction of a percent out of the analysis when the original stat + assumptions could be off by 10% or more.]] + } +} dbot.changelog[2.0006] = { @@ -22,14 +37,16 @@ dbot.changelog[2.0005] = dbot.changelog[2.0004] = { { change = drlDbotChangeLogTypeMisc, - desc = "Refresh code now forces your first refresh in a new session to use a full refresh scan. " .. - "This is necessary because items might have moved or changed outside of this client and " .. - "we need to know the current location of all items. This also allows us to detect if a no-" .. - "save item was removed after the last session." + desc = +[[Refresh code now forces your first refresh in a new session to use a full refresh scan. + This is necessary because items might have moved or changed outside of this client and + we need to know the current location of all items. This also allows us to detect if a no- + save item was removed after the last session.]] }, { change = drlDbotChangeLogTypeFix, - desc = "Fixed incorrect return value check in the plugin update code. The previous code could " .. - "send an incorrect (nil) return value in some error cases." + desc = +[[Fixed incorrect return value check in the plugin update code. The previous code could + send an incorrect (nil) return value in some error cases.]] } } diff --git a/aard_inventory.xml b/aard_inventory.xml index 209a56d..2aad75f 100644 --- a/aard_inventory.xml +++ b/aard_inventory.xml @@ -87,7 +87,7 @@ dbot.version : Module to track version and changelog information and update the save_state="y" date_written="2017-08-12 08:45:15" requires="4.98" - version="2.0006" + version="2.0007" > = 8) then + -- Each iteration drops the weighting of a handicapped stat + if (numIters >= intensity) then dbot.debug("Breaking out of inv.set.createCR, looped over handicap " .. numIters .. " times") break end -- if - until (score < (bestScore * 0.7)) -- Let things anneal a bit, but cut it off if we are < x% of previous best + until (score < (bestScore * 0.8)) -- Let things anneal a bit, but cut it off if we are < x% of previous best -- Some items can be worn in multiple locations (e.g., a ring could be on "lfinger" or "rfinger" or -- a medal could be on "medal1" through "medal4"). We want to always be consistent on where items @@ -12416,10 +12428,11 @@ function inv.set.display(priorityName, level, endTag) return inv.tags.stop(invTagsSet, endTag, DRL_RET_BUSY) end -- if - inv.set.displayPkg = {} - inv.set.displayPkg.name = priorityName - inv.set.displayPkg.level = level - inv.set.displayPkg.endTag = endTag + inv.set.displayPkg = {} + inv.set.displayPkg.name = priorityName + inv.set.displayPkg.level = level + inv.set.displayPkg.intensity = inv.set.createIntensity + inv.set.displayPkg.endTag = endTag -- Kick off the display co-routine to display the set wait.make(inv.set.displayCR) @@ -12433,10 +12446,11 @@ function inv.set.displayCR() local priorityName = inv.set.displayPkg.name or "Unknown" local level = inv.set.displayPkg.level or 0 + local intensity = inv.set.displayPkg.intensity or inv.set.createIntensity local endTag = inv.set.displayPkg.endTag -- Create the set that we want to display - retval = inv.set.create(priorityName, level) + retval = inv.set.create(priorityName, level, drlAsynchronous, intensity) if (retval ~= DRL_RET_SUCCESS) then dbot.warn("inv.set.displayCR: failed to create set " .. priorityName .. "[" .. level .. "]: " .. dbot.retval.getString(retval)) @@ -12512,7 +12526,7 @@ function inv.set.displaySet(setName, level, equipSet) end -- inv.set.displaySet -function inv.set.createAndWear(priorityName, level, endTag) +function inv.set.createAndWear(priorityName, level, intensity, endTag) local retval = DRL_RET_SUCCESS local priorityTable @@ -12542,6 +12556,7 @@ function inv.set.createAndWear(priorityName, level, endTag) inv.set.createAndWearPkg = {} inv.set.createAndWearPkg.priorityName = priorityName inv.set.createAndWearPkg.level = level + inv.set.createAndWearPkg.intensity = intensity inv.set.createAndWearPkg.endTag = endTag wait.make(inv.set.createAndWearCR) @@ -12560,10 +12575,11 @@ function inv.set.createAndWearCR() local priorityName = inv.set.createAndWearPkg.priorityName or "Unknown" local level = inv.set.createAndWearPkg.level or 0 + local intensity = inv.set.createAndWearPkg.intensity or inv.set.createIntensity local endTag = inv.set.createAndWearPkg.endTag -- Create the set that we want to wear - retval = inv.set.create(priorityName, level) + retval = inv.set.create(priorityName, level, drlAsynchronous, intensity) if (retval ~= DRL_RET_SUCCESS) then dbot.warn("inv.set.createAndWearCR: failed to create set " .. priorityName .. "[" .. level .. "]: " .. dbot.retval.getString(retval)) @@ -13022,6 +13038,15 @@ function inv.set.compareCR() elseif (#idArray == 1) then objId = tonumber(idArray[1] or "") + -- If there are residual sets left over from previous analyses that are too low a level to use, we + -- whack those sets so that they don't confuse the analysis + for level = 1, (startLevel - 1) do + local priorityTable = inv.set.table[inv.set.comparePkg.priorityName] + if (priorityTable ~= nil) and (priorityTable[level] ~= nil) then + priorityTable[level] = nil + end -- if + end -- for + -- Save the previous set analysis that includes the target item so that we have something to compare local tmpAnalysis = inv.set.table[inv.set.comparePkg.priorityName] if (tmpAnalysis == nil) then @@ -13064,7 +13089,8 @@ function inv.set.compareCR() -- Analyze the priority with the item removed so that we can compare the results with what -- we had when the item was included local resultData = dbot.callback.new() - retval = inv.analyze.sets(inv.set.comparePkg.priorityName, itemLevel, resultData) + retval = inv.analyze.sets(inv.set.comparePkg.priorityName, itemLevel, + resultData, inv.set.analyzeIntensity) if (retval ~= DRL_RET_SUCCESS) then dbot.warn("inv.set.compareCR: Failed to analyze sets: " .. dbot.retval.getString(retval)) else @@ -13180,6 +13206,15 @@ function inv.set.covetCR() -- with an actual item. Probably. local objId = inv.set.covetPkg.auctionNum + -- If there are residual sets left over from previous analyses that are too low a level to use, we + -- whack those sets so that they don't confuse the analysis + for level = 1, (startLevel - 1) do + local priorityTable = inv.set.table[inv.set.covetPkg.priorityName] + if (priorityTable ~= nil) and (priorityTable[level] ~= nil) then + priorityTable[level] = nil + end -- if + end -- for + -- Save the previous set analysis that includes the target item so that we have something to compare local tmpAnalysis = inv.set.table[inv.set.covetPkg.priorityName] if (tmpAnalysis == nil) then @@ -13264,7 +13299,7 @@ function inv.set.covetCR() -- Analyze the priority with the item added so that we can compare the results with what -- we had when the item was not included local resultData = dbot.callback.new() - retval = inv.analyze.sets(inv.set.covetPkg.priorityName, itemLevel, resultData) + retval = inv.analyze.sets(inv.set.covetPkg.priorityName, itemLevel, resultData, inv.set.analyzeIntensity) if (retval ~= DRL_RET_SUCCESS) then dbot.warn("inv.set.covetCR: Failed to analyze sets: " .. dbot.retval.getString(retval)) else @@ -14278,7 +14313,7 @@ end -- inv.statBonus.trigger.get -- -- dinv analyze [list | create | delete | display] -- --- inv.analyze.sets(priorityName, minLevel, doDisplay, wearableLoc, resultData) +-- inv.analyze.sets(priorityName, minLevel, resultData, intensity) -- inv.analyze.setsCR() -- inv.analyze.delete(priorityName) -- inv.analyze.list() @@ -14291,7 +14326,7 @@ inv.analyze.setsPkg = nil inv.analyze.timeoutThreshold = 60 -function inv.analyze.sets(priorityName, minLevel, resultData) +function inv.analyze.sets(priorityName, minLevel, resultData, intensity) if (priorityName == nil) or (priorityName == "") then dbot.warn("inv.analyze.sets: missing priorityName parameter") return DRL_RET_INVALID_PARAM @@ -14312,6 +14347,7 @@ function inv.analyze.sets(priorityName, minLevel, resultData) inv.analyze.setsPkg = {} inv.analyze.setsPkg.priorityName = priorityName inv.analyze.setsPkg.minLevel = minLevel + inv.analyze.setsPkg.intensity = intensity inv.analyze.setsPkg.resultData = resultData wait.make(inv.analyze.setsCR) @@ -14371,7 +14407,8 @@ function inv.analyze.setsCR() dbot.debug("Creating analysis set for " .. inv.analyze.setsPkg.priorityName .. ", level=" .. currentLevel) inv.set.table[inv.analyze.setsPkg.priorityName][currentLevel] = nil - retval = inv.set.create(inv.analyze.setsPkg.priorityName, currentLevel, drlSynchronous) + retval = inv.set.create(inv.analyze.setsPkg.priorityName, currentLevel, + drlSynchronous, inv.analyze.setsPkg.intensity) if (retval ~= DRL_RET_SUCCESS) then dbot.warn("inv.analyze.setsCR: Failed to create \"" .. (inv.analyze.setsPkg.priorityName or "nil") .. "\" set at level " .. currentLevel .. ": " .. dbot.retval.getString(retval))