Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var i       = 0,
  2.             length  = bots.length;
  3.  
  4.         start(i);
  5.  
  6.         function start(i) {
  7.  
  8.             var botObj = bots[i];
  9.  
  10.             common.log('Bot #' + i + ' Connecting');
  11.  
  12.             bots[i] = vapor();
  13.  
  14.             var secret = botObj.login.sharedSecret;
  15.  
  16.             bots[i].init({
  17.                 username: botObj.login.username,
  18.                 password: botObj.login.password
  19.             });
  20.  
  21.             bots[i].use(vapor.plugins.autoReconnect);
  22.             bots[i].use(vapor.plugins.autoResponder, 'oi u jabbo cunt');
  23.             bots[i].use(vapor.plugins.declineFriendRequests);
  24.             bots[i].use(vapor.plugins.declineGroupInvites);
  25.             bots[i].use(vapor.plugins.essentials);
  26.             bots[i].use(vapor.plugins.fs, 'storage/bot-' + i);
  27.             bots[i].use(vapor.plugins.offlineMessages);
  28.  
  29.             bots[i].use(vapor.plugins.presence, {
  30.                 displayName: 'CSGO-Flux Bot #' + i,
  31.                 state: 'trade'
  32.             });
  33.  
  34.             var k = i;
  35.  
  36.             bots[i].use({
  37.                 name: 'accountManagement',
  38.                 plugin: function(VaporAPI) {
  39.                     VaporAPI.registerHandler({
  40.                         emitter: 'vapor',
  41.                         event: 'steamGuard'
  42.                     }, function(callback){
  43.                         var code = codeGen.generateAuthCode(secret);           
  44.                         common.log('Attempting Steamguard: ' + code);
  45.                         callback(code);
  46.                     });
  47.  
  48.                     VaporAPI.registerHandler({
  49.                         emitter: 'vapor',
  50.                         event: 'disconnected'
  51.                     }, function(error) {
  52.                         common.log('Bot #' + k + ' Disconnected');
  53.                         common.log(error.message);
  54.                     });
  55.  
  56.                     VaporAPI.registerHandler({
  57.                         emitter: 'vapor',
  58.                         event: 'ready'
  59.                     }, function() {
  60.                         common.log('Bot #' + k + ' Connected');
  61.                     });
  62.  
  63.                     var steamUser   = VaporAPI.getHandler('steamUser');
  64.                     managers[i]     = new trade({
  65.                         domain: 'csgo-flux.com',
  66.                         steam: steamUser,
  67.                         language: 'en'
  68.                     });
  69.  
  70.                     if(i < length-1) {
  71.                         i++;
  72.                         start(i);
  73.                     }
  74.                 }
  75.             });
  76.             bots[i].connect();
  77.         };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement