-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOSW.cpp
More file actions
268 lines (221 loc) · 8.2 KB
/
OSW.cpp
File metadata and controls
268 lines (221 loc) · 8.2 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#include "C:\Users\Home\Desktop\Computer related things\Steam stuff\SteamWorks\Steamworks.h"
#include "Color.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int main()
{
string name;
CSteamAPILoader CSteamAPILoader;
CreateInterfaceFn Steam3Factory = CSteamAPILoader.GetSteam3Factory();
ISteamClient012* ISteamClient = (ISteamClient012*)Steam3Factory(STEAMCLIENT_INTERFACE_VERSION_012, NULL);
HSteamPipe s_Pipe = ISteamClient->CreateSteamPipe();
HSteamUser s_User = ISteamClient->ConnectToGlobalUser(s_Pipe);
ISteamUser005* ISteamUser05 = (ISteamUser005*)ISteamClient->GetISteamUser(s_User, s_Pipe, STEAMUSER_INTERFACE_VERSION_005);
ISteamUser016* ISteamUser = (ISteamUser016*)ISteamClient->GetISteamUser(s_User, s_Pipe, STEAMUSER_INTERFACE_VERSION_016);
ISteamFriends001* ISteamFriend01 = (ISteamFriends001*)ISteamClient->GetISteamFriends(s_User, s_Pipe, STEAMFRIENDS_INTERFACE_VERSION_001);
ISteamFriends013* ISteamFriends = (ISteamFriends013*)ISteamClient->GetISteamFriends(s_User, s_Pipe, STEAMFRIENDS_INTERFACE_VERSION_013);
ISteamUtils002* ISteamUtils02 = (ISteamUtils002*)ISteamClient->GetISteamUtils(s_Pipe, STEAMUTILS_INTERFACE_VERSION_002);
ISteamUtils005* ISteamUtils = (ISteamUtils005*)ISteamClient->GetISteamUtils(s_Pipe, STEAMUTILS_INTERFACE_VERSION_005);
/* Credz to Didrole
for(;;Sleep(1))
{
FriendChatMsg_t friendmsg;
char szMessage[k_cchFriendChatMsgMax + 1];
EChatEntryType eEntryType;
int iMessageSize = ISteamFriends->GetFriendMessage(friendmsg.m_ulFriendID, friendmsg.m_iChatID, szMessage, sizeof(szMessage) - 1, &eEntryType);
szMessage[iMessageSize] = '\0';
*/
if (!ISteamUser->BLoggedOn())
{
cout << "\nYou're not logged on!";
exit(1);
}
else
{
cout << "--[User Stats]--" << endl << endl;
switch(ISteamUser05->IsVACBanned(k_EVACBanSource))
{
case 0:
cout << "Vac Status: ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
cout << "Clean" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
break;
case 1:
cout << "Vac Status: ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "Banned" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
break;
}
cout << "Country: " << ISteamUtils02->GetIPCountry() << endl;
cout << "Your STEAMID: " << ISteamUser->GetSteamID() << endl;
cout << "Your community id: " << ISteamUser->GetSteamID().ConvertToUint64();
switch(ISteamFriends->GetPersonaState())
{
case k_EPersonaStateOnline:
cout << endl << "User is online";
break;
case k_EPersonaStateOffline:
cout << endl << "User is offline";
break;
case k_EPersonaStateAway:
cout << endl << "User is away";
break;
case k_EPersonaStateBusy:
cout << endl << "User is busy";
break;
}
cout << endl << "Friend count: " << ISteamFriends->GetFriendCount(k_EFriendFlagImmediate) << endl << endl;
cout << "--[Your Friends]--" << endl;
cout << endl << "isInGame? || Handle || Chat ID" << endl;
for (int i=0; i<ISteamFriends->GetFriendCount(k_EFriendFlagImmediate); i++)
{
if(ISteamFriends->GetFriendGamePlayed(ISteamFriends->GetFriendByIndex(i, k_EFriendFlagImmediate), NULL))
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
switch(ISteamFriends->GetFriendPersonaState(ISteamFriends->GetFriendByIndex(i,k_EFriendFlagImmediate)))
{
case k_EPersonaStateOnline:
if(ISteamFriends->GetFriendGamePlayed(ISteamFriends->GetFriendByIndex(i, k_EFriendFlagImmediate), NULL))
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10); // Colour is Green
cout << endl << "*In Game* ";
cout << "[Online] ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); // Colour is White
break;
}
else
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
cout << endl << "\t [Online] ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); // Colour is White
break;
case k_EPersonaStateOffline:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); // Colour is Red
cout << endl << "\t [Offline] ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
break;
case k_EPersonaStateAway:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 5); // Colour is Purple
cout << endl << "\t [Away] ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
break;
case k_EPersonaStateBusy:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
cout << endl << "\t [Busy] ";
break;
case k_EPersonaStateSnooze:
cout << endl << "\t [Snooze] ";
break;
case k_EPersonaStateLookingToTrade:
cout << endl << "[L2Trade] ";
break;
case k_EPersonaStateLookingToPlay:
cout << endl << "[L2Play] ";
break;
case k_EPersonaStateMax:
cout << endl << "[Max] ";
break;
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11); // Colour is bright Cyan
cout << "Name: " << ISteamFriends->GetFriendPersonaName( ISteamFriends->GetFriendByIndex(i, k_EFriendFlagImmediate));
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
cout << " [Chat ID]:" << i;
}
while(true)
{
int choice;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
cout << endl << endl << "1->Change Name\n2->Single Chat\n3->Global Chat\n4->Status Spam\nChoice: ";
cin >> choice;
cin.ignore();
if (choice == 1)
{
do
{
cout << endl << "Enter a name: ";
getline(cin, name);
ISteamFriends->SetPersonaName(name.c_str());
}
while(name != "Quit" || "quit" || "QUIT" || "Q" || "q");
}
else if (choice == 2)
{
string message, cool;
int id;
string logo = "[VorteX]: ";
cout << endl << "ID: ";
cin >> id;
cin.ignore();
do
{
cout << endl << "[Message]: ";
getline(cin, message);
cool = logo + message;
ISteamFriends->ReplyToFriendMessage(ISteamFriends->GetFriendByIndex(id, k_EFriendFlagImmediate), cool.c_str());
}
while(message != "Quit");
continue;
}
else if(choice == 3)
{
string message, gCool;
string global = "[Global]: ";
do
{
cout << endl << "Message: ";
getline(cin, message);
gCool = global + message;
for (int j = 0; j <ISteamFriends->GetFriendCount(k_EFriendFlagImmediate); j++)
{
ISteamFriends->ReplyToFriendMessage(ISteamFriends->GetFriendByIndex(j, k_EFriendFlagImmediate), gCool.c_str());
}
}
while(message != "Quit" || "quit" || "QUIT" || "Q" || "q");
break;
}
else if(choice == 4)
{
int iSpam;
do
{
cout << "How many times to spam: ";
cin >> iSpam;
cin.ignore();
for (int l = 0; l<iSpam; l++)
{
Sleep(300);
EPersonaState eState = (EPersonaState)l;
ISteamFriend01->SetPersonaState(eState);
}
}
while(iSpam != 1337);
break;
}
else
{
cout << "Enter 1, 2, 3, 4!";
break;
}
continue;
//if(ISteamFriends->GetFriendMessage(friendmsg.m_ulSenderID, friendmsg.m_iChatID, NULL, 0, EChatEntryType entryType))
}
getchar();
return 0;
}
}