Created
May 1, 2018 15:38
-
-
Save philgruneich/77d5f3c6c76717cd62e59de7ba6e9137 to your computer and use it in GitHub Desktop.
Automatically trains pickup players GLB2
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 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