Last active
February 29, 2016 14:19
-
-
Save igorshapiro/73885ad058150fbbea2a to your computer and use it in GitHub Desktop.
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
(function() { | |
const DELAY = 250 | |
function delay(ms) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(resolve, ms) | |
}) | |
} | |
function doIt() { | |
$("a[href='#/tab/energy/unit/energy']").click() | |
delay(DELAY) | |
.then(_ => $("a:contains('cast 1'):visible:first").click()) | |
.then(_ => delay(DELAY)) | |
.then(_ => $("a.ng-binding:contains('Buy all')").click()) | |
.then(_ => setTimeout(doIt, DELAY)) | |
} | |
doIt() | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment