2003-12-16 00:20:41 +01:00
|
|
|
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
|
2003-12-16 00:20:41 +01:00
|
|
|
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()
|
2004-06-23 00:00:36 +02:00
|
|
|
plan_monsters()
|
2003-12-28 16:30:43 +01:00
|
|
|
process_orders()
|
|
|
|
outfile = "" .. get_turn()
|
2003-12-16 00:20:41 +01:00
|
|
|
|
|
|
|
-- 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
|
2003-12-16 00:20:41 +01:00
|
|
|
print("could not write game")
|
|
|
|
return -1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2004-08-08 09:45:30 +02:00
|
|
|
scripts = {
|
2004-08-08 22:24:11 +02:00
|
|
|
"spinx-initfactions.lua",
|
2004-08-08 09:45:30 +02:00
|
|
|
"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
|
2003-12-16 00:20:41 +01:00
|
|
|
|
|
|
|
--
|
|
|
|
-- main body of the script
|
|
|
|
run_wdw()
|
2004-08-08 09:45:30 +02:00
|
|
|
|