<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dwarffortresswiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Warmist</id>
	<title>Dwarf Fortress Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://dwarffortresswiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Warmist"/>
	<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php/Special:Contributions/Warmist"/>
	<updated>2026-05-19T04:31:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.11</generator>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=198777</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=198777"/>
		<updated>2014-04-21T08:50:57Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Add a outdated warning.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WARNING: this page is very outdated. &lt;br /&gt;
== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
&lt;br /&gt;
Note: You may see the following error when running dfusion in DFHack: &amp;quot;dfusion/common.lua:45: . Text region not found!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You just have to do an easy text change to fix it.  Find this line in DF/dfusion/common.lua (it's near the top):&lt;br /&gt;
local pos=string.find(v.name,&amp;quot;.text&amp;quot;) or string.find(v.name,&amp;quot;libs/Dwarf_Fortress&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then, replace &amp;quot;.text&amp;quot; with &amp;quot;Dwarf Fortress.exe&amp;quot; and save.&lt;br /&gt;
&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
Up-to-date api help could be found here: https://github.com/peterix/dfhack/blob/master/LUA_API.rst&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags1.dead=true --is same as...&lt;br /&gt;
first_unit.flags1[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For convienence there is function printall:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
printall(df.global.world.units.all) --prints all the units, with locations in memory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| pokestr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
&lt;br /&gt;
Individual units can be modified - skills, jobs, attributes, etc. This example selects a unit under the look cursor, updates the name and updates the level and experience for selected skills. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--Takes a selected unit and instantly turns them into Morul - upgrading all appropriate skills to Legendary or higher, as appropriate&lt;br /&gt;
--By Martin, 5/25/2012, excerpt for demonstration purposes&lt;br /&gt;
--This code gets cut/pasted at the end of /dfusion/tools/init.lua&lt;br /&gt;
function tools.morul(unit)&lt;br /&gt;
  --include the utils library which we need later&lt;br /&gt;
  utils = require 'utils'&lt;br /&gt;
  --a unit address can be passed into this function, handle the case where one isn't&lt;br /&gt;
  if unit==nil then&lt;br /&gt;
    unit=getCreatureAtPointer()  --place the x pointer on top of the creature you want to change. best use is the look pointer 'k' and not 'v'&lt;br /&gt;
  end&lt;br /&gt;
  --Set the name. Surname is comprised of an array of references [words] into the language file. Each entry grabs a word fragment and the name is all of these catenated &lt;br /&gt;
  unit.name.first_name = &amp;quot;Morul&amp;quot;&lt;br /&gt;
  unit.name.words[0] = 1416  --[T_WORD:CHANNEL:catten]&lt;br /&gt;
  unit.name.words[1] = 1304  --[T_WORD:BEND:mat]&lt;br /&gt;
&lt;br /&gt;
  --skill level we wish to apply to all labors. Dabbling is 0, Legendary is 15&lt;br /&gt;
  labor_rating = 15&lt;br /&gt;
  --the skill level we wish to apply to all military skills. &lt;br /&gt;
  military_rating = 70&lt;br /&gt;
  &lt;br /&gt;
  --These are the skill ids we want to add. The ids were identified in game_data.ini in DwarfTherapist.&lt;br /&gt;
  skill = { 0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,54,55,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,95,96,97,98,99,100,101,102,103,104,105,109,110,111,112,113,114,115 }&lt;br /&gt;
  --These are the military skills that will get higher values. Subset of the list above.&lt;br /&gt;
  military = { 38,39,41,42,43,44,45,46,54,99,100,101,102,103,104,105 }&lt;br /&gt;
&lt;br /&gt;
  --ipairs iterates over each indexed item in the skill list. Lua index is 1 based, so remember that.&lt;br /&gt;
  for sk,sv in ipairs(skill) do&lt;br /&gt;
    --assume the labor rating will apply&lt;br /&gt;
    new_rating = labor_rating&lt;br /&gt;
    --iterate over the military list&lt;br /&gt;
    for _,v in ipairs(military) do&lt;br /&gt;
      --if the value from the skill list iteration is in the military list...&lt;br /&gt;
      if v == sv then&lt;br /&gt;
        --then use the military skill level&lt;br /&gt;
        new_rating = military_rating&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    --the skills need to be inserted in a particular way. This standard function passes the id, the skill level, and the experience value, and tells the tool to keep the skills sorted by id. &lt;br /&gt;
    --the experience calculation reflects the minimum experience to earn the level and allows skills to continue to advance.&lt;br /&gt;
    utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = sv, rating = new_rating, experience = (new_rating * 500) + (new_rating * (new_rating - 1)) * 50}, 'id')&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  -- walk over each of the skills we just set and print them out so we can confirm each update&lt;br /&gt;
  for sk,sv in ipairs(unit.status.current_soul.skills) do&lt;br /&gt;
    -- print the skill data. Printall will print entire tables and is handy at poking at the data structures&lt;br /&gt;
    printall(sv)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--add the function above to the dfusion menu system as a submenu under the 'Tools' menu.&lt;br /&gt;
tools.menu:add(&amp;quot;Morul&amp;quot;,tools.morul)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfuse'' and then use run ''lua''&lt;br /&gt;
* You can bind keys to lua commands (in dfusion context) like this: ''keybindings add Shift-R &amp;quot;dfuse adv_tools.reincarnate()&amp;quot;''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169649</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169649"/>
		<updated>2012-04-09T18:39:50Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Exported functions and objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
Up-to-date api help could be found here: https://github.com/peterix/dfhack/blob/master/LUA_API.rst&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags.dead=true --is same as...&lt;br /&gt;
first_unit.flags[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For convienence there is function printall:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
printall(df.global.world.units.all) --prints all the units, with locations in memory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
&lt;br /&gt;
...TODO...&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfuse'' and then use run ''lua''&lt;br /&gt;
* You can bind keys to lua commands (in dfusion context) like this: ''keybindings add Shift-R &amp;quot;dfuse adv_tools.reincarnate()&amp;quot;''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169427</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169427"/>
		<updated>2012-04-05T09:33:58Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Tips and Tricks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is also useful to get what fields are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global) do --any object can be instead of df.global&lt;br /&gt;
   print(k)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags.dead=true --is same as...&lt;br /&gt;
first_unit.flags[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
&lt;br /&gt;
...TODO...&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfuse'' and then use run ''lua''&lt;br /&gt;
* You can bind keys to lua commands (in dfusion context) like this: ''keybindings add Shift-R &amp;quot;dfuse adv_tools.reincarnate()&amp;quot;''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169426</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=169426"/>
		<updated>2012-04-05T09:32:32Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* How to */  Removed onfunction as that is gone...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is also useful to get what fields are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global) do --any object can be instead of df.global&lt;br /&gt;
   print(k)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags.dead=true --is same as...&lt;br /&gt;
first_unit.flags[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
&lt;br /&gt;
...TODO...&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=168959</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=168959"/>
		<updated>2012-03-31T08:03:45Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is also useful to get what fields are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global) do --any object can be instead of df.global&lt;br /&gt;
   print(k)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags.dead=true --is same as...&lt;br /&gt;
first_unit.flags[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=168958</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=168958"/>
		<updated>2012-03-31T08:03:24Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Exported functions and objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
The DF is accessed by object 'df'. This object holds all the types, globals table and some helper functions.&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit=df.global.world.units.all[0] --gets first unit&lt;br /&gt;
first_unit.name.first_name=&amp;quot;Urist&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can iterate in all the objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global.world.units.all) do --gets ALL the units&lt;br /&gt;
   v.name.first_name=&amp;quot;Urist&amp;quot; --now everyone will be called URIST!!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is also useful to get what fields are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for k,v in pairs(df.global) do --any object can be instead of df.global&lt;br /&gt;
   print(k)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also all the flags can be accessed by name or by number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
first_unit.flags.dead=true --is same as...&lt;br /&gt;
first_unit.flags[1]=true --... this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Other objects ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167566</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167566"/>
		<updated>2012-03-18T00:22:51Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also dfuse/dfusion runs an init script located at 'save directory/dfusion/init.lua'. And 'initcustom.lua' if it exists&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Df memory object ===&lt;br /&gt;
In the new version there is a table called &amp;quot;df&amp;quot;. It holds all the global objects of DF. To get list of fields available use 'printGlobals()'.&lt;br /&gt;
There are also helper functions 'printFields(object)' and 'addressOf(object,[field])'&lt;br /&gt;
Using new df object is very simple:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- to get&lt;br /&gt;
print(df.window_x)&lt;br /&gt;
-- to set&lt;br /&gt;
df.window_x=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some objects returned are more complex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--most complex object (afaik)&lt;br /&gt;
printFields(df.world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At first it will be confusing, but worry not, there is a tool (dfusion-&amp;gt;editor) that lets you edit df without writing lua code.&lt;br /&gt;
&lt;br /&gt;
Some notes:&lt;br /&gt;
Sometimes returned object is a pointer, than you need to dereference it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- this gets first unit, but it's a pointer, so dereference it&lt;br /&gt;
df.world.units.all[0]:deref().pos.x=0&lt;br /&gt;
-- also as you can see 'all' is a vector (or an array) so you can access it's members by numbers. This works on flags too.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167565</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167565"/>
		<updated>2012-03-18T00:20:46Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers four DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Df memory object ===&lt;br /&gt;
In the new version there is a table called &amp;quot;df&amp;quot;. It holds all the global objects of DF. To get list of fields available use 'printGlobals()'.&lt;br /&gt;
There are also helper functions 'printFields(object)' and 'addressOf(object,[field])'&lt;br /&gt;
Using new df object is very simple:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- to get&lt;br /&gt;
print(df.window_x)&lt;br /&gt;
-- to set&lt;br /&gt;
df.window_x=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some objects returned are more complex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--most complex object (afaik)&lt;br /&gt;
printFields(df.world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At first it will be confusing, but worry not, there is a tool (dfusion-&amp;gt;editor) that lets you edit df without writing lua code.&lt;br /&gt;
&lt;br /&gt;
Some notes:&lt;br /&gt;
Sometimes returned object is a pointer, than you need to dereference it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- this gets first unit, but it's a pointer, so dereference it&lt;br /&gt;
df.world.units.all[0]:deref().pos.x=0&lt;br /&gt;
-- also as you can see 'all' is a vector (or an array) so you can access it's members by numbers. This works on flags too.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167564</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167564"/>
		<updated>2012-03-18T00:15:43Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Exported functions and objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Df memory object ===&lt;br /&gt;
In the new version there is a table called &amp;quot;df&amp;quot;. It holds all the global objects of DF. To get list of fields available use 'printGlobals()'.&lt;br /&gt;
There are also helper functions 'printFields(object)' and 'addressOf(object,[field])'&lt;br /&gt;
Using new df object is very simple:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- to get&lt;br /&gt;
print(df.window_x)&lt;br /&gt;
-- to set&lt;br /&gt;
df.window_x=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some objects returned are more complex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--most complex object (afaik)&lt;br /&gt;
printFields(df.world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At first it will be confusing, but worry not, there is a tool (dfusion-&amp;gt;editor) that lets you edit df without writing lua code.&lt;br /&gt;
&lt;br /&gt;
Some notes:&lt;br /&gt;
Sometimes returned object is a pointer, than you need to dereference it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- this gets first unit, but it's a pointer, so dereference it&lt;br /&gt;
df.world.units.all[0]:deref().pos.x=0&lt;br /&gt;
-- also as you can see 'all' is a vector (or an array) so you can access it's members by numbers. This works on flags too.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167563</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167563"/>
		<updated>2012-03-18T00:09:17Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Exported functions and objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Df memory object ===&lt;br /&gt;
In the new version there is a table called &amp;quot;df&amp;quot;. It holds all the global objects of DF. To get list of fields available use 'printGlobals()'.&lt;br /&gt;
&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167562</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=167562"/>
		<updated>2012-03-18T00:06:00Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Exported functions and objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion', 'dfuse' and 'lua', 'runlua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== runlua ===&lt;br /&gt;
Similar to ''lua &amp;lt;filename&amp;gt;'' but not interactive, to be used with hotkeys&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
=== dfuse ===&lt;br /&gt;
Similar to dfusion but not interactive. To be used with hotkeys (later will have command support).&lt;br /&gt;
&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
DEPRECATED use types[&amp;lt;tname&amp;gt;] or directly df.&amp;lt;subitem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=159310</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=159310"/>
		<updated>2012-01-07T22:28:34Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* engine. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
These functions are sown into dfhack or modifies DF directly&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== OffsetGroup: ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| peek(b\w\d)&lt;br /&gt;
| reads byte\word\double word from memory&lt;br /&gt;
| peekb(0x15486)&lt;br /&gt;
|-&lt;br /&gt;
| peekarb&lt;br /&gt;
| reads a chunk of memory&lt;br /&gt;
| peekarb(0x15486,100) -- reads 100 bytes from 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| peekstr&lt;br /&gt;
| reads a string from memory&lt;br /&gt;
| peekstr(0x15486) &lt;br /&gt;
|-&lt;br /&gt;
| poke(b\w\d)&lt;br /&gt;
| writes byte\word\double word to memory&lt;br /&gt;
| peekb(0x15486,100)&lt;br /&gt;
|-&lt;br /&gt;
| pokearb&lt;br /&gt;
| writes a chunk of memory (gotten with peekarb)&lt;br /&gt;
| pokearb(0x15486,data,100) -- writes 100 bytes from data to 0x15486&lt;br /&gt;
|-&lt;br /&gt;
| pokestr&lt;br /&gt;
| writes a string to memory&lt;br /&gt;
| peekstr(0x15486,&amp;quot;Hello world&amp;quot;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FunctionCall.====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| call(f_ptr,calling_convention,arguments...)&lt;br /&gt;
| calls a function from df. Supports up to 7 arguments. Danger: this could (and probably will) crash df if used incorrectly.&lt;br /&gt;
| FunctionCall.call(somepointertofunction,FunctionCall.THIS_CALL,thisptr)&lt;br /&gt;
|-&lt;br /&gt;
| THIS_CALL&lt;br /&gt;
| a numeric constant for function calling convention. &lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| STD_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| FAST_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| CDECL_CALL&lt;br /&gt;
| -&amp;quot;-&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
See patterns.lua and itempatters.lua. This will be refactored in the future to use Memory.xml (thus be version and Os independent).&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153121</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153121"/>
		<updated>2011-09-17T16:13:04Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Dfhack/DF interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
==== Process. ====&lt;br /&gt;
==== VersionInfo. ====&lt;br /&gt;
==== OffsetGroup: ====&lt;br /&gt;
==== engine. ====&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
See patterns.lua and itempatters.lua. This will be refactored in the future to use Memory.xml (thus be version and Os independent).&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153120</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153120"/>
		<updated>2011-09-17T16:08:39Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Added console exports&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== Exported functions and objects ==&lt;br /&gt;
Objects differ from functions by calling convention ( using '':'' instead of '.'). Also most of the functions are grouped.&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
==== Console. ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! name&lt;br /&gt;
! description&lt;br /&gt;
! example&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| prints a message to dfhack console&lt;br /&gt;
| Console.print(&amp;quot;Hello world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| printerr&lt;br /&gt;
| prints an error message to dfhack console&lt;br /&gt;
| Console.printerr(&amp;quot;Error  world!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| clear&lt;br /&gt;
| clears console&lt;br /&gt;
| Console.clear()&lt;br /&gt;
|-&lt;br /&gt;
| color&lt;br /&gt;
| sets text color&lt;br /&gt;
| Console.color(2)&lt;br /&gt;
|-&lt;br /&gt;
| reset_color&lt;br /&gt;
| resets text color to defaults&lt;br /&gt;
| Console.reset_color()&lt;br /&gt;
|-&lt;br /&gt;
| cursor&lt;br /&gt;
| sets if the cursor should be visible&lt;br /&gt;
| Console.cursor(true)&lt;br /&gt;
|-&lt;br /&gt;
| msleep&lt;br /&gt;
| waits for x milliseconds &lt;br /&gt;
| Console.msleep(200)&lt;br /&gt;
|-&lt;br /&gt;
| get_columns&lt;br /&gt;
| returns number of columns in the console&lt;br /&gt;
| Console.get_columns()&lt;br /&gt;
|-&lt;br /&gt;
| get_rows&lt;br /&gt;
| returns number of rows in the console&lt;br /&gt;
| Console.get_rows()&lt;br /&gt;
|-&lt;br /&gt;
| lineedit&lt;br /&gt;
| asks user for input&lt;br /&gt;
| Console.lineedit(&amp;quot;Type in your name:&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
See patterns.lua and itempatters.lua. This will be refactored in the future to use Memory.xml (thus be version and Os independent).&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153119</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153119"/>
		<updated>2011-09-17T15:59:36Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Added exported functions section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
=== Dfhack/DF interface ===&lt;br /&gt;
&lt;br /&gt;
=== From scripts ===&lt;br /&gt;
These commands are exported from script files. Most of them are in &amp;quot;common.lua&amp;quot; file.&lt;br /&gt;
=== Patterns ===&lt;br /&gt;
See patterns.lua and itempatters.lua. This will be refactored in the future to use Memory.xml (thus be version and Os independent).&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153118</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153118"/>
		<updated>2011-09-17T15:56:08Z</updated>

		<summary type="html">&lt;p&gt;Warmist: added tips and trics section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
* To use dfusion's functionality in lua first run ''dfusion'' (exit it with 'q') and then use run ''lua''&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153117</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153117"/>
		<updated>2011-09-17T15:46:52Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* OnFunction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return address. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name). Then print it to the console.&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153116</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153116"/>
		<updated>2011-09-17T15:45:53Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* OnFunction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by ''onfunction.SetCallback(name,function)''. For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return value. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name).&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153115</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153115"/>
		<updated>2011-09-17T15:39:04Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* DFusion info page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== DFusion info page ==&lt;br /&gt;
Thread for discussions: [http://www.bay12forums.com/smf/index.php?topic=93317.0 Thread]&lt;br /&gt;
== Usage ==&lt;br /&gt;
Dfusion plugin offers two DFhack commands: 'dfusion' and 'lua'.&lt;br /&gt;
=== lua ===&lt;br /&gt;
Runs an interactive lua console. For more on lua commands see [http://www.lua.org/manual/5.1/manual.html Lua reference manual] or google &amp;quot;lua&amp;quot;. Also this command could be ran with filepath as an argument. Then it runs that file as a lua script file. E.g. ''lua dfusion/temp.lua'' runs a file  &amp;lt;your df path&amp;gt;/dfusion/temp.lua.&lt;br /&gt;
=== dfusion ===&lt;br /&gt;
First this command runs all plugins' init.lua part then show a menu. Type number to run specified plugin.&lt;br /&gt;
== How to ==&lt;br /&gt;
This section explains in detail some of more complex things that could be done with dfusion.&lt;br /&gt;
=== OnFunction ===&lt;br /&gt;
There are two parts to OnFunction: adding new triggers and using already existing triggers. To add new trigger you must know exact location of function call (and what it does) also it would help a lot if you know what registers correspond to what data. Usually this could be worked out by analysing call stack after setting a data breakpoint (watch in GDB) and then guessing what does what. &lt;br /&gt;
Using already existing triggers is way simpler. Adding a callback (a function to be called when a trigger is encountered) is done by onfunction.SetCallback(name,function). For possible names see locations.lua (at the time of writing there is &amp;quot;Move&amp;quot; and &amp;quot;Die&amp;quot; both in Linux and Windows). Possible use of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function DeathMsg(values)&lt;br /&gt;
	local name&lt;br /&gt;
	name=engine.peek(values[onfunction.hints[&amp;quot;Die&amp;quot;].creature],ptt_dfstring)&lt;br /&gt;
	print(name:getval()..&amp;quot; died&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
onfunction.SetCallback(&amp;quot;Die&amp;quot;,DeathMsg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example we bind 'DeathMsg' function to &amp;quot;Die&amp;quot; trigger. Values argument has all the registers and a return value. So we lookup from witch register do we need to read the creature pointer ( ''values[onfunction.hints[&amp;quot;Die&amp;quot;].creature'' ) and read a string just from the beginning (usually the creature starts with his name).&lt;br /&gt;
&lt;br /&gt;
Note: there can be only one callback per trigger. Also if you know any more trigger locations please share :)&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=153114</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=153114"/>
		<updated>2011-09-17T15:15:26Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
A dfhacker :)&lt;br /&gt;
&lt;br /&gt;
[[Utility:DFusion]] - a lua based DFhack plugin&lt;br /&gt;
&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu or playing. (first five tiles either empty or border), from v0.5 fps can be on&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can be used to control (with keyboard, no mouse support) DF if server allows it. To do that DF window must be selected (white star in upper left corner).&lt;br /&gt;
*Server settings:&lt;br /&gt;
**''Allow new users contorl:True/False'' means that new users can control DF.&lt;br /&gt;
**''User:&amp;lt;some name&amp;gt;''  select a user (with arrows or by dragging mouse)&lt;br /&gt;
**''Kick'' kicks the selected user&lt;br /&gt;
**''Toggle Allow Control'' Toggles selected users permission to control DF.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153113</id>
		<title>Utility:DFusion</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Utility:DFusion&amp;diff=153113"/>
		<updated>2011-09-17T15:15:08Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Created page with ' == DFusion info page =='&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== DFusion info page ==&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=153112</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=153112"/>
		<updated>2011-09-17T15:12:53Z</updated>

		<summary type="html">&lt;p&gt;Warmist: /* Intro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
A dfhacker :)&lt;br /&gt;
&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu or playing. (first five tiles either empty or border), from v0.5 fps can be on&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can be used to control (with keyboard, no mouse support) DF if server allows it. To do that DF window must be selected (white star in upper left corner).&lt;br /&gt;
*Server settings:&lt;br /&gt;
**''Allow new users contorl:True/False'' means that new users can control DF.&lt;br /&gt;
**''User:&amp;lt;some name&amp;gt;''  select a user (with arrows or by dragging mouse)&lt;br /&gt;
**''Kick'' kicks the selected user&lt;br /&gt;
**''Toggle Allow Control'' Toggles selected users permission to control DF.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist/monopage.js&amp;diff=89701</id>
		<title>User:Warmist/monopage.js</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist/monopage.js&amp;diff=89701"/>
		<updated>2010-04-11T10:45:28Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Created page with 'importScript('User:Briess/hideAnnouncements.js');'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;importScript('User:Briess/hideAnnouncements.js');&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=40d:Memory_hacking/v0.28.181.40d16&amp;diff=54855</id>
		<title>40d:Memory hacking/v0.28.181.40d16</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=40d:Memory_hacking/v0.28.181.40d16&amp;diff=54855"/>
		<updated>2009-10-12T19:04:58Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Created page with '== Addresses == Note: could be wrong (not all tested from d14), but mostly good and working. &amp;lt;pre&amp;gt; pointer_x_pos         == 0x05662B4  pointer_y_pos         == 0x05662B8  pointer…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Addresses ==&lt;br /&gt;
Note: could be wrong (not all tested from d14), but mostly good and working.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pointer_x_pos         == 0x05662B4 &lt;br /&gt;
pointer_y_pos         == 0x05662B8 &lt;br /&gt;
pointer_z_pos         == 0x05662BC &lt;br /&gt;
window_x_pos          == 0x09A060C&lt;br /&gt;
window_y_pos          == 0x09CE6B8&lt;br /&gt;
window_z_pos          == 0x09CE694&lt;br /&gt;
selected_creature_id  == 0x09E1F44&lt;br /&gt;
is_paused             == 0x0FDC2C7&lt;br /&gt;
notes_vector          == 0x0FEF5E0 &lt;br /&gt;
job_list_iterator_st  == 0x11BE7E8&lt;br /&gt;
creatures_vec         == 0x11bde60&lt;br /&gt;
items_vec             == 0x11bdf54&lt;br /&gt;
items_vec_ex          == 0x11bdf3c &amp;lt;- includes items not in map(artifacts made in others forts)&lt;br /&gt;
messages_vec          == 0x1201D1C&lt;br /&gt;
reactions_vec         == 0x1A30CE0&lt;br /&gt;
races_vec             == 0x1203F70&lt;br /&gt;
effects_vec           == 0x1347F24&lt;br /&gt;
stonegloss_vec        == 0x1203F10&lt;br /&gt;
metalgloss_vec        == 0x1203F40&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=40d:Memory_hacking&amp;diff=54854</id>
		<title>40d:Memory hacking</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=40d:Memory_hacking&amp;diff=54854"/>
		<updated>2009-10-12T18:56:31Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Added 40d16&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Versions ==&lt;br /&gt;
See the following subpages for version specific information&lt;br /&gt;
* '''[[Memory hacking/v0.27.169.33g|v0.27.169.33g]]'''&lt;br /&gt;
* [[Memory hacking/v0.27.169.33f|v0.27.169.33f]]&lt;br /&gt;
* [[Memory hacking/v0.27.169.33e|v0.27.169.33e]]&lt;br /&gt;
* [[Memory hacking/v0.27.169.33d|v0.27.169.33d]]&lt;br /&gt;
* [[Memory hacking/v0.27.169.33c|v0.27.169.33c]]&lt;br /&gt;
* [[Memory hacking/v0.27.169.33b|v0.27.169.33b]]&lt;br /&gt;
* [[Memory hacking/v0.27.169.33a|v0.27.169.33a]]&lt;br /&gt;
* [[Memory hacking/v0.28.181.40d16|v0.28.181.40d16]]&lt;br /&gt;
== Data Types ==&lt;br /&gt;
=== String ===&lt;br /&gt;
&lt;br /&gt;
{|  border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Offset || Size || Type || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || 4 || Junk || Junk data that exists due to a curious artifact in the C++ standard. Technically it's the allocator - in reality, the default allocator has no data associated with it.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || 16 || Character buffer || Holds the string data if capacity &amp;lt; 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || 4 || Character pointer || Points to the string data if capacity &amp;gt;= 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || Length || Current length of the string&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Capacity || Current capacity of the string buffer (also indicates which mode the string is in)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Yes, the second two items overlap. This is correct. This is the MSVC Express string format - Toady appears to be using standard C++ structures pretty much everywhere.&lt;br /&gt;
&lt;br /&gt;
=== Vector ===&lt;br /&gt;
&lt;br /&gt;
{|  border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Offset || Size || Type || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || 4 || Junk || Junk data that exists due to a curious artifact in the C++ standard. Technically it's the allocator - in reality, the default allocator has no data associated with it.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || 4 || Array start&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || 4 || Array end || (End - Start)/4 = # of elements (if pointers)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || 4 || Array allocated end || (Allocated End - Start)/4 = capacity (if pointers)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Type ID list ==&lt;br /&gt;
&lt;br /&gt;
Most likely incomplete, but this was all that could be found so far.&lt;br /&gt;
&lt;br /&gt;
{|  border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| ID || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; || Miner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01&amp;lt;/code&amp;gt; || Woodworker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x02&amp;lt;/code&amp;gt; || Carpenter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x03&amp;lt;/code&amp;gt; || Bowyer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x04&amp;lt;/code&amp;gt; || Woodcutter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x05&amp;lt;/code&amp;gt; || Stoneworker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x06&amp;lt;/code&amp;gt; || Engraver&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x07&amp;lt;/code&amp;gt; || Mason&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x08&amp;lt;/code&amp;gt; || Ranger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x09&amp;lt;/code&amp;gt; || Animal Caretaker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0A&amp;lt;/code&amp;gt; || Animal Trainer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0B&amp;lt;/code&amp;gt; || Hunter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0C&amp;lt;/code&amp;gt; || Trapper&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0D&amp;lt;/code&amp;gt; || Animal Dissector&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0E&amp;lt;/code&amp;gt; || Metalsmith&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0F&amp;lt;/code&amp;gt; || Furnace Operator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10&amp;lt;/code&amp;gt; || Weaponsmith&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x11&amp;lt;/code&amp;gt; || Armorer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x12&amp;lt;/code&amp;gt; || Blacksmith&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x13&amp;lt;/code&amp;gt; || Metalcrafter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; || Jeweler&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x15&amp;lt;/code&amp;gt; || Gem Cutter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x16&amp;lt;/code&amp;gt; || Gem Setter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x17&amp;lt;/code&amp;gt; || Craftsman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x18&amp;lt;/code&amp;gt; || Woodcrafter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x19&amp;lt;/code&amp;gt; || Stonecrafter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1A&amp;lt;/code&amp;gt; || Leatherworker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1B&amp;lt;/code&amp;gt; || Bone Carver&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1C&amp;lt;/code&amp;gt; || Weaver&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1D&amp;lt;/code&amp;gt; || Clothier&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1E&amp;lt;/code&amp;gt; || Glassmaker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1F&amp;lt;/code&amp;gt; || Strand Extractor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x20&amp;lt;/code&amp;gt; || Queen&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x21&amp;lt;/code&amp;gt; || Queen Consort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x22&amp;lt;/code&amp;gt; || Fishery Worker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt; || Fisherman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x24&amp;lt;/code&amp;gt; || Fish Dissector&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x25&amp;lt;/code&amp;gt; || Fish Cleaner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x26&amp;lt;/code&amp;gt; || Farmer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x27&amp;lt;/code&amp;gt; || Cheese Maker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x28&amp;lt;/code&amp;gt; || Milker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x29&amp;lt;/code&amp;gt; || Cook&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2A&amp;lt;/code&amp;gt; || Thresher&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2B&amp;lt;/code&amp;gt; || Miller&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2C&amp;lt;/code&amp;gt; || Butcher&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2D&amp;lt;/code&amp;gt; || Tanner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2E&amp;lt;/code&amp;gt; || Dyer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x2F&amp;lt;/code&amp;gt; || Planter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x30&amp;lt;/code&amp;gt; || Herbalist&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x31&amp;lt;/code&amp;gt; || Brewer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x32&amp;lt;/code&amp;gt; || Soap Maker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x33&amp;lt;/code&amp;gt; || Potash Maker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x34&amp;lt;/code&amp;gt; || Lye Maker&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x35&amp;lt;/code&amp;gt; || Wood Burner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x36&amp;lt;/code&amp;gt; || Engineer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x37&amp;lt;/code&amp;gt; || Mechanic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x38&amp;lt;/code&amp;gt; || Siege Engineer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x39&amp;lt;/code&amp;gt; || Siege Operator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3A&amp;lt;/code&amp;gt; || Pump Operator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3B&amp;lt;/code&amp;gt; || Clerk&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3C&amp;lt;/code&amp;gt; || Administrator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3D&amp;lt;/code&amp;gt; || Trader&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3E&amp;lt;/code&amp;gt; || Architect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x3F&amp;lt;/code&amp;gt; || Alchemist&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x40&amp;lt;/code&amp;gt; || Tax Collector&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x41&amp;lt;/code&amp;gt; || Hammerer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; || Baroness&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x43&amp;lt;/code&amp;gt; || Countess&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x44&amp;lt;/code&amp;gt; || Duchess&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x45&amp;lt;/code&amp;gt; || Baroness Consort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x46&amp;lt;/code&amp;gt; || Countess Consort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x47&amp;lt;/code&amp;gt; || Duchness Consort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x48&amp;lt;/code&amp;gt; || Philosopher&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x49&amp;lt;/code&amp;gt; || Advisor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4A&amp;lt;/code&amp;gt; || Dungeon Master&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4B&amp;lt;/code&amp;gt; || Merchant&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4C&amp;lt;/code&amp;gt; || Diplomat&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4D&amp;lt;/code&amp;gt; || Guild Representative&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4E&amp;lt;/code&amp;gt; || Merchant Baroness&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x4F&amp;lt;/code&amp;gt; || Merchant Princess&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x50&amp;lt;/code&amp;gt; || Outpost Liason&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x51&amp;lt;/code&amp;gt; || Druid&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x52&amp;lt;/code&amp;gt; || Champion&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x53&amp;lt;/code&amp;gt; || Hammerman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x54&amp;lt;/code&amp;gt; || Hammer Lord&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x55&amp;lt;/code&amp;gt; || Spearman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x56&amp;lt;/code&amp;gt; || Spearmaster&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x57&amp;lt;/code&amp;gt; || Crossbowman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x58&amp;lt;/code&amp;gt; || Elite Crossbowman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x59&amp;lt;/code&amp;gt; || Wrestler&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5A&amp;lt;/code&amp;gt; || Elite Wrestler&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5B&amp;lt;/code&amp;gt; || Axeman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5C&amp;lt;/code&amp;gt; || Axe Lord&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5D&amp;lt;/code&amp;gt; || Swordsman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5E&amp;lt;/code&amp;gt; || Swordmaster&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x5F&amp;lt;/code&amp;gt; || Maceman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x60&amp;lt;/code&amp;gt; || Mace Lord&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x61&amp;lt;/code&amp;gt; || Pikeman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x62&amp;lt;/code&amp;gt; || Pikemaster&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x63&amp;lt;/code&amp;gt; || Bowman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x64&amp;lt;/code&amp;gt; || Elite Bowman&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x65&amp;lt;/code&amp;gt; || Blowgunner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x66&amp;lt;/code&amp;gt; || Elite Blowgunner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x67&amp;lt;/code&amp;gt; || Recruit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x68&amp;lt;/code&amp;gt; || Hunting creature&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x69&amp;lt;/code&amp;gt; || War creature&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6A&amp;lt;/code&amp;gt; || Master Thief&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6B&amp;lt;/code&amp;gt; || Thief&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6C&amp;lt;/code&amp;gt; || Peasant or creature&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6D&amp;lt;/code&amp;gt; || Child&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6E&amp;lt;/code&amp;gt; || Baby&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x6F&amp;lt;/code&amp;gt; || Drunk&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x70&amp;lt;/code&amp;gt; || Lasher&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x71&amp;lt;/code&amp;gt; || Master Lasher&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Profession list ==&lt;br /&gt;
 PROFESSION_MINE,&lt;br /&gt;
 PROFESSION_HAUL_STONE,&lt;br /&gt;
 PROFESSION_HAUL_WOOD,&lt;br /&gt;
 PROFESSION_HAUL_BODY,&lt;br /&gt;
 PROFESSION_HAUL_FOOD,&lt;br /&gt;
 PROFESSION_HAUL_REFUSE,&lt;br /&gt;
 PROFESSION_HAUL_ITEM,&lt;br /&gt;
 PROFESSION_HAUL_FURNITURE,&lt;br /&gt;
 PROFESSION_HAUL_ANIMALS,&lt;br /&gt;
 PROFESSION_CLEAN,&lt;br /&gt;
 PROFESSION_CUTWOOD,&lt;br /&gt;
 PROFESSION_CARPENTER,&lt;br /&gt;
 PROFESSION_DETAIL,&lt;br /&gt;
 PROFESSION_MASON,&lt;br /&gt;
 PROFESSION_ARCHITECT,&lt;br /&gt;
 PROFESSION_ANIMALTRAIN,&lt;br /&gt;
 PROFESSION_ANIMALCARE,&lt;br /&gt;
 PROFESSION_HEALTHCARE,&lt;br /&gt;
 PROFESSION_BUTCHER,&lt;br /&gt;
 PROFESSION_TRAPPER,&lt;br /&gt;
 PROFESSION_DISSECT_VERMIN,&lt;br /&gt;
 PROFESSION_LEATHER,&lt;br /&gt;
 PROFESSION_TANNER,&lt;br /&gt;
 PROFESSION_BREWER,&lt;br /&gt;
 PROFESSION_ALCHEMIST,&lt;br /&gt;
 PROFESSION_SOAP_MAKER,&lt;br /&gt;
 PROFESSION_WEAVER,&lt;br /&gt;
 PROFESSION_CLOTHESMAKER,&lt;br /&gt;
 PROFESSION_MILLER,&lt;br /&gt;
 PROFESSION_PROCESS_PLANT,&lt;br /&gt;
 PROFESSION_MAKE_CHEESE,&lt;br /&gt;
 PROFESSION_MILK,&lt;br /&gt;
 PROFESSION_COOK,&lt;br /&gt;
 PROFESSION_PLANT,&lt;br /&gt;
 PROFESSION_HERBALIST,&lt;br /&gt;
 PROFESSION_FISH,&lt;br /&gt;
 PROFESSION_CLEAN_FISH,&lt;br /&gt;
 PROFESSION_DISSECT_FISH,&lt;br /&gt;
 PROFESSION_HUNT,&lt;br /&gt;
 PROFESSION_SMELT,&lt;br /&gt;
 PROFESSION_FORGE_WEAPON,&lt;br /&gt;
 PROFESSION_FORGE_ARMOR,&lt;br /&gt;
 PROFESSION_FORGE_FURNITURE,&lt;br /&gt;
 PROFESSION_METAL_CRAFT,&lt;br /&gt;
 PROFESSION_CUT_GEM,&lt;br /&gt;
 PROFESSION_ENCRUST_GEM,&lt;br /&gt;
 PROFESSION_WOOD_CRAFT,&lt;br /&gt;
 PROFESSION_STONE_CRAFT,&lt;br /&gt;
 PROFESSION_BONE_CARVE,&lt;br /&gt;
 PROFESSION_GLASSMAKER,&lt;br /&gt;
 PROFESSION_EXTRACT_STRAND,&lt;br /&gt;
 PROFESSION_AXE,&lt;br /&gt;
 PROFESSION_SWORD,&lt;br /&gt;
 PROFESSION_MACE,&lt;br /&gt;
 PROFESSION_HAMMER,&lt;br /&gt;
 PROFESSION_SPEAR,&lt;br /&gt;
 PROFESSION_DAGGER,&lt;br /&gt;
 PROFESSION_CROSSBOW,&lt;br /&gt;
 PROFESSION_BOW,&lt;br /&gt;
 PROFESSION_BLOWGUN,&lt;br /&gt;
 PROFESSION_PIKE,&lt;br /&gt;
 PROFESSION_WHIP,&lt;br /&gt;
 PROFESSION_SHIELDLEVEL,&lt;br /&gt;
 PROFESSION_ARMORLEVEL,&lt;br /&gt;
 PROFESSION_SIEGECRAFT,&lt;br /&gt;
 PROFESSION_SIEGEOPERATE,&lt;br /&gt;
 PROFESSION_BOWYER,&lt;br /&gt;
 PROFESSION_MECHANIC,&lt;br /&gt;
 PROFESSION_WEAPONNUMBER,&lt;br /&gt;
 PROFESSION_POTASH_MAKING,&lt;br /&gt;
 PROFESSION_LYE_MAKING,&lt;br /&gt;
 PROFESSION_DYER,&lt;br /&gt;
 PROFESSION_BURN_WOOD,&lt;br /&gt;
 PROFESSION_OPERATE_PUMP,&lt;br /&gt;
 PROFESSION_UNUSED_3,&lt;br /&gt;
 PROFESSION_UNUSED_4,&lt;br /&gt;
 PROFESSION_UNUSED_5,&lt;br /&gt;
 PROFESSION_UNUSED_6,&lt;br /&gt;
 PROFESSION_UNUSED_7,&lt;br /&gt;
 PROFESSION_UNUSED_8,&lt;br /&gt;
 PROFESSION_UNUSED_9,&lt;br /&gt;
 PROFESSION_UNUSED_10,&lt;br /&gt;
 PROFESSION_UNUSED_11,&lt;br /&gt;
 PROFESSION_UNUSED_12,&lt;br /&gt;
 PROFESSION_UNUSED_13,&lt;br /&gt;
 PROFESSION_UNUSED_14,&lt;br /&gt;
 PROFESSION_UNUSED_15,&lt;br /&gt;
 PROFESSION_UNUSED_16,&lt;br /&gt;
 PROFESSION_UNUSED_17,&lt;br /&gt;
 PROFESSION_UNUSED_18,&lt;br /&gt;
 PROFESSION_UNUSED_19,&lt;br /&gt;
 PROFESSION_UNUSED_20,&lt;br /&gt;
 PROFESSION_UNUSED_21,&lt;br /&gt;
 PROFESSION_UNUSED_22,&lt;br /&gt;
 PROFESSION_UNUSED_23,&lt;br /&gt;
 PROFESSION_UNUSED_24,&lt;br /&gt;
 PROFESSION_UNUSED_25,&lt;br /&gt;
 PROFESSION_UNUSED_26,&lt;br /&gt;
 PROFESSION_UNUSED_27,&lt;br /&gt;
 PROFESSION_UNUSED_28,&lt;br /&gt;
 PROFESSION_UNUSED_29,&lt;br /&gt;
 PROFESSION_UNUSED_30,&lt;br /&gt;
 PROFESSIONNUM,&lt;br /&gt;
[[Category:Guides]] [[Category:Hacking]]&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50417</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50417"/>
		<updated>2009-08-11T00:23:59Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu or playing. (first five tiles either empty or border), from v0.5 fps can be on&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can be used to control (with keyboard, no mouse support) DF if server allows it. To do that DF window must be selected (white star in upper left corner).&lt;br /&gt;
*Server settings:&lt;br /&gt;
**''Allow new users contorl:True/False'' means that new users can control DF.&lt;br /&gt;
**''User:&amp;lt;some name&amp;gt;''  select a user (with arrows or by dragging mouse)&lt;br /&gt;
**''Kick'' kicks the selected user&lt;br /&gt;
**''Toggle Allow Control'' Toggles selected users permission to control DF.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50416</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50416"/>
		<updated>2009-08-11T00:22:33Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu or playing. (first five tiles either empty or border), from v0.5 fps can be on&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for viewing someone play df.&lt;br /&gt;
*Server settings:&lt;br /&gt;
**''Allow new users contorl:True/False'' means that new users can control DF.&lt;br /&gt;
**''User:&amp;lt;some name&amp;gt;''  select a user (with arrows or by dragging mouse)&lt;br /&gt;
**''Kick'' kicks the selected user&lt;br /&gt;
**''Toggle Allow Control'' Toggles selected users permission to control DF.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50415</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50415"/>
		<updated>2009-08-11T00:21:39Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu or playing. (first five tiles either empty or border), from v0.5 fps can be on&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for viewing someone play df.&lt;br /&gt;
*Server settings:&lt;br /&gt;
**'Allow new users contorl:True/False' means that new users can control DF.&lt;br /&gt;
**'User:&amp;lt;some name&amp;gt;'  select a user (with arrows or by dragging mouse)&lt;br /&gt;
**'Kick' kicks the selected user&lt;br /&gt;
**'Toggle Allow Control' Toggles selected users permission to control DF.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User_talk:Warmist&amp;diff=50421</id>
		<title>User talk:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User_talk:Warmist&amp;diff=50421"/>
		<updated>2009-08-09T13:33:49Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is it possible to have the source please? Just rather curious and have an idea of implementing something similiar in another program for reading stuff from DF. I really would like to know how memory hacking with DF is done, especially the graphics interface, I have been forever stuck on getting a good working example though. Especially as I am a self-taught C++ programmer I feel rather clueless. I really don't mind messy code and I'm not forcing you, but it'd be absolutely invaluable to me. [[User:Nexii Malthus|Nexii Malthus]] 00:26, 9 August 2009 (UTC)&lt;br /&gt;
:actually that part of code is quite clean... So I could give you source.[[User:Warmist|Warmist]] 13:33, 9 August 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50414</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50414"/>
		<updated>2009-08-08T09:38:36Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu.&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for viewing someone play df.&lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50413</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50413"/>
		<updated>2009-08-08T07:56:49Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.And in main menu.&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for &lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50412</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50412"/>
		<updated>2009-08-08T07:08:26Z</updated>

		<summary type="html">&lt;p&gt;Warmist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*Df must be running.&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for &lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50411</id>
		<title>User:Warmist</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=User:Warmist&amp;diff=50411"/>
		<updated>2009-08-08T07:01:47Z</updated>

		<summary type="html">&lt;p&gt;Warmist: Creating user page and posting about df view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
Hello, I'm new here.&lt;br /&gt;
=Good stuff=&lt;br /&gt;
==Remote df viewer==&lt;br /&gt;
Where to get:[http://dffd.wimbli.com/file.php?id=1315 DF File Depot]&lt;br /&gt;
===Quick help===&lt;br /&gt;
*works only with 40d13!&lt;br /&gt;
*ports must be open (if using over internet=&amp;gt; not 127.0.0.1)&lt;br /&gt;
*control is with mouse and keyboard:&lt;br /&gt;
**select buttons by passing over with mouse or TAB'ing into them.&lt;br /&gt;
**press enter or left mouse button. &lt;br /&gt;
*currently can only be used for &lt;br /&gt;
===Known bugs===&lt;br /&gt;
*black scanline&lt;br /&gt;
&lt;br /&gt;
===Thanks===&lt;br /&gt;
Thanks 0x517A5D	for writing very useful hexsearch.h.&lt;br /&gt;
Thanks jice for writing libTCod.&lt;/div&gt;</summary>
		<author><name>Warmist</name></author>
	</entry>
</feed>