Skip to content

Instantly share code, notes, and snippets.

@timothycarambat
Created September 19, 2018 02:37
Show Gist options
  • Save timothycarambat/d6b9ad923da84b75738ea3d9b84ccf11 to your computer and use it in GitHub Desktop.
Save timothycarambat/d6b9ad923da84b75738ea3d9b84ccf11 to your computer and use it in GitHub Desktop.
u/thespiritlamp Help on updating old chrome UserScript. Auto grabs dragon eggs on online game Dragons Cave. Original Script https://gist.github.com/RedHatter/cdb1d15331b725619d62
// ==UserScript==
// @name Egg Napper
// @namespace idioticdev.com -> updated by timothycarambat
// @include http*://dragcave.net/locations/*
// @grant none
// @version 1
// ==/UserScript==
var SCROLL = true;
var ONLY_RARES = false;
var found = false;
function s(x)
{
var eggs = document.getElementsByClassName("eggs")[0];
if (eggs)
{
// curent HTML strucutre is egg holder (div) with three egg (divs) that contain a anchor, br, and span with text
var snapResults = document.evaluate("div/span[contains(.,\""+x+"\")]", eggs, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
console.log(snapResults);
for (var i = snapResults.snapshotLength - 1; i >= 0; i--) {
var elm = snapResults.snapshotItem(i);
var eggLocation = elm.previousSibling.previousSibling.href;
found = true;
window.location.href = eggLocation;
//elm.click ();
}
}
}
//Rares
s("This egg is soft and smells uncannily like cheese");
s("This egg is very reflective, almost metallic looking");
s("This egg gives off a beautiful glow");
s("This egg looks like it doesn't belong");
s("This egg is tiny and made out of several pieces of paper folded together");
s("This egg is much smaller than the others");
s("This egg has icicles forming on it");
s("This egg is almost too hot to touch");
s("Whenever you go near this egg your hair stands on end");
s("Oh my. There is a Leetle Tree among the eggs");
s("This egg has a faint green glow around it");
s("This egg shimmers like gold");
s("Mana courses throughout this glassy egg.");
s("This egg smells faintly like brine.");
s("This egg feels like polished stone.");
s("This egg gleams with a reddish shine.");
s("This egg looks like it doesn't belong; it is brightly colored with white spots. It's much lighter than the other eggs.");
//s("This egg displays the colors of both dawn and dusk.");
if (!ONLY_RARES)
{
// Common
//s("This egg has strange markings on it.");
s("This egg smells rather rancid.");
s("This egg is unusually large and heavy.");
s("This egg has a black cap.");
s("This delicately patterned egg is sitting in the sunshine.");
s("This egg makes you feel a bit uneasy.");
s("This pink and red egg wobbles occasionally.");
s("This egg glitters oddly in the light.");
s("Frost is creeping over this cold egg.");
s("This striped egg feels moist.");
s("This egg is speckled with rosette-like markings.");
s("The surface of this egg is rough and sharp.");
s("This egg is encrusted with colorful gemstones.");
s("Cold flames dance across the surface of this egg.");
s("This egg is patterned with an orange flare.");
s("This egg is hidden by some leaves.");
s("This egg shines brilliantly in moonlight, and is covered in red spots.");
s("This egg is off-white in color and smells a bit like salt.");
s("This egg has a faintly exotic scent.");
s("There is a thin layer of moisture coating this egg.");
s("The air shimmers around this egg, as if from heat.");
s("This egg is rocking back and forth in a puddle, creating small waves.");
s("This opalescent egg shimmers in the moonlight.");
//s("This egg is glowing as brightly as the sun.");
//s("This egg has brightly colored markings on it.");
s("This egg glows from within.");
s("This egg is so tiny you almost didn't see it.");
s("This egg feels like polished stone.");
s("This egg is wet from the waves and has bright red stripes.");
s("This massive egg is covered with thick plates.");
s("This egg smells musty, like rotting leaves.");
s("This dull purple egg has two bright stripes on it.");
s("This egg resembles a glowing stone.");
s("You hear strange noises coming from inside this egg.");
s("This egg is hidden in the trees.");
s("A small puddle of condensation has collected under this egg.");
}
if (!found)
{
if (SCROLL)
{
var next = parseInt(window.location.href.charAt(window.location.href.length-1))+1;
next = (next <= 6) ? next : 1;
window.location.href = "http://dragcave.net/locations/"+next;
}
else
{
window.location.reload();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment