View Single Post
02-04-22, 02:52 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,891
I guess the other alternative would be to do a "scroll 'n scrape" of the actual stat rows. The entries in the "value" key will be formatted for display (like icons for gold/silver/copper etc.) so they will need to be broken down for "saving" but something like:

As above, the print() would need to be converted to a Save process.

Lua Code:
  1. SLASH_doublebrutalStats1 = "/dbs"
  2. local achievs = {}
  3. SlashCmdList.doublebrutalStats = function(msg)
  4.     if not AchievementFrame or not AchievementFrameStatsContainer:IsVisible() then
  5.         print("Can't see Achievement Frame!")
  6.         return
  7.     end
  8.     if strupper(msg) == "CLR" then
  9.         wipe(achievs)
  10.         return
  11.     end
  12.     if strupper(msg) == "PRT" then
  13.         for k, v in pairs(achievs) do
  14.             print(k, v.text, v.value)
  15.         end
  16.         return
  17.     end
  18.     local count = 0
  19.     while true do
  20.         count = count + 1
  21.         local button = _G["AchievementFrameStatsContainerButton"..count]
  22.         if not button then break end
  23.         if button.text:GetText() then
  24.             if achievs[button.id] then
  25.                 achievs[button.id].text = button.text:GetText()
  26.                 achievs[button.id].value = button.value:GetText()
  27.             else
  28.                 achievs[button.id] = { text=button.text:GetText(), value=button.value:GetText() }
  29.             end
  30.         end
  31.     end
  32. end

/dbs <scroll> /dbs to scrape the infomration from the list
/dbs prt to print the scraped information
/dbs clr to clear the scraped information
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-04-22 at 04:19 PM.
  Reply With Quote