Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fs = require("fs"),
- Steam = require("steam"),
- SteamID = require("steamid"),
- IntervalIntArray = {},
- readlineSync = require("readline-sync"),
- Protos = require("./protos/protos.js"),
- CountCommends = 0,
- Long = require("long"),
- SteamClients = {},
- SteamUsers = {},
- SteamGCs = {},
- SteamFriends = {},
- process = require("process"),
- steamID = process.argv[2],
- ClientHello = 4006,
- ClientWelcome = 4004;
- var accounts = [];
- var arrayAccountsTxt = fs.readFileSync("accounts.txt").toString().split("\n");
- for (i in arrayAccountsTxt) {
- var accInfo = arrayAccountsTxt[i].toString().trim().split(":");
- var username = accInfo[0];
- var password = accInfo[1];
- accounts[i] = [];
- accounts[i].push({
- username: username,
- password: password
- });
- }
- var size = 0;
- size = arrayAccountsTxt.length;
- arrayAccountsTxt.forEach(processSteamCommend);
- function processSteamCommend(element, indexElement, array) {
- if (element != "") {
- var account = element.toString().trim().split(":");
- var account_name = account[0];
- var password = account[1];
- SteamClients[indexElement] = new Steam.SteamClient();
- SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]);
- SteamGCs[indexElement] = new Steam.SteamGameCoordinator(SteamClients[indexElement], 730);
- SteamFriends[indexElement] = new Steam.SteamFriends(SteamClients[indexElement]);
- SteamClients[indexElement].connect();
- var sentryfile;
- if(fs.existsSync(account_name + '.sentry')) {
- sentryfile = fs.readFileSync(account_name + '.sentry');
- }
- SteamClients[indexElement].on("connected", function() {
- if(fs.existsSync(account_name + '.sentry')) {
- SteamUsers[indexElement].logOn({
- account_name: account_name,
- password: password,
- sha_sentryfile: sentryfile
- });
- } else {
- SteamUsers[indexElement].logOn({
- account_name: account_name,
- password: password
- });
- }
- });
- SteamClients[indexElement].on("logOnResponse", function(res) {
- if (res.eresult !== Steam.EResult.OK) {
- if (res.eresult == Steam.EResult.ServiceUnavailable) {
- console.log("\nLogin failed! STEAM IS DOWN!");
- SteamClients[indexElement].disconnect();
- process.exit();
- } else {
- if (CountCommends == size)
- {
- console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
- process.exit();
- }
- console.log("Login failed!");
- SteamClients[indexElement].disconnect();
- SteamClients.splice(indexElement, 1);
- SteamFriends.splice(indexElement, 1);
- SteamGCs.splice(indexElement, 1);
- SteamUsers.splice(indexElement, 1);
- IntervalIntArray.splice(indexElement, 1);
- }
- } else {
- SteamFriends[indexElement].setPersonaState(Steam.EPersonaState.Offline);
- SteamUsers[indexElement].gamesPlayed({
- games_played: [{
- game_id: 730
- }]
- });
- if (SteamGCs[indexElement]) {
- IntervalIntArray[indexElement] = setInterval(function() {
- SteamGCs[indexElement].send({
- msg: ClientHello,
- proto: {}
- }, new Protos.CMsgClientHello({}).toBuffer());
- }, 2000);
- console.log("Communicating with GameCoordinator...");
- } else {
- SteamClients[indexElement].disconnect();
- SteamClients.splice(indexElement, 1);
- SteamFriends.splice(indexElement, 1);
- SteamGCs.splice(indexElement, 1);
- SteamUsers.splice(indexElement, 1);
- IntervalIntArray.splice(indexElement, 1);
- }
- }
- });
- SteamClients[indexElement].on("error", function(err) {
- console.log("Commend request was declined! Probably the accounts are in cooldown from another Commend! Try again later :(\n" + err);
- size = size - 1;
- if (CountCommends == size)
- {
- console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
- process.exit();
- }
- SteamClients[indexElement].disconnect();
- SteamClients.splice(indexElement, 1);
- SteamFriends.splice(indexElement, 1);
- SteamGCs.splice(indexElement, 1);
- SteamUsers.splice(indexElement, 1);
- IntervalIntArray.splice(indexElement, 1);
- });
- SteamGCs[indexElement].on("message", function(header, buffer, callback) {
- switch (header.msg) {
- case ClientWelcome:
- clearInterval(IntervalIntArray[indexElement]);
- console.log("Connection with GameCoordinator established!");
- console.log("Commend request sent!");
- IntervalIntArray[indexElement] = setInterval(function() {
- sendCommend(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID);
- }, 2000);
- break;
- case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello:
- console.log("Commend request accepted!");
- break;
- case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse:
- console.log("[GameCoordinator] - " + CountCommends + " Commend with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientCommendResponse.decode(buffer).confirmationId.toString() + " sent!");
- if (CountCommends == size)
- {
- console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
- }
- SteamClients[indexElement].disconnect();
- SteamClients.splice(indexElement, 1);
- SteamFriends.splice(indexElement, 1);
- SteamGCs.splice(indexElement, 1);
- SteamUsers.splice(indexElement, 1);
- IntervalIntArray.splice(indexElement, 1);
- break;
- default:
- console.log(header);
- break;
- }
- });
- }
- }
- function sendCommend(GC, Client, account_name) {
- var account_id = new SteamID(steamID).accountid;
- var commend_payload = new Protos.PlayerCommendationInfo({
- cmdFriendly: 1,
- cmdTeaching: 2,
- cmdLeader: 4
- });
- GC.send({
- msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientCommendPlayer,
- proto: {}
- }, new Protos.CMsgGCCStrike15_v2_ClientCommendPlayer({
- accountId: account_id,
- matchId: 8,
- commendation: commend_payload
- }).toBuffer());
- CountCommends++;
- console.log("[GameCoordinator] - " + CountCommends + " Commends Sended!");
- if (CountCommends == size)
- {
- console.log("\n\n"+ CountCommends + " Commends Sended.\nInjectedBoy$ Commend Bot @ 2K99\nCredits for the Script to Radat, Askwrite & TROLOLO");
- process.exit();
- }
- SteamClients[indexElement].disconnect();
- SteamClients.splice(indexElement, 1);
- SteamFriends.splice(indexElement, 1);
- SteamGCs.splice(indexElement, 1);
- SteamUsers.splice(indexElement, 1);
- IntervalIntArray.splice(indexElement, 1);
- }
- process.on("uncaughtException", function(err) {});
- console.log("Commending SteamID: " + steamID + "\nStarting Accounts...");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement