Template:CorruptionsTable/doc: Difference between revisions
From Melvor Idle
m (Fix copy to clipboard not working) |
No edit summary |
||
Line 1: | Line 1: | ||
A script is used to generate the following table. To use, open the game and paste the below into the [[In-game_Functions#Using_In-game_Functions|console]]. The outputs will be copied to your clipboard automatically. After running the script, 'edit source' on [[Template:CorruptionsTable]] then Ctrl+A and Ctrl+V. Look over the contents to ensure everything looks fine then save. | |||
A manual pass will need to be done to add links to different status effects, buffs, and enemy debuffs, such as [[Laceration]], [[Slow]], etc. Limit these links to once per table per effect. | |||
<syntaxhighlight lang="javascript" line> | <syntaxhighlight lang="javascript" line> | ||
let results = []; | let results = [`<noinclude>{{/doc}}[[Category:Manual Tables]]</noinclude>\n{| class="wikitable sortable stickyHeader"\n|-class="headerRow-0"\n!|Min Monster Lvl!!Effect`]; | ||
game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => { | game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => { | ||
results.push(`|${numberWithCommas(row.minMonsterLevel)} || <span style="color:green">${row.customDescription}</span>`); | results.push(`|${row.minMonsterLevel ? numberWithCommas(row.minMonsterLevel) : 'Starts Unlocked'} || <span style="color:green">${row.customDescription}</span>`); | ||
}); | }); | ||
let output = ``;results.forEach(alias => output += alias + '\n|-\n');console.log(output); | let output = ``;results.forEach((alias, i) => output += alias + (i === results.length - 1 ? '\n|}' : '\n|-\n'));console.log(output); | ||
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output); | self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output); | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 15:52, 19 July 2024
A script is used to generate the following table. To use, open the game and paste the below into the console. The outputs will be copied to your clipboard automatically. After running the script, 'edit source' on Template:CorruptionsTable then Ctrl+A and Ctrl+V. Look over the contents to ensure everything looks fine then save.
A manual pass will need to be done to add links to different status effects, buffs, and enemy debuffs, such as Laceration, Slow, etc. Limit these links to once per table per effect.
let results = [`<noinclude>{{/doc}}[[Category:Manual Tables]]</noinclude>\n{| class="wikitable sortable stickyHeader"\n|-class="headerRow-0"\n!|Min Monster Lvl!!Effect`];
game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => {
results.push(`|${row.minMonsterLevel ? numberWithCommas(row.minMonsterLevel) : 'Starts Unlocked'} || <span style="color:green">${row.customDescription}</span>`);
});
let output = ``;results.forEach((alias, i) => output += alias + (i === results.length - 1 ? '\n|}' : '\n|-\n'));console.log(output);
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output);