User:Slash: Difference between revisions

From Melvor Idle
No edit summary
Tag: Manual revert
No edit summary
Tag: Manual revert
 
(9 intermediate revisions by the same user not shown)
(No difference)

Latest revision as of 22:08, 28 July 2024

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);