nav_generate.lua 862 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function string_repr(str)
    return string.format("%q", str):gsub("\\\n", "\\n")
end

local function main()
	local state = file.Read('runme.txt')
	if state == '' then
		print( "nav_generate:main: start nav_generate ..." )
		RunConsoleCommand( "nav_generate", nil )
		print( "nav_generate:main: start nav_generate ... returned" )
		print( "nav_generate:main: write state ..." )
		file.Write('runme.txt', 'ng_2')
		print( "nav_generate:main: write state ... done " )
		return
	end
	if state == 'ng_2' then
dylan grafmyre's avatar
dylan grafmyre committed
17
18
19
		print( "nav_generate:main: write state ..." )
		file.Write('runme.txt', 'ng_f')
		print( "nav_generate:main: write state ... done " )
20
21
22
		print( "nav_generate:main: manual tasks: ['quit']" )
		return
	end
dylan grafmyre's avatar
dylan grafmyre committed
23
24
	print( "nav_generate:main: unhandled state: " + string_repr(state) )
	print( "nav_generate:main: manual tasks: ['quit']" )
25
26
end
timer.Simple( 2, main )