foundryvtt-wh4-lang-fr-fr/tools/foundry_wh4_remove_effects.lua

23 lines
557 B
Lua
Raw Normal View History

2024-04-26 10:24:20 +02:00
package.path = package.path .. ";luajson/?.lua"
local JSON = require"json"
--local talent_db = "../../WFRP4e-FoundryVTT/packs/talents.db"
local jsonfile = "../compendium/wfrp4e-core.items.json"
local jsonf = io.open(jsonfile)
local strjson = jsonf:read("*a")
jsonf:close()
local datajson = JSON.decode(strjson)
for k, v in pairs(datajson.entries) do
if v.effects then
v.effects = nil
end
end
local jsonout = JSON.encode( datajson )
local fout = io.open("../compendium/wfrp4e-core.items.json.CLEANUP", "w+")
fout:write( jsonout )
fout:close()