Created
September 17, 2018 02:07
-
-
Save RayBB/a1797a180f0c309229e2d8fa964104e2 to your computer and use it in GitHub Desktop.
Removes hatched dragons from valleysherwood
This file contains hidden or 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
// Works on http://valleysherwood.com/views/ | |
// All you have to do is past this in the console (while on the top frame) and run it | |
var images = document.querySelectorAll('iframe')[0].contentWindow.document.querySelectorAll('img'); | |
var count = 0; | |
for (let i = 0; i < images.length; i++){ | |
let cur = images[i]; | |
if(cur.width > 61){ | |
let code = cur.src.split("/")[4]; | |
count++; | |
removeDrag(code); | |
} | |
} | |
console.log(count + " dragons removed"); | |
function removeDrag(code){ | |
const url = "http://valleysherwood.com/update.php?code="+ code +"&s=ER"; | |
const Http = new XMLHttpRequest(); | |
Http.open("GET", url); | |
Http.send(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment