forked from public/foundryvtt-wh4-lang-fr-fr
		
	Sync to v9/v5
This commit is contained in:
		
							
								
								
									
										24
									
								
								tools/foundry_convert_tables.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								tools/foundry_convert_tables.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -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] = "<b>"..row.name.."</b>:"..row.description | ||||||
|  |   results[field] = row.description | ||||||
|  |   print(field, row.name) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | local entries = JSON.encode(results) | ||||||
|  | print() | ||||||
|  | print() | ||||||
|  | print(entries) | ||||||
		Reference in New Issue
	
	Block a user