User:Slash

From Melvor Idle
Revision as of 21:15, 5 July 2024 by Slash (talk | contribs)
let results = [`{| class="wikitable navigation-not-searchable" style="margin:auto; clear:both; width: 100%"\n! Prayers !! DLC !! {{Skill|Prayer|Prayers}}`],
	nsMap = new Map([['melvorF', ['Standard', '{{Melvor}}']], ['melvorTotH', ['', '{{TotH}}']], ['melvorAoD', ['Unholy', '{{AoD}}']], ['melvorItA', ['Abyssal', '{{ItA}}']]]);
game.prayers.namespaceMaps.forEach((prayers, ns) => {
	let bookResults = '',
		nsValues = nsMap.get(ns),
		rowSpan = ns === 'melvorF' ? 'rowspan=2' : '',
		style = ns === 'melvorTotH' ? `|| ${nsValues[1]}` : `! style="text-align:center;"${rowSpan}| ${nsValues[0]}\n|| ${nsValues[1]}`
	results.push(`\n|-\n${style}\n|style="text-align:center;"|`);
	prayers.forEach(prayer => {
		bookResults += ` {{PrayerIcon|${prayer.name}|size=16}} •`;
	});
	bookResults = bookResults.slice(0, bookResults.length - 2); results.push(bookResults);
});
let outputString = ``;
results.forEach(str => outputString += str);
outputString += '\n|}';
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(outputString, 'text') : copy(outputString);
console.log(outputString);