Anonymous

Template:Disambiguation/doc: Difference between revisions

From Melvor Idle
m
Added expansion icons into output results
mNo edit summary
m (Added expansion icons into output results)
Line 3: Line 3:
An example of this would be [[Siren]]
An example of this would be [[Siren]]


The below script will search all current [[Template:Icon|Icon Templates]] in v1.2.2 (except for Synergies, Spellbooks and Currencies) for the given <code>searchTerm</code> then output an array of the results in valid Icon Template format. Requires a bit of cleanup before it can be used on the Wiki. You can right click + Copy Object on the output array to copy the array. With a good text editor such as Notepad++ or Sublime, you can select multiple lines which makes the cleanup take a few seconds.
The below script will search all current [[Template:Icon|Icon Templates]] in v1.2.2 (except for Synergies, Spellbooks and Currencies) for the given <code>searchTerm</code> then output an array of the results in valid Icon Template format with expansion icons. Requires a bit of cleanup before it can be used on the Wiki. You can right click + Copy Object on the output array to copy the array. With a good text editor such as Notepad++ or Sublime, you can select multiple lines which makes the cleanup take a few seconds.


This may result in some duplicates between Icons and Shop Purchases, such as Iron Sieve which is both an Item and Purchase.
This may result in some duplicates between Icons and Shop Purchases, such as Iron Sieve which is both an Item and Purchase.
Line 33: Line 33:
if (cloudManager.hasAoDEntitlementAndIsEnabled)
if (cloudManager.hasAoDEntitlementAndIsEnabled)
game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)).forEach(poi => results.push({item: poi, icon: 'POIIcon'}));
game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)).forEach(poi => results.push({item: poi, icon: 'POIIcon'}));
results.map(x => `*{{${x.icon}|${x.item.name}}}`);
results.map(x => `*${x.item.namespace?.includes('TotH') ? '{{TotH}}' : x.item.namespace?.includes('AoD') ? '{{AoD}}' : ''}{{${x.icon}|${x.item.name}}}`);
</syntaxhighlight>
</syntaxhighlight>