Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var wantedPkmn = [3,6,9,36,38,45,59,65,68,76,83,87,89,94,106,108,115,122,130,131,132,133,134,139,141,142,143,147,148,149];
- var search = function() {
- var imgs = document.getElementsByTagName("img");
- var foundNew = false;
- for (var i = 0; i < imgs.length; i++) {
- var img = imgs[i];
- if (img.src.indexOf('pokemon') > -1) {
- var id = img.src.match(/\d+/)[0];
- if (wantedPkmn.indexOf(Number(id)) == -1) {
- img.parentNode.style.display = 'none';
- } else if (!img.notified) {
- img.notified = true;
- foundNew = true;
- }
- }
- }
- if (foundNew)
- notify();
- }
- var notify = function() {
- new Audio('https://notificationsounds.com/soundfiles/53fde96fcc4b4ce72d7739202324cd49/file-sounds-882-solemn.mp3').play();
- }
- document.getElementsByClassName('home-map')[0].onclick = function() {
- search();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement