Created
April 1, 2014 13:51
-
-
Save newfurniturey/9914369 to your computer and use it in GitHub Desktop.
StackOverflow Unicoin auto-mine
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 getMoarCoins() { | |
var randDelay = Math.floor((Math.random() * 10) + 1) * 1000; | |
$.get('/unicoin/rock').done(function (e) { | |
setTimeout(function() { | |
var rockId = e.rock; | |
$.post('/unicoin/mine?rock=' + rockId, {fkey: StackExchange.options.user.fkey}).done(function (t) { | |
if (t.result !== 'Success') { | |
console.log('Failed to mine rock ' + rockId); | |
} else { | |
console.log('Mined rock ' + rockId + ' for ' + t.value + ' coins with a ' + (randDelay / 1000) + ' second delay!'); | |
StackExchange.uc.setBalance(StackExchange.uc.getBalance() + t.value); | |
setTimeout(function() { getMoarCoins(); }, 9000); | |
} | |
}); | |
}, 1000 + randDelay); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment