Created
March 19, 2017 19:03
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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