¡Hola a todos los aventureros de UltimoWoW!
Quiero compartir con ustedes un pequeño addon ligero que he desarrollado para facilitarnos la vida a la hora de revisar y compartir nuestro equipo: **Export Shinka**.
### ¿Cuál es su propósito?
Muchos de nosotros jugamos en equipos modestos o necesitamos compartir nuestros sets de equipo rápidamente para pedir consejos, planificar incursiones o mostrarlos en comunidades y canales de Discord. Como los scripts de interfaz tienen prohibido escribir archivos `.txt` directamente en el disco duro por seguridad, **Export Shinka** soluciona este problema generando una ventana emergente limpia dentro del juego con todo tu inventario listo para copiar y pegar con un simple `Ctrl+C`.
### ¿Cómo funciona?
1. **Clasificación Automática:** Al escribir el comando en el chat, el addon escanea tus ranuras de equipo y separa de forma inteligente las piezas de **PvE** y **PvP** (detectando automáticamente estadísticas clave como el Temple / *Resilience*).
2. **Interfaz Cómoda:** Abre una ventana emergente con un cuadro de texto editable que se selecciona automáticamente en cuanto aparece, evitando saturar el chat general.
### Comandos
* `/exportgear` — Abre la ventana emergente con el listado completo y clasificado de tu equipo actual junto a su nivel de objeto (ilvl).
---
### Código del Addon (ExportGear.lua)
Crea una carpeta llamada `ExportGear` en tu directorio de addons (`Interface\AddOns\ExportGear`) y dentro coloca un archivo llamado `ExportGear.toc` con esto:
```toc
## Interface: 30300
## Title: Export Shinka
## Notes: Exporta y clasifica el equipo actual en PvE y PvP de forma limpia.
## Author: TuNombre
## Version: 1.0
ExportGear.lua
Luego se debe crear el el archivo llamaddo `ExportGear.Lua` que debe contener esto:
local frame = CreateFrame("Frame")
frame:RegisterEvent("ADDON_LOADED")
ExportGearDB = ExportGearDB or {}
local slots = {
"HeadSlot", "NeckSlot", "ShoulderSlot", "BackSlot", "ChestSlot",
"WristSlot", "HandsSlot", "WaistSlot", "LegsSlot", "FeetSlot",
"Finger0Slot", "Finger1Slot", "Trinket0Slot", "Trinket1Slot",
"MainHandSlot", "SecondaryHandSlot", "RangedSlot"
}
-- Tooltip oculto para escanear el Temple / PvP
local scanTooltip = CreateFrame("GameTooltip", "ExportGearScanTooltip", nil, "GameTooltipTemplate")
scanTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
local function IsPvpItem(itemLink)
scanTooltip:ClearLines()
scanTooltip:SetHyperlink(itemLink)
for i = 1, scanTooltip:NumLines() do
local lineText = _G["ExportGearScanTooltipTextLeft" .. i]:GetText()
if lineText then
if string.find(string.lower(lineText), "temple") or string.find(string.lower(lineText), "resilience") then
return true
end
end
end
return false
end
-- Ventana emergente (Popup)
local editBoxFrame = CreateFrame("Frame", "ExportGearPopup", UIParent)
editBoxFrame:SetSize(450, 350)
editBoxFrame:SetPoint("CENTER")
editBoxFrame:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true, tileSize = 32, edgeSize = 32,
insets = { left = 11, right = 12, top = 12, bottom = 11 }
})
editBoxFrame:Hide()
local scrollArea = CreateFrame("ScrollFrame", "ExportGearScroll", editBoxFrame, "UIPanelScrollFrameTemplate")
scrollArea:SetPoint("TOPLEFT", editBoxFrame, "TOPLEFT", 15, -30)
scrollArea:SetPoint("BOTTOMRIGHT", editBoxFrame, "BOTTOMRIGHT", -30, 40)
local editBox = CreateFrame("EditBox", "ExportGearEditBox", scrollArea)
editBox:SetMultiLine(true)
editBox:SetMaxLetters(99999)
editBox:SetFontObject(ChatFontNormal)
editBox:SetWidth(390)
editBox:SetHeight(270)
scrollArea:SetScrollChild(editBox)
editBox:SetScript("OnEscapePressed", function() editBoxFrame:Hide() end)
local closeButton = CreateFrame("Button", nil, editBoxFrame, "UIPanelButtonTemplate")
closeButton:SetSize(80, 22)
closeButton:SetPoint("BOTTOM", editBoxFrame, "BOTTOM", 0, 15)
closeButton:SetText("Cerrar")
closeButton:SetScript("OnClick", function() editBoxFrame:Hide() end)
SLASH_EXPORTGEAR1 = "/exportgear"
SlashCmdList["EXPORTGEAR"] = function(msg)
local pveList = "=== [Equipo PvE] ===\n"
local pvpList = "=== [Equipo PvP] ===\n"
for _, slotName in ipairs(slots) do
local slotId = GetInventorySlotInfo(slotName)
local itemLink = GetInventoryItemLink("player", slotId)
if itemLink then
local itemName, _, _, itemLevel = GetItemInfo(itemLink)
local line = slotName .. ": " .. (itemName or "Desconocido") .. " (ilvl: " .. tostring(itemLevel) .. ")\n"
if IsPvpItem(itemLink) then
pvpList = pvpList .. line
else
pveList = pveList .. line
end
end
end
local finalResult = "--- [Team Shinka] Clasificación de Set ---\n\n" .. pveList .. "\n" .. pvpList .. "\n---------------------------------------------"
editBox:SetText(finalResult)
editBox:HighlightText()
editBox:SetFocus()
editBoxFrame:Show()
end