Skip to content

Instantly share code, notes, and snippets.

@igorshapiro
Last active February 29, 2016 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorshapiro/73885ad058150fbbea2a to your computer and use it in GitHub Desktop.
Save igorshapiro/73885ad058150fbbea2a to your computer and use it in GitHub Desktop.
(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