Advertisement
Guest User

Untitled

a guest
Dec 21st, 2016
6,821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 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. CountCommends = 0,
  8. Long = require("long"),
  9. SteamClients = {},
  10. SteamUsers = {},
  11. SteamGCs = {},
  12. SteamFriends = {},
  13. process = require("process"),
  14. steamID = process.argv[2],
  15. ClientHello = 4006,
  16. ClientWelcome = 4004;
  17.  
  18. var accounts = [];
  19.  
  20. var arrayAccountsTxt = fs.readFileSync("accounts.txt").toString().split("\n");
  21. for (i in arrayAccountsTxt) {
  22. var accInfo = arrayAccountsTxt[i].toString().trim().split(":");
  23. var username = accInfo[0];
  24. var password = accInfo[1];
  25. accounts[i] = [];
  26. accounts[i].push({
  27. username: username,
  28. password: password
  29. });
  30. }
  31.  
  32. var size = 0;
  33. size = arrayAccountsTxt.length;
  34.  
  35. arrayAccountsTxt.forEach(processSteamCommend);
  36.  
  37. function processSteamCommend(element, indexElement, array) {
  38. if (element != "") {
  39. var account = element.toString().trim().split(":");
  40. var account_name = account[0];
  41. var password = account[1];
  42. SteamClients[indexElement] = new Steam.SteamClient();
  43. SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]);
  44. SteamGCs[indexElement] = new Steam.SteamGameCoordinator(SteamClients[indexElement], 730);
  45. SteamFriends[indexElement] = new Steam.SteamFriends(SteamClients[indexElement]);
  46.  
  47. SteamClients[indexElement].connect();
  48.  
  49. var sentryfile;
  50. if(fs.existsSync(account_name + '.sentry')) {
  51. sentryfile = fs.readFileSync(account_name + '.sentry');
  52. }
  53.  
  54. SteamClients[indexElement].on("connected", function() {
  55. if(fs.existsSync(account_name + '.sentry')) {
  56. SteamUsers[indexElement].logOn({
  57. account_name: account_name,
  58. password: password,
  59. sha_sentryfile: sentryfile
  60. });
  61. } else {
  62. SteamUsers[indexElement].logOn({
  63. account_name: account_name,
  64. password: password
  65. });
  66. }
  67. });
  68.  
  69. SteamClients[indexElement].on("logOnResponse", function(res) {
  70. if (res.eresult !== Steam.EResult.OK) {
  71. if (res.eresult == Steam.EResult.ServiceUnavailable) {
  72. console.log("\nLogin failed! STEAM IS DOWN!");
  73. SteamClients[indexElement].disconnect();
  74. process.exit();
  75. } else {
  76. if (CountCommends == size)
  77. {
  78. console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
  79. process.exit();
  80. }
  81. console.log("Login failed!");
  82. SteamClients[indexElement].disconnect();
  83. SteamClients.splice(indexElement, 1);
  84. SteamFriends.splice(indexElement, 1);
  85. SteamGCs.splice(indexElement, 1);
  86. SteamUsers.splice(indexElement, 1);
  87. IntervalIntArray.splice(indexElement, 1);
  88. }
  89. } else {
  90. SteamFriends[indexElement].setPersonaState(Steam.EPersonaState.Offline);
  91.  
  92. SteamUsers[indexElement].gamesPlayed({
  93. games_played: [{
  94. game_id: 730
  95. }]
  96. });
  97.  
  98. if (SteamGCs[indexElement]) {
  99. IntervalIntArray[indexElement] = setInterval(function() {
  100. SteamGCs[indexElement].send({
  101. msg: ClientHello,
  102. proto: {}
  103. }, new Protos.CMsgClientHello({}).toBuffer());
  104. }, 2000);
  105. console.log("Communicating with GameCoordinator...");
  106. } else {
  107. SteamClients[indexElement].disconnect();
  108. SteamClients.splice(indexElement, 1);
  109. SteamFriends.splice(indexElement, 1);
  110. SteamGCs.splice(indexElement, 1);
  111. SteamUsers.splice(indexElement, 1);
  112. IntervalIntArray.splice(indexElement, 1);
  113. }
  114. }
  115. });
  116.  
  117. SteamClients[indexElement].on("error", function(err) {
  118. console.log("Commend request was declined! Probably the accounts are in cooldown from another Commend! Try again later :(\n" + err);
  119. size = size - 1;
  120. if (CountCommends == size)
  121. {
  122. console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
  123. process.exit();
  124. }
  125. SteamClients[indexElement].disconnect();
  126. SteamClients.splice(indexElement, 1);
  127. SteamFriends.splice(indexElement, 1);
  128. SteamGCs.splice(indexElement, 1);
  129. SteamUsers.splice(indexElement, 1);
  130. IntervalIntArray.splice(indexElement, 1);
  131. });
  132.  
  133. SteamGCs[indexElement].on("message", function(header, buffer, callback) {
  134. switch (header.msg) {
  135. case ClientWelcome:
  136. clearInterval(IntervalIntArray[indexElement]);
  137. console.log("Connection with GameCoordinator established!");
  138. console.log("Commend request sent!");
  139. IntervalIntArray[indexElement] = setInterval(function() {
  140. sendCommend(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID);
  141. }, 2000);
  142. break;
  143. case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello:
  144. console.log("Commend request accepted!");
  145. break;
  146. case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse:
  147. console.log("[GameCoordinator] - " + CountCommends + " Commend with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientCommendResponse.decode(buffer).confirmationId.toString() + " sent!");
  148. if (CountCommends == size)
  149. {
  150. console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
  151. }
  152. SteamClients[indexElement].disconnect();
  153. SteamClients.splice(indexElement, 1);
  154. SteamFriends.splice(indexElement, 1);
  155. SteamGCs.splice(indexElement, 1);
  156. SteamUsers.splice(indexElement, 1);
  157. IntervalIntArray.splice(indexElement, 1);
  158. break;
  159. default:
  160. console.log(header);
  161. break;
  162. }
  163. });
  164. }
  165. }
  166.  
  167. function sendCommend(GC, Client, account_name) {
  168. var account_id = new SteamID(steamID).accountid;
  169. var commend_payload = new Protos.PlayerCommendationInfo({
  170. cmdFriendly: 1,
  171. cmdTeaching: 2,
  172. cmdLeader: 4
  173. });
  174. GC.send({
  175. msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientCommendPlayer,
  176. proto: {}
  177. }, new Protos.CMsgGCCStrike15_v2_ClientCommendPlayer({
  178. accountId: account_id,
  179. matchId: 8,
  180. commendation: commend_payload
  181. }).toBuffer());
  182. CountCommends++;
  183. console.log("[GameCoordinator] - " + CountCommends + " Commends Sended!");
  184. if (CountCommends == size)
  185. {
  186. console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
  187. process.exit();
  188. }
  189. SteamClients[indexElement].disconnect();
  190. SteamClients.splice(indexElement, 1);
  191. SteamFriends.splice(indexElement, 1);
  192. SteamGCs.splice(indexElement, 1);
  193. SteamUsers.splice(indexElement, 1);
  194. IntervalIntArray.splice(indexElement, 1);
  195. }
  196.  
  197. process.on("uncaughtException", function(err) {});
  198.  
  199. console.log("Commending SteamID: " + steamID + "\nStarting Accounts...");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement