dfhack/plugins/Dfusion/luafiles/onfunction/plugin.lua

19 lines
582 B
Lua

2011-08-19 16:12:30 -06:00
mypos=engine.getmod("functions")
function DeathMsg(values)
name=engine.peek(values.edi,ptt_dfstring)
print(name:getval().." died")
end
2011-08-19 16:12:30 -06:00
if mypos then
print("Onfunction already installed")
--onfunction.patch(0x189dd6+offsets.base())
2011-08-19 16:12:30 -06:00
else
onfunction.install()
if WINDOWS then
onfunction.AddFunction(0x55499D+offsets.base(),"Move") --on creature move found with "watch mem=xcoord"
onfunction.AddFunction(0x275933+offsets.base(),"Die") --on creature death? found by watching dead flag then stepping until new function
else
end
onfunction.SetCallback("Die",DeathMsg)
end