https://bitbucket.org/disacorns/df-trade-prefs/src/master/trade-prefs
so, i created my first script for dfhack! lets call it the alpha version.
what it does:
shows you a list of items that your dwarves prefer, sorted as the trade agreements sort. it also shows where the trade negotiator will list the items, and how many you currently have in stocks.
e.g.
Leather
Hagfish leather Not Found 0
Beaver leather Not Found 0
Giant muskox leather Not Found 0
Aardvark leather Not Found 0
White stork leather Not Found 0
Green tree frog leather Not Found 0
Wood
Apricot wood logs 0, 0 22
Maple logs 0, 3 0
Larch logs 1, 0 0
Date palm wood logs Not Found 0
Rubber wood logs Not Found 0
Finger lime wood logs Not Found 0
Apple wood logs Not Found 0
Peach wood logs Not Found 0
Rambutan wood logs Not Found 1
MetalBars
Gold bars 0, 1 58
Silver bars 0, 2 34
Copper bars 0, 3 64
Nickel bars 0, 4 30
Bronze bars 0, 6 47
Brass bars 0, 7 30
Steel bars 0, 8 57
Electrum bars 0, 10 31
Trifle pewter bars 0, 13 76
Lay pewter bars 0, 14 25
Lead bars 0, 15 55
Billon bars 1, 0 31
Black bronze bars 1, 2 31
Rose gold bars 1, 3 47
Aluminum bars Not Found 0
Gems
Prase opal 0, 4 43
Milk quartz 1, 1 118
Onyx opal 1, 4 1
Red pyrope 2, 1 179
Morganite 2, 8 0
Kunzite 2, 11 0
Yellow zircon 2, 14 1
Yellow spessartine 2, 15 171
Clear garnet 3, 1 0
Clear zircon 3, 2 3
Chrysoberyl 3, 6 47
Crystal opal 3, 10 21
Levin opal 3, 11 32
Blue garnet 4, 1 1
Red grossular 4, 6 100
Honey yellow beryl 4, 9 0
Golden beryl 4, 10 3
Fire agate Not Found 0
Lace agate Not Found 0
Green jade Not Found 40
Light yellow diamond Not Found 0
Black diamond Not Found 0
White chalcedony Not Found 0
Bloodstone Not Found 1
Sapphire Not Found 0
Seeds
Cowpea Not Found 0
Chestnut Not Found 0
Chickpea Not Found 0
Red bean Not Found 0
Broad bean Not Found 0
White millet Not Found 0
Hide root seed Not Found 0
Sliver barb seed Not Found 0
Peanut Not Found 0
Pets
Drinks
Dwarven wine 0, 0 9
Dwarven ale 0, 1 11
Hard wheat beer Not Matched0
Soft wheat beer Not Matched0
Raspberry wine Not Matched0
Purple amaranth beer Not Matched0
Wine Not Matched7
Artichoke wine Not Matched0
Quinoa beer Not Found 0
Durian wine Not Found 0
Tuber beer Not Found 0
Apricot wine Not Found 0
Rye beer Not Found 15
Beetroot wine Not Found 8
Radish wine Not Found 9
Kaniwa beer Not Found 8
Gutter cruor Not Found 0
Fisher berry wine Not Found 0
Perry Not Found 0
Sewer brew Not Found 13
Fonio beer Not Found 0
Sweet potato wine Not Found 0
Turnip wine Not Found 0
Bumblebee bumblebee mead Not Found 0
Sand pear cider Not Found 0
Mango wine Not Found 0
Plum wine Not Found 0
Cheese
Donkey cheese 0, 2 1
Pig cheese 0, 5 6
Goat cheese 0, 6 14
Powders
Gypsum plaster 0, 3 21
Rye flour Not Found 24
Finger millet flour Not Found 0
Foxtail millet flour Not Found 32
Teff flour Not Found 0
Flax flour Not Found 0
Extracts
Pig's milk 0, 10 0
Kangaroo's milk Not Found 0
Kangaroo's milk Not Found 0
Meat
Giant mole kidney 11, 14 0
Red-winged blackbird eye Not Found 0
Cod pancreatic Not Found 0
Giant parakeet spleen Not Found 0
Whale shark stomach Not Found 0
Giant fox eye Not Found 0
Ocean sunfish stomach Not Found 0
Giant warthog stomach Not Found 0
Lion tamarin heart Not Found 0
Hammerhead shark muscle Not Found 0
Dragonfly pancreatic Not Found 0
Giant coyote muscle Not Found 0
Fish
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Seahorse gut Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Catastrophe of gopetuja Not Found 0
Plants
Wild carrot plant Not Found 32
Turnip plant Not Found 0
GardenVegetables
Artichoke hearts 0, 0 33
Raspberries 0, 1 34
Quarry bush leaves 0, 2 12
Strawberry plant 0, 3 11
Feather tree eggs Not Found 0
Bitter melon leaves Not Found 17
Bananas Not Found 0
Plums Not Found 23
Stones
Limestone 0, 1 0
Dolomite 0, 2 11
Gabbro 0, 6 0
Schist 0, 10 1
Gneiss 0, 11 0
Malachite 1, 0 1
Petrified wood 1, 6 0
Graphite 1, 7 0
Microcline 1, 15 3
Mica 1, 16 3
Conglomerate 2, 1 0
Bauxite 2, 2 0
Claystone 2, 4 0
Saltpeter 2, 5 1
Ilmenite 2, 7 2
Sandstone 2, 9 1
Gypsum plaster Not Matched21
Borax Not Found 0
Brimstone Not Found 0
Marcasite Not Found 0
Hematite Not Found 0
Orpiment Not Found 0
Anhydrite Not Found 1
Rhyolite Not Found 0
Horn silver Not Found 1
Dacite Not Found 0
Gypsum Not Found 1
Puddingstone Not Found 1
Thread(Plant)
Pig tail thread 0, 0 380
Rope reed thread Not Found 429
Linen thread Not Found 0
Eggs
Glass
Green glass 0, 0 2
Clear glass 0, 1 6
Crystal glass 0, 2 33
Thread(Yarn)
Llama wool 0, 1 909
Crafts
Mountain goat horn 6, 12 0
Yak horn 6, 15 0
Muskox horn 7, 5 0
Mule hoof 8, 9 0
Cow hoof 8, 13 0
Goat horn 9, 5 0
Pond turtle shell 15, 8 0
Common snapping turtle shell 17, 16 0
Giant red panda bone Not Found 0
Giant muskox hoof Not Found 0
Giant hare tooth Not Found 0
Sea otter tooth Not Found 0
Oyster shell Not Found 0
Bluefin tuna tooth Not Found 0
Kea bone Not Found 0
Capybara tooth Not Found 0
Great horned owl tooth Not Found 0
UNKNOWN
Coral Not Found 0
2, -1
ITEMS_DELICATE
Kenaf seed oil Not Found 0
420, 32
EDIBLE_COOKED, LIQUID_MISC_PLANT, LIQUID_MISC
Axolotl parchment Not Found 0
38, 508
IMPLIES_ANIMAL_KILL
the output columns go like:
<name> <page number>, <row number> <stocks>
page number is how many pages down in 'Meat' or whatever the item will be shown, <row number> is how many items down on that page. Stocks is how many of that item you currently have.
'Not Found' means the script believes the civilazition doesn't offer that item.
'Not Matched' means the civilization offers another form of that item, but seems not to offer that particular item. e.g. dwarves don't offer strawberry wine in drinks, but they could offer strawberries. This also happens with gypsum plaster, your citizen may want it a stone, but the dwarves offer it as a powder.
----
To further explain what this script is for I thought I should describe why I made it:
I like to buy my citizens stuff they want. Gold, quartzite, whatever, but stuff my fortress doesn't produce. Just using DwarfTherapist's preferences dock was tedious, so i started using a spreadsheet to keep track of what they want, and if the traders actually offer it. Updating that was also tedious and full of human error, (going through the list of meat to find a specific animal, and then missing it, or not realizing 'Larch' is a kind of tree.) So I made this script.
---
While this script works (for my purposes at least), anyone looking at the code will realize quickly I have no idea what Im doing. If anyone who does have some idea what they're doing could look at it and give me some advice, or even clean it up, i would be supremely grateful.
My biggest problem at the moment, is looking up :LikeItem preferences.
e.g. picks. I know picks have a sub_type 7, but so do other things in the itemdefs, and I cant figure out what dance_form: 24 is telling me about a pick?!?
Having written one script, im working on another, and really need to know this.
Thanks in advance for any help.
I hope someone else finds this useful.