diff --git a/library/lua/memscan.lua b/library/lua/memscan.lua index af2fe7435..85ed5624a 100644 --- a/library/lua/memscan.lua +++ b/library/lua/memscan.lua @@ -225,6 +225,19 @@ function get_code_segment() return MemoryArea.new(s, e) end end +function get_code_segments() + local ret={} + for i,mem in ipairs(dfhack.internal.getMemRanges()) do + if mem.read and not mem.write + and (string.match(mem.name,'/dwarfort%.exe$') + or string.match(mem.name,'/Dwarf_Fortress$') + or string.match(mem.name,'Dwarf Fortress%.exe')) + then + table.insert(ret,MemoryArea.new(mem.start_addr,mem.end_addr)) + end + end + return ret +end -- Static data segment search local function find_data_segment() diff --git a/plugins/Dfusion/luafiles/simple_embark/plugin.lua b/plugins/Dfusion/luafiles/simple_embark/plugin.lua index f4f594e8d..abc3530c2 100644 --- a/plugins/Dfusion/luafiles/simple_embark/plugin.lua +++ b/plugins/Dfusion/luafiles/simple_embark/plugin.lua @@ -12,7 +12,7 @@ function simple_embark(num) end end if not(FILE) then -print("Type in new ammount (more than 6, less than 15000):") +print("Type in new amount (more than 6, less than 15000):") repeat ans=tonumber(io.read()) if ans==nil or not(ans<=15000 and ans>0) then