Created
July 31, 2014 16:28
-
-
Save stonetoad/eaae658c07aeb149e9cf to your computer and use it in GitHub Desktop.
Urist Da Vinci's delete blood script from http://www.bay12forums.com/smf/index.php?topic=91166.msg4246062#msg4246062
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local my_entity=df.historical_entity.find(df.global.ui.civ_id) | |
local sText=" " | |
local k=0 | |
local v=1 | |
for x,y in pairs(df.global.world.entities.all) do | |
my_entity=y | |
k=0 | |
while k < #my_entity.resources.misc_mat.extracts.mat_index do | |
v=my_entity.resources.misc_mat.extracts.mat_type[k] | |
sText=dfhack.matinfo.decode(v,my_entity.resources.misc_mat.extracts.mat_index[k]) | |
if (sText==nil) then | |
--LIQUID barrels | |
my_entity.resources.misc_mat.extracts.mat_type:erase(k) | |
my_entity.resources.misc_mat.extracts.mat_index:erase(k) | |
k=k-1 | |
else | |
if(sText.material.id=="BLOOD") then | |
my_entity.resources.misc_mat.extracts.mat_type:erase(k) | |
my_entity.resources.misc_mat.extracts.mat_index:erase(k) | |
k=k-1 | |
end | |
if(sText.material.id=="ICHOR") then | |
my_entity.resources.misc_mat.extracts.mat_type:erase(k) | |
my_entity.resources.misc_mat.extracts.mat_index:erase(k) | |
k=k-1 | |
end | |
if(sText.material.id=="GOO") then | |
my_entity.resources.misc_mat.extracts.mat_type:erase(k) | |
my_entity.resources.misc_mat.extracts.mat_index:erase(k) | |
k=k-1 | |
end | |
--VENOM | |
--POISON | |
--FLUID | |
--MILK | |
--EXTRACT | |
end | |
k=k+1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment