Viewing old revision of Module:TEST/Trade_Items
You are viewing an old revision of this page from 1/23/2026, 1:21:00 PM.
View latest versionNo documentation subpage (
/doc) found for this module.const Utils = await require("Utils");
const Game = await require("TEST/Game");
function renderTable(items) {
let wikitext = '';
wikitext += '{| class="wiki-table" style="width: auto;"\n';
wikitext += '! Name !! Rarity\n';
for (const id in items) {
const item = items[id];
wikitext += '|-\n';
// Name
wikitext += `| [[Trade Items/${item.name || id}|${item.name || id}]]\n`;
// Rarity
if (item.rarity) {
wikitext += `| ${Game.wikiRarity(item.rarity)}\n`;
} else {
wikitext += `| ${Game.wikiRarity("common")}\n`;
}
}
wikitext += '|}\n';
return wikitext;
}
exports.TEST = async function () {
const { data, version } = await Utils.resolveData("Trade_Items", true)
if (Utils.isModuleEmpty(data)) {
return '⚠️ Trade item data is unavailable for all known versions.';
}
let output = '';
output += `''Data version: <code>${version}</code>''\n\n`;
output += renderTable(data);
return output;
};