Anonymous

In-game Functions: Difference between revisions

From Melvor Idle
m
Line 300: Line 300:
| relic || object || No || || The relic that you wish to add.
| relic || object || No || || The relic that you wish to add.


The relic can be obtained with <syntaxhighlight lang="js" inline><relicSet>.relicDrops.find(x => x.relic.id.toLowerCase().includes('relic<#>')).relic;</syntaxhighlight> where <code><#></code> is replaced with the relic number, starting from 1 and ending with 5.
The relic can be obtained with <syntaxhighlight lang="js" inline>relicSet.relicDrops[<#>].relic;</syntaxhighlight> where <code><#></code> is replaced with the relic number, starting from 0 and ending with 4.
|}
|}


Line 307: Line 307:
let realm = game.realms.getObjectByID('melvorD:Melvor');
let realm = game.realms.getObjectByID('melvorD:Melvor');
let relicSet = game.woodcutting.ancientRelicSets.get(realm);
let relicSet = game.woodcutting.ancientRelicSets.get(realm);
let relic = relicSet.relicDrops.find(x => x.relic.id.toLowerCase().includes('relic1')).relic;
let relic = relicSet.relicDrops[0].relic;
if (!relicSet.foundRelics.has(relic))
if (!relicSet.foundRelics.has(relic))
     game.woodcutting.locateAncientRelic(relicSet, relic);
     game.woodcutting.locateAncientRelic(relicSet, relic);