These scripts select everything in the broker trade list for trade but exclude the bins (for reuse) and unworn underwear (since dwarves rely on 'import' for these, and thus aren't available in the usual dwarven masterworks quality).
The 'elf' version also removes items made out of wood and items containing wooden improvements. I suspect this will also remove fruit (from trees) and tree fruit based booze (although I haven't checked). It does
not check for ash in its various forms, though (apart from the tree, of course).
The scripts set the trade flags for all items, so you'd start with running the appropriate script and then modify the list manually if you want to fine tune the selection.
allbutbins:
function allbutbins ()
if df.global.gview.view.child.child == nil or
df.global.gview.view.child.child._type ~= df.viewscreen_tradelistst or
df.global.gview.view.child.child.child._type ~= df.viewscreen_tradegoodsst then
dfhack.error ("This script must be run when the trade screen is open")
end
for i, item in ipairs (df.global.gview.view.child.child.child.broker_items) do
if item._type == df.item_binst or
(item._type == df.item_pantsst and
item.wear == 0 and
item.subtype.props.layer == 0) then -- underwear
df.global.gview.view.child.child.child.broker_selected [i] = 0
else
df.global.gview.view.child.child.child.broker_selected [i] = 1
end
end
end
allbutbins ()
allbutbinelf:
function allbutbinelf ()
local blocked
if df.global.gview.view.child.child == nil or
df.global.gview.view.child.child._type ~= df.viewscreen_tradelistst or
df.global.gview.view.child.child.child._type ~= df.viewscreen_tradegoodsst then
dfhack.error ("This script must be run when the trade screen is open")
end
for i, item in ipairs (df.global.gview.view.child.child.child.broker_items) do
if item._type == df.item_binst or
(item._type == df.item_pantsst and
item.wear == 0 and
item.subtype.props.layer == 0) or -- underwear
(dfhack.matinfo.decode (item.mat_type, item.mat_index).mode == "plant" and
df.global.world.raws.plants.all [item.mat_index].flags.TREE) then -- Wooden item, but will also ban fruit
df.global.gview.view.child.child.child.broker_selected [i] = 0
else
blocked = false
for k, improvement in ipairs (item.improvements) do
if dfhack.matinfo.decode (improvement.mat_type, improvement.mat_index).mode == "plant" and
df.global.world.raws.plants.all [improvement.mat_index].flags.TREE then
df.global.gview.view.child.child.child.broker_selected [i] = 0
blocked = true
break
end
end
if not blocked then
df.global.gview.view.child.child.child.broker_selected [i] = 1
end
end
end
end
allbutbinelf ()
To use the scripts, copy the script code into "text" files named allbutbins.lua and allbutbinelf.lua in the <DF>\hack\scripts folder respectively and invoke them by typing "allbutbins" or "allbutbinelf" into the DFHack console.