From 37fc860a637319eac7e70150c970d60123be944e Mon Sep 17 00:00:00 2001 From: CiscOH Date: Tue, 18 Jul 2023 11:23:00 +0000 Subject: [PATCH] improved dump spells formatting added line breaks, special character removal --- src/_bastion.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/_bastion.lua b/src/_bastion.lua index b64c986..d765332 100644 --- a/src/_bastion.lua +++ b/src/_bastion.lua @@ -213,9 +213,17 @@ Command:Register('dumpspells', 'Dump spells to a file', function() -- use spellName and spellSubName here local spellID = select(7, GetSpellInfo(spellName)) + local str = string.gsub(spellName, "%s+", "") + str = string.gsub(str, "'", "") + str = string.gsub(str, ":", "") + str = string.gsub(str, "-", "") + str = string.gsub(str, "!", "") + str = string.gsub(str, "%.", "") + str = string.gsub(str, ",", "") + if spellID then WriteFile('bastion-' .. UnitClass('player') .. '-' .. rand .. '.lua', - "local " .. spellName .. " = Bastion.SpellBook:GetSpell(" .. spellID .. ")", true) + "local " .. str .. " = Bastion.SpellBook:GetSpell(" .. spellID .. ")\n", true) end i = i + 1 end