Skip to content

Instantly share code, notes, and snippets.

@Pysis868
Created March 19, 2017 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pysis868/7f7720caaa7fc698a0226ad37493d87b to your computer and use it in GitHub Desktop.
Save Pysis868/7f7720caaa7fc698a0226ad37493d87b to your computer and use it in GitHub Desktop.
Small script to count a specific object (korok seeds) in the Zelda: BotW Zelda map.
$.fn.reduce = [].reduce;
var singleKorokSeedLocations = $('.leaflet-marker-icon > div.icon-BotW_Korok-Seeds');
var singleKorokSeedLocationsTotal = singleKorokSeedLocations.length;
var multipleKorokSeedLocations = $('.leaflet-marker-icon > div > span');
var multipleKorokSeedLocationsTotal = multipleKorokSeedLocations.reduce(function(accumulator, currentElement){
return accumulator + parseInt(currentElement.innerText);
}, 0);
var korokSeedCount = singleKorokSeedLocationsTotal + multipleKorokSeedLocationsTotal;
alert("There are " + korokSeedCount + " korok seeds visible.");
/*
* You can add the following line as a bookmarklet in your browser for a quick count display.
*
* javascript:var korokSeedCount=$('.leaflet-marker-icon > div.icon-BotW_Korok-Seeds').length+$('.leaflet-marker-icon > div > span').reduce(function(accumulator, currentElement){return accumulator+parseInt(currentElement.innerText);},0);alert("There are "+korokSeedCount+" korok seeds visible.");
*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment