type /getid [Item] to retrieve the item ID

This commit is contained in:
Horyoshi
2025-01-13 13:32:46 +01:00
committed by GitHub
parent f83b61a31f
commit c01006c93a
+24 -3
View File
@@ -1,3 +1,24 @@
-- 1) Register a new slash command /parseid
SLASH_PARSEID1 = "/getid"
-- 2) Command handler function
SlashCmdList["GETID"] = function(msg)
-- Example input might be:
-- |cffa335ee|Hitem:12345:0:0:0|h[Some Item]|h|r
-- Use string.find to capture the digits after "Hitem:"
local _, _, itemID = string.find(msg, "Hitem:(%d+)")
if itemID then
DEFAULT_CHAT_FRAME:AddMessage("Item ID is: " .. itemID)
else
DEFAULT_CHAT_FRAME:AddMessage(
"No item ID found. Make sure to shift-click an actual item link.\nReceived: " .. (msg or "nil")
)
end
end
sepgp = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceHook-2.1", "AceDB-2.0", "AceDebug-2.0", "AceEvent-2.0", "AceModuleCore-2.0", "FuBarPlugin-2.0")
sepgp:SetModuleMixins("AceDebug-2.0")
local D = AceLibrary("Dewdrop-2.0")
@@ -1402,9 +1423,9 @@ function sepgp:decay_epgp_v2() -- decays entire roster's ep and gp
self:adminSay(msg)
else
ep = math.max(0,self:num_round(ep*sepgp_decay))
GuildRosterSetPublicNote(i,ep)
gp = math.max(sepgp.VARS.basegp,self:num_round(gp*sepgp_decay))
GuildRosterSetOfficerNote(i,gp,true)
GuildRosterSetPublicNote(i,ep)
gp = math.max(sepgp.VARS.basegp,self:num_round(gp*sepgp_decay))
GuildRosterSetOfficerNote(i,gp,true)
end
end
end