Skip to content

Instantly share code, notes, and snippets.

@mxmzb
Created June 10, 2015 13:10
Show Gist options
  • Select an option

  • Save mxmzb/890b25ca642d96dcecc9 to your computer and use it in GitHub Desktop.

Select an option

Save mxmzb/890b25ca642d96dcecc9 to your computer and use it in GitHub Desktop.
new models.User().botStatusAccepted(bot_db.get('id')).fetchAll().then(function(users){
callibration_loop(users.toArray());
}).catch(function(e) { console.error(e); });
var userCounter = 0,
callibration_loop = function(users) {
var user = users[userCounter++];
if(bot.friends[user.get('steam_id')] && bot.friends[user.get('steam_id')] == 3) {
process_user_mmr(user);
}
if(userCounter < users.length) {
setTimeout(function(){
callibration_loop(users);
}, 3000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment