Advertisement
Guest User

bot.js

a guest
Dec 24th, 2017
1,582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. var fs = require("fs"),
  2. Steam = require("steam"),
  3. SteamID = require("steamid"),
  4. IntervalIntArray = {},
  5. readlineSync = require("readline-sync"),
  6. Protos = require("./protos/protos.js"),
  7. CountReports = 0,
  8. Long = require("long"),
  9. SteamClients = {},
  10. SteamUsers = {},
  11. SteamGCs = {},
  12. SteamFriends = {},
  13. process = require("process"),
  14. steamID = process.argv[2],
  15. bot_nr = process.argv[3],
  16. ClientHello = 4006,
  17. ClientWelcome = 4004;
  18.  
  19. var accounts = [];
  20.  
  21. var arrayAccountsTxt = fs.readFileSync("accounts_" + bot_nr + ".txt").toString().split("\n");
  22. for (i in arrayAccountsTxt) {
  23. var accInfo = arrayAccountsTxt[i].toString().trim().split(":");
  24. var username = accInfo[0];
  25. var password = accInfo[1];
  26. accounts[i] = [];
  27. accounts[i].push({
  28. username: username,
  29. password: password
  30. });
  31. }
  32.  
  33. var size = 0;
  34. size = arrayAccountsTxt.length;
  35.  
  36. arrayAccountsTxt.forEach(processSteamReport);
  37.  
  38. function processSteamReport(element, indexElement, array) {
  39. if (element != "") {
  40. var account = element.toString().trim().split(":");
  41. var account_name = account[0];
  42. var password = account[1];
  43. SteamClients[indexElement] = new Steam.SteamClient();
  44. SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]);
  45. SteamGCs[indexElement] = new Steam.SteamGameCoordinator(SteamClients[indexElement], 730);
  46. SteamFriends[indexElement] = new Steam.SteamFriends(SteamClients[indexElement]);
  47.  
  48. SteamClients[indexElement].connect();
  49.  
  50. var sentryfile;
  51. if(fs.existsSync(account_name + '.sentry')) {
  52. sentryfile = fs.readFileSync(account_name + '.sentry');
  53. }
  54.  
  55. SteamClients[indexElement].on("connected", function() {
  56. if(fs.existsSync(account_name + '.sentry')) {
  57. SteamUsers[indexElement].logOn({
  58. account_name: account_name,
  59. password: password,
  60. sha_sentryfile: sentryfile
  61. });
  62. } else {
  63. SteamUsers[indexElement].logOn({
  64. account_name: account_name,
  65. password: password
  66. });
  67. }
  68. });
  69.  
  70. SteamClients[indexElement].on("logOnResponse", function(res) {
  71. if (res.eresult !== Steam.EResult.OK) {
  72. if (res.eresult == Steam.EResult.ServiceUnavailable) {
  73. console.log("\n[STEAM CLIENT - Login failed - STEAM IS DOWN!");
  74. SteamClients[indexElement].disconnect();
  75. process.exit();
  76. } else {
  77. CountReports++;
  78. if (CountReports == size)
  79. {
  80. console.log("\n\n"+ CountReports + " Reports for this faggot.\nThanks for using this Service!\nCredits for the Script to askwrite & TROLOLO\nreports sent from raiiiii.com/report");
  81. process.exit();
  82. }
  83. console.log("\n[STEAM CLIENT (" + account_name.substring(0, 4) + "**) - Login failed!" + res.eresult);
  84. SteamClients[indexElement].disconnect();
  85. SteamClients.splice(indexElement, 1);
  86. SteamFriends.splice(indexElement, 1);
  87. SteamGCs.splice(indexElement, 1);
  88. SteamUsers.splice(indexElement, 1);
  89. IntervalIntArray.splice(indexElement, 1);
  90. }
  91. } else {
  92. SteamFriends[indexElement].setPersonaState(Steam.EPersonaState.Offline);
  93.  
  94. SteamUsers[indexElement].gamesPlayed({
  95. games_played: [{
  96. game_id: 730
  97. }]
  98. });
  99.  
  100. if (SteamGCs[indexElement]) {
  101. IntervalIntArray[indexElement] = setInterval(function() {
  102. SteamGCs[indexElement].send({
  103. msg: ClientHello,
  104. proto: {}
  105. }, new Protos.CMsgClientHello({}).toBuffer());
  106. }, 2000);
  107. // console.log("[GC - " + indexElement + "] Client Hello sent!");
  108. } else {
  109. SteamClients[indexElement].disconnect();
  110. SteamClients.splice(indexElement, 1);
  111. SteamFriends.splice(indexElement, 1);
  112. SteamGCs.splice(indexElement, 1);
  113. SteamUsers.splice(indexElement, 1);
  114. IntervalIntArray.splice(indexElement, 1);
  115. }
  116. }
  117. });
  118.  
  119. SteamClients[indexElement].on("error", function(err) {
  120. console.log("[STEAM CLIENT - " + indexElement + "] Account is probably ingame! Logged out!\n" + err);
  121. size = size - 1;
  122. if (CountReports == size)
  123. {
  124. console.log("\n\n"+ CountReports + " Reports for this faggot.\nThanks for using this Service!\nCredits for the Script to askwrite & TROLOLO\nreports sent from raiiiii.com/report");
  125. process.exit();
  126. }
  127. SteamClients[indexElement].disconnect();
  128. SteamClients.splice(indexElement, 1);
  129. SteamFriends.splice(indexElement, 1);
  130. SteamGCs.splice(indexElement, 1);
  131. SteamUsers.splice(indexElement, 1);
  132. IntervalIntArray.splice(indexElement, 1);
  133. });
  134.  
  135. SteamGCs[indexElement].on("message", function(header, buffer, callback) {
  136. switch (header.msg) {
  137. case ClientWelcome:
  138. clearInterval(IntervalIntArray[indexElement]);
  139. // console.log("[GC - " + indexElement + "] Client Welcome received!");
  140. // console.log("[GC - " + indexElement + "] Report request sent!");
  141. IntervalIntArray[indexElement] = setInterval(function() {
  142. sendReport(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID);
  143. }, 2000);
  144. break;
  145. case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello:
  146. // console.log("[GC - " + indexElement + "] MM Client Hello sent!");
  147. break;
  148. case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse:
  149. CountReports++;
  150. console.log("[GC - (" + CountReports + ")] Report with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientReportResponse.decode(buffer).confirmationId.toString() + " sent!");
  151. if (CountReports == size)
  152. {
  153. console.log("\n\n"+ CountReports + " Reports for this faggot.\nThanks for using this Service!\nCredits for the Script to askwrite & TROLOLO\nreports sent from raiiiii.com/report");
  154. }
  155. SteamClients[indexElement].disconnect();
  156. SteamClients.splice(indexElement, 1);
  157. SteamFriends.splice(indexElement, 1);
  158. SteamGCs.splice(indexElement, 1);
  159. SteamUsers.splice(indexElement, 1);
  160. IntervalIntArray.splice(indexElement, 1);
  161. break;
  162. default:
  163. console.log(header);
  164. break;
  165. }
  166. });
  167. }
  168. }
  169.  
  170. function sendReport(GC, Client, account_name) {
  171. var account_id = new SteamID(steamID).accountid;
  172. GC.send({
  173. msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer,
  174. proto: {}
  175. }, new Protos.CMsgGCCStrike15_v2_ClientReportPlayer({
  176. accountId: account_id,
  177. matchId: 8,
  178. rptAimbot: 2,
  179. rptWallhack: 3,
  180. rptSpeedhack: 4,
  181. rptTeamharm: 5,
  182. rptTextabuse: 6,
  183. rptVoiceabuse: 7
  184. }).toBuffer());
  185. }
  186.  
  187. process.on("uncaughtException", function(err) {});
  188.  
  189. console.log("Reporting SteamID: " + steamID + "\nStarting Accounts...");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement