Created
September 24, 2012 11:20
-
-
Save paradoxxxzero/3775510 to your computer and use it in GitHub Desktop.
greoktclaim
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
var _rcokt_farms = $('.farmtown_owned a').map(function () { return JSON.parse(atob($(this).attr('href')).split(String.fromCharCode(0))[0]).id;}), | |
_rcokt_town = $('.ftr_undefined').attr('id').split('_')[2], | |
_rcokt_token = game_definition_object.csrfToken, | |
_rcokt_link = $('<a>'); | |
$('#links').append($('<li>').append(_rcokt_link)); | |
function claim_okt() { | |
$.ajax({ | |
url: 'http://fr38.grepolis.com/game/oktoberfest?action=start_production&town_id=' + _rcokt_town + '&h=' + _rcokt_token, | |
type: 'POST', | |
data: { | |
json: '{"duration":300,"town_id":' + _rcokt_town + ',"nlreq_id":16083164}' | |
} | |
}).done(function () { | |
var delay = 1000 * 60 * 5.1 + parseInt(1000 * 30 * Math.random()), | |
next = new Date((new Date().getTime() + delay)).toLocaleTimeString(); | |
_rcokt_link.text('Claimed! Next: ' + next); | |
setTimeout(function() { | |
$.ajax({ | |
url: 'http://fr38.grepolis.com/game/oktoberfest?action=serve_product&town_id=' + _rcokt_town + '&h=' + _rcokt_token, | |
type: 'POST', | |
data: { | |
json: '{"town_id":' + _rcokt_town + ',"nlreq_id":16083164}' | |
} | |
}).done(function () { | |
var delay = 10000 + parseInt(1000 * 30 * Math.random()), | |
next = new Date((new Date().getTime() + delay)).toLocaleTimeString(); | |
_rcokt_link.text('Served! Next:' + next); | |
setTimeout(claim_okt); | |
}).fail(function () { | |
_rcokt_link.text('Error (s)'); | |
}); | |
}, delay); | |
}).fail(function () { | |
_rcokt_link.text('Error (c)'); | |
}); | |
} | |
claim_okt(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you please explain what this script do?