106
Masterwork DF / Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.4 - NEW POLL / Orc Plugin
« on: July 29, 2012, 09:56:10 am »How can i turn off DfHack?
don't hit alt-tab?
Otherwise I think you replace sdl.dll with sdl.real.dll
March 6, 2024: Dwarf Fortress 50.12 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
How can i turn off DfHack?
function fixnaked()
local total_fixed = 0
local total_uncovered = 0
local total_noshirt = 0
local total_noshoes = 0
for fnUnitCount,fnUnit in ipairs(df.global.world.units.all) do
if fnUnit.race == df.global.ui.race_id then
local listEvents = fnUnit.status.recent_events
--for lkey,lvalue in pairs(listEvents) do
-- print(df.unit_thought_type[lvalue.type],lvalue.type,lvalue.age,lvalue.subtype,lvalue.severity)
--end
local found = 1
local fixed = 0
while found == 1 do
local events = fnUnit.status.recent_events
found = 0
for k,v in pairs(events) do
if v.type == 109 then
events:erase(k)
found = 1
total_uncovered = total_uncovered + 1
fixed = 1
break
end
if v.type == 110 then
events:erase(k)
found = 1
total_noshirt = total_noshirt + 1
fixed = 1
break
end
if v.type == 111 then
events:erase(k)
found = 1
total_noshoes = total_noshoes + 1
fixed = 1
break
end
end
end
if fixed == 1 then
total_fixed = total_fixed + 1
print(total_fixed, total_uncovered+total_noshirt+total_noshoes,dfhack.TranslateName(dfhack.units.getVisibleName(fnUnit)))
end
end
end
print("thought 109 = "..df.unit_thought_type[109])
print("thought 110 = "..df.unit_thought_type[110])
print("thought 111 = "..df.unit_thought_type[111])
print("Total Fixed: "..total_fixed)
print("Total thoughts removed: "..total_uncovered)
print("Total thoughts removed: "..total_noshirt)
print("Total thoughts removed: "..total_noshoes)
end
fixnaked()
function exitem()
local item = dfhack.gui.getSelectedItem()
if(item) then
if(item.flags.owned) then
print ("OWNED")
end
printall(item)
printall(item.itemrefs)
local itemClass = item:getType()
print("---------")
print(itemClass,df.item_type[itemClass])
print("---------")
print(item:getSubtype())
print("---------")
print(item:getMaterial())
print(item:getMaterialIndex())
print("-- df.global")
printall(df.global.world.raws.inorganics[168])
--print("-----")
--printall(dfhack.matinfo)
print("----- decode")
printall(dfhack.matinfo.decode(item).material)
print("----- find")
printall(dfhack.matinfo.find("COAL"))
print("-----")
print(dfhack.items.getDescription(item,-1,false))
print("-----gettoken")
printall(dfhack.matinfo.getToken(item))
end
local drinks=0
local drink=0
local roasts=0
local roastMeals=0
local meat=0
local meatMeals=0
local ironB=0;
local pigIronB=0;
local steelB = 0;
local mithB=0
local wmithB=0
local goldB=0
local silverB=0
local copperB=0
local bronzeB=0
local cokeB=0
local iron=dfhack.matinfo.find("IRON").index
local pigIron=dfhack.matinfo.find("PIG_IRON").index
local steel=dfhack.matinfo.find("STEEL").index
local mith=dfhack.matinfo.find("MITHRIL").index
local wmith=dfhack.matinfo.find("PATTERN_MITHRIL").index
local gold=dfhack.matinfo.find("GOLD").index
local silver=dfhack.matinfo.find("SILVER").index
local copper=dfhack.matinfo.find("COPPER").index
local bronze=dfhack.matinfo.find("BRONZE").index
local coke=dfhack.matinfo.find("COAL").type
for k,v in ipairs(df.global.world.items.all) do
if(v:getType()==df.item_type.DRINK) then
drinks = drinks + v.stack_size
drink= drink+1
elseif(v:getType() == df.item_type.FOOD) then
roastMeals = roastMeals + v.stack_size
roasts= roasts+1
elseif(v:getType() == df.item_type.MEAT) then
meatMeals = meatMeals + v.stack_size
meat= meat+1
elseif(v:getType() == df.item_type.BAR) then
if(v:getMaterialIndex()==iron) then
ironB=ironB+1
elseif(v:getMaterialIndex()==pigIron) then
pigIronB=pigIronB+1
elseif(v:getMaterialIndex()==steel) then
steelB=steelB+1
elseif(v:getMaterialIndex()==mith) then
mithB=mithB+1
elseif(v:getMaterialIndex()==wmith) then
wmithB=wmithB+1
elseif(v:getMaterialIndex()==gold) then
goldB=goldB+1
elseif(v:getMaterialIndex()==silver) then
silverB=silverB+1
elseif(v:getMaterialIndex()==copper) then
copperB=copperB+1
elseif(v:getMaterialIndex()==bronze) then
bronzeB=bronzeB+1
elseif(v:getMaterial()==coke) then
cokeB=cokeB+1
end
end
end
print("Drinks",drink,drinks)
print("Food",roasts,roastMeals)
print("Meat",meat,meatMeals)
print("Iron Bars",ironB)
print("Pig Iron Bars",pigIronB)
print("Steel Bars",steelB)
print("Mithril Bars",mithB)
print("W Mithril Bars",wmithB)
print("Gold Bars",goldB)
print("Silver Bars",silverB)
print("Copper Bars",copperB)
print("Bronze Bars",bronzeB)
print("Coke Bars",cokeB)
end
exitem()
I am trying to check the status of some eggs.After a bit of testing, only eggs with anon_7 == -1 hatch.
When I try this:Code: [Select]printall(item.unk_cc)I getCode: [Select]--------------------unk_cc
anon_1 = -1
anon_2 = -1
anon_3 = -1
anon_4 = -1
anon_5 = -1
anon_6 = -1
anon_7 = 0
Across many eggs only anon_7 changes from 0 to -1.