diff --git a/CHANGELOG.md b/CHANGELOG.md index ebeafb2..5a0dc08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.0] - 2024-07-27 + ### Changed - Complete rework diff --git a/Filger.toc b/Filger.toc index 8e82e9c..67e6a41 100644 --- a/Filger.toc +++ b/Filger.toc @@ -1,7 +1,7 @@ ## Interface: 20504, 30403, 40400, 100207, 110000 ## Author: Luaerror ## Credits: Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne, Tukz -## Version: 4.3.2 +## Version: 5.0.0 ## Title: |cffff8000Filger|r ## Notes: Minimal buff/debuff tracker ## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain diff --git a/Filger_Classic.toc b/Filger_Classic.toc index e0309ec..415faf6 100644 --- a/Filger_Classic.toc +++ b/Filger_Classic.toc @@ -1,7 +1,7 @@ ## Interface: 11503 ## Author: Luaerror ## Credits: Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne, Tukz -## Version: 4.3.2 +## Version: 5.0.0 ## Title: |cffff8000Filger - Classic|r ## Notes: Minimal buff/debuff tracker ## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain diff --git a/docs/wowhead.lua b/docs/wowhead.lua new file mode 100644 index 0000000..2764417 --- /dev/null +++ b/docs/wowhead.lua @@ -0,0 +1,84 @@ +-- Get the filename from the command line argument +local inputFilePath = arg[1] + +if not inputFilePath then + print("Usage: lua script.lua ") + return +end + +-- Define the output file path +local outputFilePath = inputFilePath:gsub("%.%w+$", "_results.txt") + +-- Function to split a string by a given delimiter +local function split(inputstr, sep) + if sep == nil then + sep = "%s" + end + local t = {} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + +-- Open the input file in read mode +local inputFile, err = io.open(inputFilePath, "r") + +-- Check if the file was opened successfully +if not inputFile then + print("Could not open input file: " .. err) + return +end + +-- Read the first line (numbers) +local numberLine = inputFile:read("*l") + +-- Read the second line (texts) +local textLine = inputFile:read("*l") + +-- Close the input file +inputFile:close() + +-- Split the lines by commas +local numbers = split(numberLine, ",") +local texts = split(textLine, ",") + +-- Create a table to store the number-text pairs +local numberTextTable = {} + +-- Populate the table +for i = 1, #numbers do + local number = tonumber(numbers[i]:match("^%s*(.-)%s*$")) + local text = texts[i]:match("^%s*(.-)%s*$") + table.insert(numberTextTable, {number = number, text = text}) +end + +-- Sort the table by text first, then by number if the texts are the same +table.sort(numberTextTable, function(a, b) + if a.text == b.text then + return a.number < b.number + else + return a.text < b.text + end +end) + +-- Open the output file in write mode +local outputFile, err = io.open(outputFilePath, "w") + +-- Check if the file was opened successfully +if not outputFile then + print("Could not open output file: " .. err) + return +end + +-- Write the table to the output file +outputFile:write("{\n") +for _, pair in ipairs(numberTextTable) do + outputFile:write(" [" .. pair.number .. "] = \"" .. pair.text .. "\",\n") +end +outputFile:write("}\n") + +-- Close the output file +outputFile:close() + +print("Table successfully written to " .. outputFilePath)