dfhack/scripts/onReportExample.lua

20 lines
455 B
Lua

local onReport = require 'plugins.onReport'
reload('plugins.onReport')
onReport.triggers.onReportExample = function(reportId)
-- print('report '..reportId..' happened!')
local report = df.report.find(reportId)
if not report then
return
end
-- printall(report)
-- print('\n')
print(reportId .. ': ' .. df.announcement_type[report["type"]])
for unitId,_ in pairs(onReport.eventToDwarf[reportId]) do
print('relevant dwarf: ' .. unitId)
end
end