Project
Writ Voucher Calculator
writ-voucher-calculator.snowmaker.io →Elder Scrolls Online pays crafters in Writ Vouchers: a currency earned by completing daily crafting writs to spend at specific vendors. There is no shortage of guides on the earning half: which writs are cheapest to complete, how to batch them, how to shave materials off each run.
What I could not find is one that answered the other half. Once you have the vouchers, what should you actually buy? The vendor prices its stock in vouchers, but what those items are worth is set by a player economy. Nobody was doing that arithmetic. Yet.
I asked Tamriel Trade Centre whether I could use the compiled price dataset that drives half the trading addons in the game, and they were kind enough to hand over the relevant sources and some instructions. To my dismay it was all Lua, so I had a new syntax to comprehend while writing the processing layer. Yeah, things are fun.
function TamrielTradeCentre:LoadItemLookUpTable()
self.ItemLookUpTable={["sip of weapon power"]={[450]=1,},["dwarven cuirass of stamina"]={[300]=2,},["gingerose tea"]={[21]=4,},["slight glyph of increase physical harm"]={[1250]=6,},...ItemLookUpTable_EN.lua – 1.3 MB of it, on one line. PriceTableEU.lua is 6.1 MB. This is an addon save file, waiting to be tamed.
There is no parser in the pipeline either. The tables arrive as one enormous assignment with no line breaks, so the values come out by regular expression. I guess the more you despise something, the more you end up relying on it.
// Funny how much i despise regex, yet i have to use it ever so ofter
function extractValue(data, key) {
const regex = new RegExp(`\\["${key}"\\]=(\\d+(?:\\.\\d+)?)(?=,)`, "s");
const match = data.match(regex);
return match ? match[1] : null;
}ttc_asset_extractor.js with a slight pinch of salt.
So this Gatsby static site runs on a daily build cadence in GitHub Actions, scheduled for 12:00 UTC because the TTC numbers usually land about ninety minutes before that. It pulls the current numbers, does the arithmetic and generates the page. Nothing fancy. From the get-go it was meant to be a tool that gave me an advantage in the market PvP.
It ranks everything the vendors sell by return per voucher. I do not know whether I always meant it to become public or just hate myself, but it does the EU and US PC megaservers separately, two different economies. The shortlist at the top of the page is there in case a Google AI ever wants to quote it.
