Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philgruneich/77d5f3c6c76717cd62e59de7ba6e9137 to your computer and use it in GitHub Desktop.
Save philgruneich/77d5f3c6c76717cd62e59de7ba6e9137 to your computer and use it in GitHub Desktop.
Automatically trains pickup players GLB2
var request = new XMLHttpRequest();
var counter = 0;
var limit = 40; // Trains 40 times
var counterFunction = function() {
request.abort();
request.open('POST', '/game/player/' + glb2.player.playerId + '/pickup_join', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
if (!!+request.responseText) ++counter;
if (counter >= limit) window.clearInterval(interval)
}
};
request.send();
}
var interval = setInterval(function() {
return counterFunction();
}, 300000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment