Skip to content

Instantly share code, notes, and snippets.

@paradoxxxzero
Created September 24, 2012 11:20
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 paradoxxxzero/3775510 to your computer and use it in GitHub Desktop.
Save paradoxxxzero/3775510 to your computer and use it in GitHub Desktop.
greoktclaim
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();
@govindlahoti
Copy link

can you please explain what this script do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment