Skip to content

Commit

Permalink
release/5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrozc90 committed Jul 28, 2024
1 parent 3b9a845 commit 40adca5
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Filger.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Filger_Classic.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
84 changes: 84 additions & 0 deletions docs/wowhead.lua
Original file line number Diff line number Diff line change
@@ -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 <filename>")
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)

0 comments on commit 40adca5

Please sign in to comment.