Added utils.lua with usefull lua utils.

develop
Warmist 2011-12-18 16:58:34 +02:00
parent e84841e94f
commit 2008ac5564
3 changed files with 3 additions and 1 deletions

@ -324,7 +324,7 @@ function findVectors()
local loc1,loc2 local loc1,loc2
loc1=engine.peekd(v+2) loc1=engine.peekd(v+2)
loc2=engine.peekd(v+8) loc2=engine.peekd(v+8)
print(string.format("%x - %x=%x",loc1,loc2,loc1-loc2)) --print(string.format("%x - %x=%x",loc1,loc2,loc1-loc2))
if(loc1-loc2==4) then if(loc1-loc2==4) then
if T[loc1-4]~=nil then if T[loc1-4]~=nil then
T[loc1-4]=T[loc1-4]+1 T[loc1-4]=T[loc1-4]+1

@ -43,6 +43,7 @@ function mainmenu(t1)
end end
end end
dofile("dfusion/common.lua") dofile("dfusion/common.lua")
dofile("dfusion/utils.lua")
unlockDF() unlockDF()
plugins={} plugins={}
table.insert(plugins,{"simple_embark","A simple embark dwarf count editor"}) table.insert(plugins,{"simple_embark","A simple embark dwarf count editor"})

@ -0,0 +1 @@
function findVectorsSized(size) local ret={} local text=GetTextRegion() for k,v in pairs(offsets.getvectors()) do if GetRegionIn2(k)~=nil then --if v>4 then local tv=engine.peek(k,ptr_vector) if tv.size() == size then print(string.format("%x is size %d",k,size)) table.insert(ret,k) end end end return ret end function findMaterial(mattype,matname) --currently only stones local tbl=BuildMaterialTable() return tbl[matname] end