improved dump spells formatting

added line breaks, special character removal
pull/6/head
CiscOH 2 years ago
parent 659720438f
commit 37fc860a63
  1. 10
      src/_bastion.lua

@ -213,9 +213,17 @@ Command:Register('dumpspells', 'Dump spells to a file', function()
-- use spellName and spellSubName here -- use spellName and spellSubName here
local spellID = select(7, GetSpellInfo(spellName)) 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 if spellID then
WriteFile('bastion-' .. UnitClass('player') .. '-' .. rand .. '.lua', WriteFile('bastion-' .. UnitClass('player') .. '-' .. rand .. '.lua',
"local " .. spellName .. " = Bastion.SpellBook:GetSpell(" .. spellID .. ")", true) "local " .. str .. " = Bastion.SpellBook:GetSpell(" .. spellID .. ")\n", true)
end end
i = i + 1 i = i + 1
end end

Loading…
Cancel
Save