From d7c25ce7d295847799db42c69ed27bc77196354b Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 22 Dec 2021 17:15:19 +0100 Subject: [PATCH] Sync to v9/v5 --- tools/foundry_convert_tables.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tools/foundry_convert_tables.lua diff --git a/tools/foundry_convert_tables.lua b/tools/foundry_convert_tables.lua new file mode 100644 index 0000000..d692c7b --- /dev/null +++ b/tools/foundry_convert_tables.lua @@ -0,0 +1,24 @@ + +package.path = package.path .. ";luajson/?.lua" +local JSON = require"json" + +local path_in = "../tables/spider.json" +local f1 = io.open(path_in, "r") +local strjson = f1:read("*a") +f1:close() +local tabData = JSON.decode(strjson) + +local results = {} +for idx, row in pairs(tabData.rows) do + local min = row.range[1] + local max = row.range[2] + local field = tostring(2).."-"..tostring(max) + --results[field] = ""..row.name..":"..row.description + results[field] = row.description + print(field, row.name) +end + +local entries = JSON.encode(results) +print() +print() +print(entries) \ No newline at end of file