User:Slash

From Melvor Idle
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' ? `| style="text-align:center; | ${nsValues[1]}` : `! style="text-align:center;"${rowSpan}| ${nsValues[0]}\n| style="text-align:center; | ${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);