//run in a windowed 800 by 600 mode with 800x600 font.
//I have programmed for other windows (2 constants below should be changed) but have not tested this
//it will output a text file on C: called DF.txt
//it seems slightly glitchy and will sometimes output a wrong value. UserBeware
//run time is approx 3-4 sec per dwarf. It may take a minute or 2 for large numbers of dwarves.SetActiveWindow Dwarf Fortress
Constants
TotalDwarfs=16 //This value must be adjusted before running
WindowX=800
WindowY=600
Framewidth=3 //3 may need adjustment should put mouse cursor just inside frame where tiles start
Titlebarheight=29 //same as above
OriginX = 0
OriginY = 0
CurrentX=0
CurrentY=0
tileheight=0
tilewidth=0
dwarf=0
lineIndex=0
Fileinput=Dwarf
End
Constructs
File1=File
End
Procedure JobGet using jobs
delay 20
loop $lineindex=0 to $jobs
compute $CurrentY=$OriginY + $lineindex*$tileheight
compute $CurrentX=$OriginX
while 1=1
IsWhite $CurrentX, $CurrentY
setconst fileinput=$fileinput X
break
Else
Isgrey $CurrentX, $CurrentY
setconst fileinput=$fileinput O
break
else
inc $CurrentX
if {loopno}>50
setconst fileinput=$fileinput NA
break
end
end
End
end
end
End
Fileopen File1, c:\DF.txt //change this as you please
Filerewrite file1
setconst fileinput=$fileinput Mning WoodC Carpy Mason StnDe AniTr AniCr HealC FishC Butch LthWk Tning FarmF Fishn
setconst fileinput=$fileinput Alchy FurOp AshOp Metal Jewel Craft Glass SgEng SgOpr Mechs XBowM Weavn Cloth Milln
setconst fileinput=$fileinput Huntn Brewn PlntG FarmW Cookn Trapn StonH WoodH ItemH Buril FoodH RefuH FurnH AnimH
setconst fileinput=$fileinput Clean Archt
filewrite file1, $fileinput
compute $OriginX={WindowLeft}+$Framewidth
compute $OriginY={WindowTop}+$titlebarheight
Mousepos $originX,$originY //use this to find inside corner of frame
compute $tileheight=$WindowY/25
compute $tilewidth=$WindowX/80
compute $OriginX =$OriginX + $tilewidth*50
compute $OriginY =$OriginY + $tileheight*5.5
keys ucpl{SPACE}
loop $totaldwarfs
keys u
compute $dwarf={loopno}-1
while $dwarf>18
keys {pgdn}
compute $dwarf=$dwarf-19
end
if $dwarf>0
loop $dwarf
keys {DOWN}
end
end
keys c
compute $Fileinput=$dwarf+1
Call JobGet 13
keys {Keypad *}
Call JobGet 13
keys {Keypad *}
Call JobGet 13
keys {Keypad *}
Call JobGet 1
keys {space}
filewrite file1, $fileinput
end
fileclose file1