-
Notifications
You must be signed in to change notification settings - Fork 23
/
bot.js
152 lines (138 loc) · 6.01 KB
/
bot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
var fs = require("fs"),
Steam = require("steam"),
SteamID = require("steamid"),
IntervalIntArray = {},
readlineSync = require("readline-sync"),
Protos = require("./protos/protos.js"),
CountReports = 0,
Long = require("long"),
SteamClients = {},
SteamUsers = {},
SteamGCs = {},
SteamFriends = {},
process = require("process"),
steamID = readlineSync.question("SteamID64 which will be reported: "),
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
});
}
arrayAccountsTxt.forEach(processSteamReport);
function processSteamReport(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();
SteamClients[indexElement].on("connected", function() {
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("\n[STEAM CLIENT - " + account_name + "] Login failed - STEAM IS DOWN!");
console.log(res);
SteamClients[indexElement].disconnect();
process.exit();
} else {
console.log("\n[STEAM CLIENT - " + account_name + "] Login failed!");
console.log(res);
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);
} 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("[STEAM CLIENT - " + account_name + "] Account is probably ingame! Logged out!");
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]);
sendReport(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID);
break;
case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello:
break;
case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse:
CountReports++;
console.log("[GC - " + account_name + "] (" + CountReports + ") Report with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientReportResponse.decode(buffer).confirmationId.toString() + " sent!");
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 sendReport(GC, Client, account_name) {
var account_id = new SteamID(steamID).accountid;
GC.send({
msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer,
proto: {}
}, new Protos.CMsgGCCStrike15_v2_ClientReportPlayer({
accountId: account_id,
matchId: 8,
rptAimbot: 2,
rptWallhack: 3,
rptSpeedhack: 4,
rptTeamharm: 5,
rptTextabuse: 6,
rptVoiceabuse: 7
}).toBuffer());
}
process.on("uncaughtException", function(err) {});
console.log("Initializing ReportBot by askwrite...\nCredits: Trololo - Idea");