Skip to content

Instantly share code, notes, and snippets.

@newfurniturey
Created April 1, 2014 13:51
Show Gist options
  • Save newfurniturey/9914369 to your computer and use it in GitHub Desktop.
Save newfurniturey/9914369 to your computer and use it in GitHub Desktop.
StackOverflow Unicoin auto-mine
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