Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
3,779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. var fs = require("fs"),
  2. Steam = require("steam"),
  3. SteamID = require("steamid"),
  4. IntervalInt = null,
  5. querystring = require('querystring'),
  6. http = require('http'),
  7. readlineSync = require("readline-sync"),
  8. Protos = require("./protos/protos.js"),
  9. CountCommends = 0,
  10. TotalAccountsConnected = 0,
  11. CurrentAccount = 0,
  12. csgo = require('csgo'),
  13. SteamWebLogOn = require('steam-weblogon'),
  14. SteamTotp = require("steam-totp"),
  15. Long = require("long"),
  16. SteamClients = {},
  17. SteamUsers = {},
  18. SteamUsersWebLogOn = {},
  19. SteamCSGO = {},
  20. SteamGCs = {},
  21. SteamFriends = {},
  22. process = require("process");
  23.  
  24. var ClientHello = 4006,
  25. ClientWelcome = 4004;
  26.  
  27. var accounts = [];
  28.  
  29. var arrayAccountsTxt = fs.readFileSync("accounts.txt").toString().split("\n");
  30. for (i in arrayAccountsTxt) {
  31. var accInfo = arrayAccountsTxt[i].toString().trim().split(":");
  32. var username = accInfo[0];
  33. var password = accInfo[1];
  34. accounts[i] = [];
  35. accounts[i].push({
  36. username: username,
  37. password: password
  38. });
  39. }
  40. var arrayNicksTxt = fs.readFileSync("nicks.txt").toString().split("\n");
  41.  
  42. IntervalInt = setInterval(function() {
  43. if(TotalAccountsConnected > 100)
  44. {
  45.  
  46. }else{
  47. processSteamCommend(arrayAccountsTxt[CurrentAccount],CurrentAccount);
  48. CurrentAccount++;
  49. }
  50. }, 20);
  51.  
  52. function processSteamCommend(element, indexElement) {
  53. if(element != "") {
  54. TotalAccountsConnected++;
  55. console.log('[BOT ' + CurrentAccount+'] Started!');
  56. console.log("\nBEFORE1");
  57. var account = element.toString().trim().split(":");
  58. console.log("\nAFTER1");
  59. var account_name = account[0];
  60. var password = account[1];
  61. SteamClients[indexElement] = new Steam.SteamClient();
  62. SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]);
  63. SteamUsersWebLogOn[indexElement] = new SteamWebLogOn(SteamClients[indexElement], SteamUsers[indexElement]);
  64. SteamClients[indexElement].connect();
  65.  
  66.  
  67. SteamClients[indexElement].on("connected", function() {
  68. if(account.length > 2)
  69. {
  70. SteamUsers[indexElement].logOn({
  71. account_name: account_name,
  72. password: password,
  73. two_factor_code: SteamTotp.generateAuthCode(account[2])
  74. });
  75. }else{
  76. SteamUsers[indexElement].logOn({
  77. account_name: account_name,
  78. password: password
  79. });
  80. }
  81. });
  82. SteamClients[indexElement].on("logOnResponse", function(res) {
  83. if (res.eresult !== Steam.EResult.OK) {
  84. if (res.eresult == Steam.EResult.ServiceUnavailable) {
  85. console.log("\n[STEAM CLIENT - " + account_name + "] Login failed - STEAM IS DOWN!");
  86. console.log(res);
  87. TotalAccountsConnected--;
  88. SteamClients[indexElement].disconnect();
  89. process.exit();
  90. } else {
  91. console.log("\n[STEAM CLIENT - " + account_name + "] Login failed!");
  92. console.log(res);
  93. SteamClients[indexElement].disconnect();
  94. TotalAccountsConnected--;
  95. }
  96. } else {
  97. SteamUsersWebLogOn[indexElement].webLogOn(function(webSessionID, cookies){
  98. var now = Math.floor((Math.random() * arrayNicksTxt.length) + 0);
  99. console.log("\nBEFORE2");
  100. var napisac = arrayNicksTxt[now].toString();
  101. console.log("\nAFTER2");
  102.  
  103. var post_data = querystring.stringify({
  104. 'sessionID' : webSessionID,
  105. 'type': 'profileSave',
  106. 'weblink_1_title': '',
  107. 'weblink_1_url': '',
  108. 'weblink_2_title': '',
  109. 'weblink_2_url': '',
  110. 'weblink_3_title': '',
  111. 'weblink_3_url': '',
  112. 'personaName': napisac,
  113. 'real_name': '',
  114. 'country': '',
  115. 'state': '',
  116. 'city': '',
  117. 'customURL': '',
  118. 'summary': 'Nope',
  119. 'primary_group_steamid': '0'
  120. });
  121.  
  122. var cook = 'sessionid='+webSessionID+'; '+cookies[1]+'; '+cookies[2];
  123. var post_options = {
  124. host: 'steamcommunity.com',
  125. port: '80',
  126. path: '/profiles/'+SteamClients[indexElement].steamID+'/edit',
  127. method: 'POST',
  128. headers: {
  129. 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0',
  130. 'Cookie' : cook,
  131. 'Content-Type': 'application/x-www-form-urlencoded',
  132. 'Content-Length': Buffer.byteLength(post_data)
  133. }
  134. };
  135.  
  136. var post_req = http.request(post_options, function(res) {
  137. res.setEncoding('utf8');
  138. res.on('data', function (chunk) {
  139. res.emit('end');
  140. TotalAccountsConnected--;
  141. SteamClients[indexElement].disconnect();
  142. });
  143. });
  144. post_req.write(post_data);
  145. post_req.end();
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. });
  157. }
  158. });
  159.  
  160. SteamClients[indexElement].on("error", function(err) {
  161. console.log("[STEAM CLIENT - " + account_name + "] Account is probably ingame! Logged out!");
  162. TotalAccountsConnected--;
  163. SteamClients[indexElement].disconnect();
  164. });
  165.  
  166. }
  167. }
  168.  
  169.  
  170.  
  171. process.on('uncaughtException', function (err) {
  172. console.log(err);
  173. });
  174.  
  175. console.log("Initializing ReportBot by askwrite...\nCredits: Trololo - Idea");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement