Skip to content

Instantly share code, notes, and snippets.

@RayBB
Created September 17, 2018 02:07
Show Gist options
  • Save RayBB/a1797a180f0c309229e2d8fa964104e2 to your computer and use it in GitHub Desktop.
Save RayBB/a1797a180f0c309229e2d8fa964104e2 to your computer and use it in GitHub Desktop.
Removes hatched dragons from valleysherwood
// 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