2016-05-20 20:55:27 +02:00
|
|
|
local path = 'scripts'
|
|
|
|
if config.install then
|
|
|
|
path = config.install .. '/' .. path
|
2015-05-05 14:20:19 +02:00
|
|
|
end
|
2016-05-20 20:55:27 +02:00
|
|
|
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
|
|
|
require 'eressea'
|
|
|
|
require 'eressea.xmlconf' -- read xml data
|
2015-05-05 14:20:19 +02:00
|
|
|
|
2016-05-20 20:55:27 +02:00
|
|
|
require 'config'
|
|
|
|
auto = require 'eressea.autoseed'
|
2015-04-30 15:22:06 +02:00
|
|
|
|
2015-05-05 14:20:19 +02:00
|
|
|
local function dump_selection(sel)
|
|
|
|
local best = { score = 0, r = nil }
|
|
|
|
local r, score
|
|
|
|
for _, r in ipairs(sel) do
|
|
|
|
score = p.score(r)
|
|
|
|
if score > best.score then
|
|
|
|
best.r = r
|
|
|
|
best.score = score
|
|
|
|
end
|
|
|
|
print(score, r, r.terrain)
|
2015-04-30 15:22:06 +02:00
|
|
|
end
|
2015-05-05 14:20:19 +02:00
|
|
|
return best
|
2015-04-30 15:22:06 +02:00
|
|
|
end
|
|
|
|
|
2016-05-20 20:55:27 +02:00
|
|
|
print("read game")
|
|
|
|
eressea.read_game(get_turn() .. ".dat")
|
|
|
|
print("auto-seed")
|
|
|
|
auto.init()
|
|
|
|
print("editor")
|
|
|
|
gmtool.editor()
|