Version 2.0010

1) Added "dinv priority copy [name]" and "dinv priority paste [name]"
master
Durel 7 years ago
parent 8707e8f331
commit 9a926296c0

@ -2,6 +2,13 @@
dbot.changelog = {} dbot.changelog = {}
dbot.changelog[2.0010] =
{
{ change = drlDbotChangeLogTypeNew,
desc = Added "dinv priority copy [name]" and "dinv priority paste [name]"
}
}
dbot.changelog[2.0009] = dbot.changelog[2.0009] =
{ {
{ change = drlDbotChangeLogTypeNew, { change = drlDbotChangeLogTypeNew,

@ -87,7 +87,7 @@ dbot.version : Module to track version and changelog information and update the
save_state="y" save_state="y"
date_written="2017-08-12 08:45:15" date_written="2017-08-12 08:45:15"
requires="4.98" requires="4.98"
version="2.0009" version="2.0010"
> >
<description trim="y"> <description trim="y">
<![CDATA[ <![CDATA[
@ -136,7 +136,7 @@ Usage
Equipment sets Equipment sets
dinv set [display | wear] <priority name> <level> dinv set [display | wear] <priority name> <level>
dinv snapshot [create | delete | list | display | wear] <snapshot name> dinv snapshot [create | delete | list | display | wear] <snapshot name>
dinv priority [list | display | create | clone | delete | edit | compare] <name 1> <name 2> dinv priority [list | display | create | clone | delete | edit | copy | paste | compare] <name 1> <name 2>
Equipment analysis Equipment analysis
dinv analyze [list | create | delete | display] <priority name> <positions> dinv analyze [list | create | delete | display] <priority name> <positions>
@ -536,7 +536,7 @@ Feature Wishlist
<alias <alias
script="inv.cli.priority.fn" script="inv.cli.priority.fn"
match="^[ ]*dinv[ ]+priority[ ]+(list|display|create|delete|clone|compare)([ ]+[^ ]+)?([ ]+[^ ]+)?[ ]*$" match="^[ ]*dinv[ ]+priority[ ]+(list|display|create|delete|clone|compare|copy|paste)([ ]+[^ ]+)?([ ]+[^ ]+)?[ ]*$"
enabled="y" enabled="y"
regexp="y" regexp="y"
send_to="12" send_to="12"
@ -546,7 +546,7 @@ Feature Wishlist
<alias <alias
script="inv.cli.priority.fn2" script="inv.cli.priority.fn2"
match="^[ ]*dinv[ ]+priority[ ]+(edit|split|join)([ ]+[^ ]+)?([ ]+[^ ]+)?[ ]*$" match="^[ ]*dinv[ ]+priority[ ]+(edit)([ ]+[^ ]+)?([ ]+[^ ]+)?[ ]*$"
enabled="y" enabled="y"
regexp="y" regexp="y"
send_to="12" send_to="12"
@ -2405,6 +2405,12 @@ function inv.cli.priority.fn(name, line, wildcards)
elseif (command == "clone") then elseif (command == "clone") then
inv.priority.clone(priorityName1, priorityName2, line) inv.priority.clone(priorityName1, priorityName2, line)
elseif (command == "copy") then
inv.priority.copy(priorityName1, line)
elseif (command == "paste") then
inv.priority.paste(priorityName1, line)
else else
inv.cli.priority.usage() inv.cli.priority.usage()
return inv.tags.stop(invTagsPriority, line, DRL_RET_INVALID_PARAM) return inv.tags.stop(invTagsPriority, line, DRL_RET_INVALID_PARAM)
@ -2457,7 +2463,7 @@ end -- inv.cli.priority.fn2
function inv.cli.priority.usage() function inv.cli.priority.usage()
dbot.print("@W " .. pluginNameCmd .. dbot.print("@W " .. pluginNameCmd ..
" priority @G[list | display | create | clone | delete | edit | compare] " .. " priority @G[list | display | create | clone | delete | edit | copy | paste | compare] " ..
"@Y<name 1> <name 2>@w") "@Y<name 1> <name 2>@w")
end -- inv.cli.priority.usage end -- inv.cli.priority.usage
@ -2584,7 +2590,22 @@ Examples:
mode on a large priority, you may need to resize your edit window to see everything. mode on a large priority, you may need to resize your edit window to see everything.
"@Gdinv priority edit mage full@W" "@Gdinv priority edit mage full@W"
8) Compare the stat differences at all levels for the equipment sets generated by two different 8) Use an external editor to modify a priority. You can copy the priority data to the system
clipboard to make it easy to transfer the priority to your own editor.
"@Gdinv priority copy psi-melee@W"
9) Paste priority data from the system clipboard and use that data to either create a new
priority (if it doesn't exist yet) or update an existing priority. This is convenient if you
used an external editor to modify the priority data and you want to import that data back into
the plugin.
"@Gdinv priority paste myThief@W"
10) Copy/paste a priority to make a duplicate. Yes, this is essentially the "@Cclone@W" mode,
but it shows off what you can do with "@Ccopy@W" and "@Cpaste@W".
"@Gdinv priority copy mage@W"
"@Gdinv priority paste myMage@W"
11) Compare the stat differences at all levels for the equipment sets generated by two different
priorities. This will generate a big report that I didn't include here because this helpfile priorities. This will generate a big report that I didn't include here because this helpfile
is already enormous :) If you have not already performed a full analysis of both priorities is already enormous :) If you have not already performed a full analysis of both priorities
you will be prompted to do so before the comparison can execute. The output shown below is you will be prompted to do so before the comparison can execute. The output shown below is
@ -10259,8 +10280,9 @@ end -- inv.cache.clearOld
-- inv.priority.display(priorityName, endTag) -- inv.priority.display(priorityName, endTag)
-- --
-- inv.priority.edit(priorityName, useAllFields, isQuiet, endTag) -- inv.priority.edit(priorityName, useAllFields, isQuiet, endTag)
-- inv.priority.split(priorityName, level, endTag) -- inv.priority.update(priorityName, priorityString, isQuiet)
-- inv.priority.join(priorityName, level, endTag) -- inv.priority.copy(priorityName, endTag)
-- inv.priority.paste(priorityName, endTag)
-- --
-- inv.priority.compare(priorityName1, priorityName2, endTag) -- inv.priority.compare(priorityName1, priorityName2, endTag)
-- --
@ -10521,7 +10543,7 @@ end -- inv.priority.display
function inv.priority.edit(priorityName, useAllFields, isQuiet, endTag) function inv.priority.edit(priorityName, useAllFields, isQuiet, endTag)
local retval = DRL_RET_SUCCESS local retval = DRL_RET_SUCCESS
local priorityEntry, priorityString = nil, "" local priorityString = ""
if (priorityName == nil) or (priorityName == "") then if (priorityName == nil) or (priorityName == "") then
dbot.warn("inv.priority.edit: priority name is missing!") dbot.warn("inv.priority.edit: priority name is missing!")
@ -10573,22 +10595,7 @@ The first column lists the names of each available priority field. Subsequent c
break break
else else
priorityEntry, retval = inv.priority.stringToTable(priorityString) retval = inv.priority.update(priorityName, priorityString, isQuiet)
if (retval ~= DRL_RET_SUCCESS) then
dbot.debug("inv.priority.edit: Failed to convert priority string into priority: " ..
dbot.retval.getString(retval))
else
inv.priority.table[priorityName] = priorityEntry
if (not isQuiet) then
dbot.info("Updated priority \"@C" .. priorityName .. "@W\"")
end -- if
inv.priority.save()
-- Invalidate any previous equipment set analyzis based on this priority
inv.set.table[priorityName] = nil
inv.set.save()
end -- if
end -- if end -- if
until (retval == DRL_RET_SUCCESS) until (retval == DRL_RET_SUCCESS)
@ -10596,22 +10603,97 @@ The first column lists the names of each available priority field. Subsequent c
end -- inv.priority.edit end -- inv.priority.edit
function inv.priority.split(priorityName, level, endTag) function inv.priority.update(priorityName, priorityString, isQuiet)
local retval = DRL_RET_SUCCESS
if (priorityName == nil) or (priorityName == "") then
dbot.warn("inv.priority.update: Missing priority name parameter")
return DRL_RET_INVALID_PARAM
end -- if
if (priorityString == nil) or (priorityString == "") then
dbot.warn("inv.priority.update: Missing priority string parameter")
return DRL_RET_INVALID_PARAM
end -- if
local priorityEntry, retval = inv.priority.stringToTable(priorityString)
if (retval ~= DRL_RET_SUCCESS) then
dbot.debug("inv.priority.update: Failed to convert priority string into priority: " ..
dbot.retval.getString(retval))
else
inv.priority.table[priorityName] = priorityEntry
if (not isQuiet) then
dbot.info("Updated priority \"@C" .. priorityName .. "@W\"")
end -- if
inv.priority.save()
-- Invalidate any previous equipment set analyzis based on this priority
inv.set.table[priorityName] = nil
inv.set.save()
end -- if
dbot.note("FIXME: split -- do we want/need this?") return retval
end -- inv.priority.update
function inv.priority.copy(priorityName, endTag)
if (priorityName == nil) or (priorityName == "") then
dbot.warn("inv.priority.copy: Missing priority name parameter")
return inv.tags.stop(invTagsPriority, endTag, DRL_RET_INVALID_PARAM)
end -- if
if (inv.priority.table[priorityName] == nil) then
dbot.warn("inv.priority.copy: priority \"@C" .. priorityName .. "@W\" does not exist")
return inv.tags.stop(invTagsPriority, endTag, DRL_RET_MISSING_ENTRY)
end -- if
-- Get a string representation of the priority we want to copy
local priorityString, retval = inv.priority.tableToString(inv.priority.table[priorityName],
true, false, true)
if (retval ~= DRL_RET_SUCCESS) then
dbot.warn("inv.priority.copy: Failed to get string representation of priority \"@C" ..
priorityName .. "@W\": " .. dbot.retval.getString(retval))
else
SetClipboard(priorityString)
dbot.info("Copied priority \"@C" .. priorityName .. "@W\" to clipboard")
end -- if
return inv.tags.stop(invTagsPriority, endTag, retval) return inv.tags.stop(invTagsPriority, endTag, retval)
end -- inv.priority.split end -- inv.priority.copy
function inv.priority.join(priorityName, level, endTag) function inv.priority.paste(priorityName, endTag)
local retval = DRL_RET_SUCCESS local retval = DRL_RET_SUCCESS
local operation
dbot.note("FIXME: join -- do we want/need this?") if (priorityName == nil) or (priorityName == "") then
dbot.warn("inv.priority.paste: Missing priority name parameter")
return inv.tags.stop(invTagsPriority, endTag, DRL_RET_INVALID_PARAM)
end -- if
if (inv.priority.table[priorityName] == nil) then
operation = "Created"
else
operation = "Updated"
end -- if
local priorityString = GetClipboard()
if (priorityString == nil) or (priorityString == "") then
dbot.warn("inv.priority.paste: Failed to get priority from clipboard")
return inv.tags.stop(invTagsPriority, endTag, DRL_RET_MISSING_ENTRY)
end -- if
retval = inv.priority.update(priorityName, priorityString, true)
if (retval ~= DRL_RET_SUCCESS) then
dbot.warn("inv.priority.paste: Failed to update priority from clipboard data: " ..
dbot.retval.getString(retval))
else
dbot.info(operation .. " priority \"@C" .. priorityName .. "@W\" from clipboard data")
end -- if
return inv.tags.stop(invTagsPriority, endTag, retval) return inv.tags.stop(invTagsPriority, endTag, retval)
end -- inv.priority.join end -- inv.priority.paste
function inv.priority.compare(priorityName1, priorityName2, endTag) function inv.priority.compare(priorityName1, priorityName2, endTag)

Loading…
Cancel
Save