Last active
March 28, 2020 19:47
-
-
Save jaskiratr/21a5f1cd5de276c7e29c87322e2edc3c to your computer and use it in GitHub Desktop.
Automating online card game using browser script (https://www.alovestorygame.com/)
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
// Step 1: Type this in your browser console | |
var script = document.createElement('script'); | |
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// Wait for a second | |
//Step 2: Run the following | |
var elements = $(".card .face-front img"); | |
elements = elements.sort(function(a, b) { | |
if (a.src > b.src) { | |
return 1 | |
} | |
if (a.src < b.src) { | |
return -1 | |
} | |
return 0; | |
}); | |
elements.each(function(i,value) { | |
setTimeout(function() { | |
$(value).click(); | |
}, i * 1000 + 1000); | |
}); |
Author
jaskiratr
commented
Oct 12, 2016
•
https://mitoderohne.simonfreund.com/
var script = document.createElement('script');
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(script);
setTimeout(function () {
var elements = $(".card img.card-back");
elements = elements.sort(function(a, b) {
if (a.src > b.src) {
return 1
}
if (a.src < b.src) {
return -1
}
return 0;
});
elements.each(function(i,value) {
setTimeout(function() {
$(value).click();
}, i * 2000 + 1000);
});
},1000);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment