package.path = package.path .. ";luajson/?.lua" local JSON = require"json" --local talent_db = "../../WFRP4e-FoundryVTT/packs/talents.db" local traitdb ='/home/morr/.local/share/FoundryVTT/Data/modules/wfrp4e-core/packs/traits.db' local f1 = io.open(traitdb) local function trim1(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end local line = f1:read() while line do --print(line) local trait = JSON.decode( line ) if trait.effects then for _, effect in pairs(trait.effects) do if effect.flags and effect.flags.wfrp4e and effect.flags.wfrp4e.script then print( trait.name ) print( JSON.encode (trait.effects) ) print () end end end line = f1:read() end f1:close()