server/src/scripts/wdw-run.lua

49 lines
908 B
Lua
Raw Normal View History

function run_wdw()
2003-12-28 16:30:43 +01:00
local turnfile = "" .. get_turn()
if read_game(turnfile)~=0 then
print("could not read game")
return -1
end
2003-12-18 00:11:52 +01:00
-- run the turn (not yet)
2003-12-28 16:30:43 +01:00
read_orders(orderfile)
2004-08-08 22:24:11 +02:00
sphinx_initfactions()
sphinx_weekly()
plan_monsters()
2003-12-28 16:30:43 +01:00
process_orders()
outfile = "" .. get_turn()
-- siegbedingungen ausgeben
dofile("wdw-standings.lua")
-- write out the initial reports (no need to run a turn)
write_passwords()
write_reports()
-- write the resulting file to 'wdw-setup'
2003-12-18 00:11:52 +01:00
if write_game(outfile)~=0 then
print("could not write game")
return -1
end
end
scripts = {
2004-08-08 22:24:11 +02:00
"spinx-initfactions.lua",
"sphinx-announce.lua"
}
scriptpath = "/home/vinyambar/wdw/scripts/"
for index in scripts do
local script = scriptpath .. scripts[index]
if pcall(dofile, script)==0 then
print("Could not load " .. script)
end
end
--
-- main body of the script
run_wdw()