diff --git a/src/scripts/eressea.lua b/src/scripts/eressea.lua index 1e2429c4a..a322a7dc0 100644 --- a/src/scripts/eressea.lua +++ b/src/scripts/eressea.lua @@ -25,6 +25,7 @@ function run_scripts() scripts = { "spells.lua", "extensions.lua", + "write_emails.lua", "eressea/eternath.lua", "eressea/wedding-jadee.lua", "eressea/ponnuki.lua" @@ -34,26 +35,6 @@ function run_scripts() end end -function write_emails() - local locales = { "de", "en" } - local files = {} - local key - for key in locales do - local locale = locales[key] - files[locale] = io.open(basepath .. "/emails." .. locale, "w") - end - - local faction - for faction in factions() do - -- print(faction.id .. " - " .. faction.locale) - files[faction.locale]:write(faction.email .. "\n") - end - - for key in files do - files[key]:close() - end -end - function process(orders) -- initialize starting equipment for new players equipment_setitem("new_faction", "conquesttoken", "1"); diff --git a/src/scripts/wdw-run.lua b/src/scripts/wdw-run.lua index 5ca23c0a0..5613d6399 100644 --- a/src/scripts/wdw-run.lua +++ b/src/scripts/wdw-run.lua @@ -54,6 +54,7 @@ print("- Running wdw-run.lua") scripts = { "spells.lua", "extensions.lua", + "write_emails.lua", "wdw/sphinx.lua", "wdw/standings.lua" } diff --git a/src/scripts/write_emails.lua b/src/scripts/write_emails.lua new file mode 100644 index 000000000..ff1c568a2 --- /dev/null +++ b/src/scripts/write_emails.lua @@ -0,0 +1,21 @@ + +function write_emails() + local locales = { "de", "en" } + local files = {} + local key + for key in locales do + local locale = locales[key] + files[locale] = io.open(basepath .. "/emails." .. locale, "w") + end + + local faction + for faction in factions() do + -- print(faction.id .. " - " .. faction.locale) + files[faction.locale]:write(faction.email .. "\n") + end + + for key in files do + files[key]:close() + end +end +