diff options
author | orwell96 <orwell@bleipb.de> | 2018-12-19 17:25:02 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-12-19 17:25:02 +0100 |
commit | 69245c49c59e2299bdafff5884e6fbf95f027f4b (patch) | |
tree | 58c8f7281bb2ad37bd6974eb1b6e30a8d0ec75ea /main.lua | |
parent | 2ff8f5fd4649cff554cc6afab3d92ac7efedb809 (diff) | |
download | advtrains_netmapper-69245c49c59e2299bdafff5884e6fbf95f027f4b.tar.gz advtrains_netmapper-69245c49c59e2299bdafff5884e6fbf95f027f4b.tar.bz2 advtrains_netmapper-69245c49c59e2299bdafff5884e6fbf95f027f4b.zip |
Make path configurable
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ -- advtrains track map generator --- Usage:... +-- Usage: lua main.lua path/to/world -- Viewport maximum coordinate in all directions local maxc = 5000 @@ -12,6 +12,7 @@ local wimresy = 3000 -- one pixel is ... nodes local wimscale = 4 +datapath = (arg[1] or "").."/" --Constant for maximum connection value/division of the circle @@ -80,7 +81,7 @@ dofile("nodedb.lua") -- Load saves -local file, err = io.open("advtrains", "r") +local file, err = io.open(datapath.."advtrains", "r") local tbl = minetest.deserialize(file:read("*a")) if type(tbl) ~= "table" then error("not a table") @@ -96,7 +97,7 @@ file:close() -- open svg file -local svgfile = io.open("out.svg", "w") +local svgfile = io.open(datapath.."out.svg", "w") svgfile:write([[ <?xml version="1.0" standalone="no" ?> |