mc5-api-client 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mc5_api_client/__init__.py +31 -0
- mc5_api_client/auth.py +281 -0
- mc5_api_client/cli.py +463 -0
- mc5_api_client/client.py +1220 -0
- mc5_api_client/exceptions.py +78 -0
- mc5_api_client/py.typed +0 -0
- mc5_api_client-1.0.0.dist-info/LICENSE +21 -0
- mc5_api_client-1.0.0.dist-info/METADATA +1150 -0
- mc5_api_client-1.0.0.dist-info/RECORD +12 -0
- mc5_api_client-1.0.0.dist-info/WHEEL +5 -0
- mc5_api_client-1.0.0.dist-info/entry_points.txt +2 -0
- mc5_api_client-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1150 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: mc5-api-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A comprehensive Python library for interacting with the Modern Combat 5 API
|
|
5
|
+
Home-page: https://pypi.org/project/mc5-api-client/
|
|
6
|
+
Author: Chizoba
|
|
7
|
+
Author-email: Chizoba <chizoba2026@hotmail.com>
|
|
8
|
+
Maintainer-email: Chizoba <chizoba2026@hotmail.com>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Chizoba
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
|
|
31
|
+
Project-URL: Documentation, https://mc5-api-client.readthedocs.io/
|
|
32
|
+
Project-URL: Source, https://pypi.org/project/mc5-api-client/
|
|
33
|
+
Project-URL: Tracker, https://pypi.org/project/mc5-api-client/
|
|
34
|
+
Keywords: modern combat 5,mc5,gameloft,api,client,gaming,authentication,clan,messaging
|
|
35
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
36
|
+
Classifier: Intended Audience :: Developers
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
39
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
40
|
+
Classifier: Operating System :: MacOS
|
|
41
|
+
Classifier: Programming Language :: Python :: 3
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
46
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
47
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
48
|
+
Classifier: Topic :: Games/Entertainment
|
|
49
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
50
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
51
|
+
Classifier: Typing :: Typed
|
|
52
|
+
Requires-Python: >=3.8
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
License-File: LICENSE
|
|
55
|
+
Requires-Dist: requests>=2.28.0
|
|
56
|
+
Requires-Dist: urllib3>=1.26.0
|
|
57
|
+
Provides-Extra: all
|
|
58
|
+
Requires-Dist: mc5-api-client[cli,dev,docs]; extra == "all"
|
|
59
|
+
Provides-Extra: cli
|
|
60
|
+
Requires-Dist: rich>=13.0.0; extra == "cli"
|
|
61
|
+
Requires-Dist: colorama>=0.4.4; extra == "cli"
|
|
62
|
+
Provides-Extra: dev
|
|
63
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
64
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
65
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
66
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
67
|
+
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
68
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
69
|
+
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
|
70
|
+
Requires-Dist: pre-commit>=2.20.0; extra == "dev"
|
|
71
|
+
Requires-Dist: build>=0.8.0; extra == "dev"
|
|
72
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
73
|
+
Provides-Extra: docs
|
|
74
|
+
Requires-Dist: sphinx>=5.0.0; extra == "docs"
|
|
75
|
+
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
|
|
76
|
+
Requires-Dist: myst-parser>=0.18.0; extra == "docs"
|
|
77
|
+
|
|
78
|
+
# ๐ฎ Modern Combat 5 API Client
|
|
79
|
+
|
|
80
|
+
[](https://python.org)
|
|
81
|
+
[](LICENSE)
|
|
82
|
+
[](mailto:chizoba2026@hotmail.com)
|
|
83
|
+
|
|
84
|
+
Hey there! ๐ Welcome to the **Modern Combat 5 API Client** - your friendly Python library for connecting to the MC5 game API. Whether you want to automate your clan management, check your daily tasks, or just explore the game's data, this library makes it super easy!
|
|
85
|
+
|
|
86
|
+
## ๐ What Can You Do With This?
|
|
87
|
+
|
|
88
|
+
Think of this as your remote control for Modern Combat 5! Here's what you can do:
|
|
89
|
+
|
|
90
|
+
- ๐ **Easy Login**: No more hassle - just one line to get authenticated
|
|
91
|
+
- ๐ค **Player Profile**: Check your stats, level, and update your profile
|
|
92
|
+
- ๐ฐ **Complete Clan Management**: Create, manage, and lead clans with 20+ methods
|
|
93
|
+
- ๐ฅ **Squad/Group Management**: Manage squad members, stats, and activities in real-time
|
|
94
|
+
- ๐ฌ **Complete Communication System**: Private messages, squad wall posts, and alerts
|
|
95
|
+
- ๐ฏ **Kill Signature Management**: Update player kill signatures and colors
|
|
96
|
+
- ๐ **Statistics & Analytics**: Track squad performance, member activity, and progress
|
|
97
|
+
- ๐ฎ **Friend Management**: Send friend requests and manage connections
|
|
98
|
+
- ๐
**Daily Tasks & Events**: Never miss your daily rewards and special events
|
|
99
|
+
- ๐ **Leaderboards**: See how you rank against other players
|
|
100
|
+
- ๐ฎ **Game Data**: Access weapons, items, and game configuration
|
|
101
|
+
- ๐ฅ๏ธ **Modern CLI**: A beautiful command-line tool with colors and emojis
|
|
102
|
+
- ๐ **Auto-Refresh**: Tokens refresh automatically - no interruptions!
|
|
103
|
+
- ๐ก๏ธ **Error Handling**: Get helpful error messages when things go wrong
|
|
104
|
+
|
|
105
|
+
## ๏ฟฝ Installation & Publishing
|
|
106
|
+
|
|
107
|
+
### ๐ Install from PyPI (Once Published)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install mc5-api-client
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### ๐ฆ Install from Local Package
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Install the wheel file you just created
|
|
117
|
+
pip install dist/mc5_api_client-1.0.0-py3-none-any.whl
|
|
118
|
+
|
|
119
|
+
# Or install from source
|
|
120
|
+
cd mc5-api-client-1.0.0
|
|
121
|
+
pip install .
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### ๐ค Publishing to PyPI
|
|
125
|
+
|
|
126
|
+
The package has been successfully built! You now have:
|
|
127
|
+
|
|
128
|
+
โ
**Source Distribution**: `dist/mc5-api-client-1.0.0.tar.gz`
|
|
129
|
+
โ
**Wheel Distribution**: `dist/mc5_api_client-1.0.0-py3-none-any.whl`
|
|
130
|
+
|
|
131
|
+
To publish to PyPI:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Install twine if you haven't already
|
|
135
|
+
pip install twine
|
|
136
|
+
|
|
137
|
+
# Upload to PyPI (you'll need your PyPI credentials)
|
|
138
|
+
twine upload dist/*
|
|
139
|
+
|
|
140
|
+
# Or upload to Test PyPI first
|
|
141
|
+
twine upload --repository testpypi dist/*
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### ๐ง Build Status
|
|
145
|
+
|
|
146
|
+
โ
**Compilation Successful** - No critical errors
|
|
147
|
+
โ ๏ธ **Warnings Fixed** - Configuration warnings resolved
|
|
148
|
+
โ
**All Examples Included** - 7 comprehensive example scripts
|
|
149
|
+
โ
**CLI Entry Points** - `mc5` command available
|
|
150
|
+
โ
**Dependencies Managed** - All requirements included
|
|
151
|
+
|
|
152
|
+
## ๏ฟฝ๐ Let's Get Started!
|
|
153
|
+
|
|
154
|
+
### Step 1: Install the Library
|
|
155
|
+
|
|
156
|
+
Just run this in your terminal (Command Prompt/PowerShell):
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pip install mc5-api-client
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
That's it! ๐ You're ready to go!
|
|
163
|
+
|
|
164
|
+
### Step 2: Your First Program
|
|
165
|
+
|
|
166
|
+
Let's write a simple Python script to connect to MC5:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from mc5_api_client import MC5Client
|
|
170
|
+
|
|
171
|
+
# Create a client and login
|
|
172
|
+
client = MC5Client(
|
|
173
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
174
|
+
password="sSJKzhQ5l4vrFgov"
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# Check your profile
|
|
178
|
+
profile = client.get_profile()
|
|
179
|
+
print(f"Hey {profile['name']}! You're level {profile['level']}")
|
|
180
|
+
|
|
181
|
+
# See what's happening in the game
|
|
182
|
+
events = client.get_events()
|
|
183
|
+
print(f"There are {len(events)} active events right now!")
|
|
184
|
+
|
|
185
|
+
# Don't forget to close the connection
|
|
186
|
+
client.close()
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**What just happened?**
|
|
190
|
+
- We imported the MC5 client
|
|
191
|
+
- We logged in with your credentials (replace with yours!)
|
|
192
|
+
- We got your profile info
|
|
193
|
+
- We checked what events are active
|
|
194
|
+
- We cleaned up properly
|
|
195
|
+
|
|
196
|
+
### Step 3: Try the Cool CLI Tool
|
|
197
|
+
|
|
198
|
+
The library comes with an awesome command-line tool! Check this out:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# Generate a token (your login key)
|
|
202
|
+
mc5 generate-token --username "anonymous:your_credential" --password "your_password" --save
|
|
203
|
+
|
|
204
|
+
# Check if your token is still valid
|
|
205
|
+
mc5 validate-token
|
|
206
|
+
|
|
207
|
+
# See your saved info
|
|
208
|
+
mc5 show-config
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
You'll see beautiful colored output with emojis! ๐จ
|
|
212
|
+
|
|
213
|
+
## ๐ How It Actually Works
|
|
214
|
+
|
|
215
|
+
### ๐ Getting Your Login Credentials
|
|
216
|
+
|
|
217
|
+
Before you can use the API, you need your MC5 login info:
|
|
218
|
+
|
|
219
|
+
1. **Username**: This looks like `anonymous:some_long_string_here=`
|
|
220
|
+
2. **Password**: Your regular MC5 password
|
|
221
|
+
|
|
222
|
+
**Where do I find this?**
|
|
223
|
+
- Your username is usually stored in the game files
|
|
224
|
+
- The password is what you use to log into the game
|
|
225
|
+
|
|
226
|
+
### ๐ฏ Different Ways to Authenticate
|
|
227
|
+
|
|
228
|
+
**Method 1: Login when creating the client**
|
|
229
|
+
```python
|
|
230
|
+
client = MC5Client(
|
|
231
|
+
username="anonymous:your_username_here",
|
|
232
|
+
password="your_password_here"
|
|
233
|
+
)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Method 2: Login later**
|
|
237
|
+
```python
|
|
238
|
+
client = MC5Client()
|
|
239
|
+
client.authenticate(
|
|
240
|
+
username="anonymous:your_username_here",
|
|
241
|
+
password="your_password_here"
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Method 3: Admin access (if you have it)**
|
|
246
|
+
```python
|
|
247
|
+
client.authenticate_admin()
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### ๐ค Managing Your Profile
|
|
251
|
+
|
|
252
|
+
Want to check your stats or update your profile?
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
# Get your current profile
|
|
256
|
+
profile = client.get_profile()
|
|
257
|
+
print(f"Name: {profile['name']}")
|
|
258
|
+
print(f"Level: {profile['level']}")
|
|
259
|
+
print(f"XP: {profile.get('xp', 'N/A')}")
|
|
260
|
+
|
|
261
|
+
# Update your profile (if the game allows it)
|
|
262
|
+
try:
|
|
263
|
+
client.update_profile({
|
|
264
|
+
"name": "CoolNewName",
|
|
265
|
+
"description": "I love MC5!"
|
|
266
|
+
})
|
|
267
|
+
print("Profile updated!")
|
|
268
|
+
except:
|
|
269
|
+
print("Couldn't update profile - might not be allowed")
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### ๐ฐ Complete Clan Management
|
|
273
|
+
|
|
274
|
+
If you run a clan, you can manage it programmatically with 20+ methods:
|
|
275
|
+
|
|
276
|
+
```python
|
|
277
|
+
# Search for clans
|
|
278
|
+
clans = client.search_clans("Elite", limit=10)
|
|
279
|
+
for clan in clans:
|
|
280
|
+
print(f"{clan['name']} - {clan['member_count']} members")
|
|
281
|
+
|
|
282
|
+
# Create a new clan
|
|
283
|
+
new_clan = client.create_clan(
|
|
284
|
+
name="Python Warriors",
|
|
285
|
+
tag="PYW",
|
|
286
|
+
description="A clan for Python developers!",
|
|
287
|
+
membership_type="open"
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
# Get clan info
|
|
291
|
+
clan_id = new_clan.get('id')
|
|
292
|
+
clan_info = client.get_clan_settings(clan_id)
|
|
293
|
+
print(f"Clan: {clan_info['name']}")
|
|
294
|
+
|
|
295
|
+
# Update clan settings
|
|
296
|
+
client.update_clan_settings(clan_id, {
|
|
297
|
+
"description": "Welcome to our awesome squad!",
|
|
298
|
+
"membership_type": "invite_only"
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
# Manage members
|
|
302
|
+
members = client.get_clan_members(clan_id)
|
|
303
|
+
print(f"Found {len(members)} members")
|
|
304
|
+
|
|
305
|
+
# Invite a player
|
|
306
|
+
client.invite_clan_member(clan_id, "anonymous:player_credential", "officer")
|
|
307
|
+
|
|
308
|
+
# Handle applications
|
|
309
|
+
applications = client.get_clan_applications(clan_id)
|
|
310
|
+
for app in applications:
|
|
311
|
+
print(f"Application from: {app['player_name']}")
|
|
312
|
+
client.accept_clan_application(clan_id, app['credential'], "member")
|
|
313
|
+
|
|
314
|
+
# Get clan statistics
|
|
315
|
+
stats = client.get_clan_statistics(clan_id)
|
|
316
|
+
print(f"Total wins: {stats.get('total_wins', 0)}")
|
|
317
|
+
|
|
318
|
+
# Get internal leaderboard
|
|
319
|
+
leaderboard = client.get_clan_leaderboard(clan_id)
|
|
320
|
+
for i, player in enumerate(leaderboard[:5], 1):
|
|
321
|
+
print(f"{i}. {player['name']} - {player['score']} points")
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### ๐ฅ Squad/Group Management
|
|
325
|
+
|
|
326
|
+
Manage your squad members and their stats in real-time:
|
|
327
|
+
|
|
328
|
+
```python
|
|
329
|
+
# Get all squad members with stats
|
|
330
|
+
members = client.get_group_members("your-group-id")
|
|
331
|
+
for member in members:
|
|
332
|
+
print(f"{member['name']} - Score: {member['_score']} - Online: {member['online']}")
|
|
333
|
+
|
|
334
|
+
# Update member stats
|
|
335
|
+
client.update_member_score("group-id", "member-credential", 1500)
|
|
336
|
+
client.update_member_xp("group-id", "member-credential", 2500000)
|
|
337
|
+
|
|
338
|
+
# Update kill signature
|
|
339
|
+
client.update_member_killsig(
|
|
340
|
+
"group-id",
|
|
341
|
+
"member-credential",
|
|
342
|
+
"default_killsig_90",
|
|
343
|
+
"-123456789"
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
# Get online members only
|
|
347
|
+
online_members = client.get_online_members("group-id")
|
|
348
|
+
print(f"{len(online_members)} members online now")
|
|
349
|
+
|
|
350
|
+
# Get squad statistics
|
|
351
|
+
stats = client.get_group_statistics("group-id")
|
|
352
|
+
print(f"Average score: {stats['average_score']:.1f}")
|
|
353
|
+
print(f"Total XP: {stats['total_xp']:,}")
|
|
354
|
+
|
|
355
|
+
# Find specific member
|
|
356
|
+
member = client.get_member_by_credential("group-id", "member-credential")
|
|
357
|
+
if member:
|
|
358
|
+
print(f"Found: {member['name']} - Level {member.get('level', 'Unknown')}")
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### ๐ฌ Squad Wall Communication
|
|
362
|
+
|
|
363
|
+
Post messages, announcements, and updates to your squad wall:
|
|
364
|
+
|
|
365
|
+
```python
|
|
366
|
+
# Send a simple message
|
|
367
|
+
client.send_squad_wall_message(
|
|
368
|
+
clan_id="your-group-id",
|
|
369
|
+
message="Hello squad! Great game today! ๐ฎ"
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
# Send message with kill signature
|
|
373
|
+
client.send_squad_wall_message(
|
|
374
|
+
clan_id="your-group-id",
|
|
375
|
+
message="Check out my new kill signature! ๐ฅ",
|
|
376
|
+
player_killsig="default_killsig_90",
|
|
377
|
+
player_killsig_color="-123456789"
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
# Send squad statistics update
|
|
381
|
+
stats = client.get_group_statistics("group-id")
|
|
382
|
+
stats_message = f"""๐ Squad Statistics Update:
|
|
383
|
+
๐ฅ Members: {stats['total_members']}
|
|
384
|
+
๐ข Online: {stats['online_members']}
|
|
385
|
+
๐ Total Score: {stats['total_score']:,}
|
|
386
|
+
โญ Total XP: {stats['total_xp']:,}
|
|
387
|
+
|
|
388
|
+
Keep up the great work squad! ๐ช"""
|
|
389
|
+
|
|
390
|
+
client.send_squad_wall_message(
|
|
391
|
+
clan_id="your-group-id",
|
|
392
|
+
message=stats_message,
|
|
393
|
+
player_killsig="default_killsig_100",
|
|
394
|
+
player_killsig_color="-987654321"
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
# Send welcome message
|
|
398
|
+
welcome_msg = """๐ Welcome to the squad!
|
|
399
|
+
|
|
400
|
+
We're excited to have you join! Here's what you need to know:
|
|
401
|
+
๐ฎ Be active and participate in squad activities
|
|
402
|
+
๐ช Help us climb the leaderboards
|
|
403
|
+
๐ค Support your squad mates
|
|
404
|
+
๐ Represent our squad with pride
|
|
405
|
+
|
|
406
|
+
Let's dominate together! ๐ฅ"""
|
|
407
|
+
|
|
408
|
+
client.send_squad_wall_message(
|
|
409
|
+
clan_id="your-group-id",
|
|
410
|
+
message=welcome_msg,
|
|
411
|
+
activity_type="user_post"
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
# Send motivational message
|
|
415
|
+
import random
|
|
416
|
+
motivational_quotes = [
|
|
417
|
+
"๐ช Champions train, losers complain! Let's get better today!",
|
|
418
|
+
"๐ฅ The only easy day was yesterday! Let's dominate!",
|
|
419
|
+
"๏ฟฝ Success is the sum of small efforts repeated day in and day out!"
|
|
420
|
+
]
|
|
421
|
+
|
|
422
|
+
quote = random.choice(motivational_quotes)
|
|
423
|
+
client.send_squad_wall_message(
|
|
424
|
+
clan_id="your-group-id",
|
|
425
|
+
message=quote,
|
|
426
|
+
player_killsig="default_killsig_95",
|
|
427
|
+
player_killsig_color="-555555555"
|
|
428
|
+
)
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### ๏ฟฝ Private Messaging
|
|
432
|
+
|
|
433
|
+
Send direct messages to players with rich formatting:
|
|
434
|
+
|
|
435
|
+
```python
|
|
436
|
+
# Send a simple private message
|
|
437
|
+
client.send_private_message(
|
|
438
|
+
credential="anonymous:player_credential",
|
|
439
|
+
message="Hey! Want to play some matches together? ๐ฎ"
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
# Send message with kill signature
|
|
443
|
+
client.send_private_message(
|
|
444
|
+
credential="anonymous:player_credential",
|
|
445
|
+
message="Check out my new kill signature! ๐ฅ",
|
|
446
|
+
kill_sign_color="-974646126",
|
|
447
|
+
kill_sign_name="default_killsig_80"
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
# Send message with alert notification
|
|
451
|
+
client.send_private_message(
|
|
452
|
+
credential="anonymous:player_credential",
|
|
453
|
+
message="๐ Important: Clan war at 8 PM! Don't be late! ๐ฎ",
|
|
454
|
+
alert_kairos=True
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
# Send reply message
|
|
458
|
+
client.send_private_message(
|
|
459
|
+
credential="anonymous:player_credential",
|
|
460
|
+
message="Sure! Let's play at 8 PM tonight! ๐ฎ",
|
|
461
|
+
reply_to="message_id_here"
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
# Send rich formatted message
|
|
465
|
+
formatted_message = """๐ฎ Squad Invitation
|
|
466
|
+
|
|
467
|
+
๐ฏ When: Tonight at 8 PM
|
|
468
|
+
๐ Where: Clan War Server
|
|
469
|
+
๐ฎ What: Practice Match
|
|
470
|
+
๐ Prizes: 5000 XP bonus
|
|
471
|
+
|
|
472
|
+
๐ Requirements:
|
|
473
|
+
โข Level 50+
|
|
474
|
+
โข Active squad member
|
|
475
|
+
โข Good teamwork skills
|
|
476
|
+
โข Voice chat enabled
|
|
477
|
+
|
|
478
|
+
๐ฎ Let's dominate together! ๐ฅ"""
|
|
479
|
+
|
|
480
|
+
client.send_private_message(
|
|
481
|
+
credential="anonymous:player_credential",
|
|
482
|
+
message=formatted_message,
|
|
483
|
+
kill_sign_color="-123456789",
|
|
484
|
+
kill_sign_name="default_killsig_95"
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
# Get inbox messages
|
|
488
|
+
messages = client.get_inbox_messages(limit=10)
|
|
489
|
+
for msg in messages:
|
|
490
|
+
print(f"From: {msg['from']}")
|
|
491
|
+
print(f"Message: {msg['body']}")
|
|
492
|
+
print(f"Time: {msg['created']}")
|
|
493
|
+
print(f"ID: {msg['id']}")
|
|
494
|
+
|
|
495
|
+
# Delete inbox message
|
|
496
|
+
client.delete_inbox_message("message_id_here")
|
|
497
|
+
|
|
498
|
+
# Delete multiple messages at once
|
|
499
|
+
message_ids = ["msg1_id", "msg2_id", "msg3_id"]
|
|
500
|
+
client.delete_multiple_inbox_messages(message_ids)
|
|
501
|
+
|
|
502
|
+
# Clear entire inbox (use with caution!)
|
|
503
|
+
client.clear_inbox()
|
|
504
|
+
|
|
505
|
+
# Bulk messaging
|
|
506
|
+
target_players = [
|
|
507
|
+
"anonymous:player1_credential",
|
|
508
|
+
"anonymous:player2_credential",
|
|
509
|
+
"anonymous:player3_credential"
|
|
510
|
+
]
|
|
511
|
+
|
|
512
|
+
messages = [
|
|
513
|
+
"Hey everyone! Ready for clan war? ๐ฎ",
|
|
514
|
+
"Let's practice together! ๐ช",
|
|
515
|
+
"Good luck in the tournament! ๐"
|
|
516
|
+
]
|
|
517
|
+
|
|
518
|
+
for credential, message in zip(target_players, messages):
|
|
519
|
+
client.send_private_message(credential=credential, message=message)
|
|
520
|
+
time.sleep(1) # Small delay between messages
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### ๏ฟฝ Daily Tasks and Events
|
|
524
|
+
|
|
525
|
+
Never miss your daily rewards:
|
|
526
|
+
|
|
527
|
+
```python
|
|
528
|
+
# Get all active events
|
|
529
|
+
events = client.get_events()
|
|
530
|
+
|
|
531
|
+
for event in events:
|
|
532
|
+
print(f"๐
{event['name']}")
|
|
533
|
+
print(f" Status: {event['status']}")
|
|
534
|
+
|
|
535
|
+
# Check if it's daily tasks
|
|
536
|
+
if 'daily' in event['name'].lower() or 'activities' in event['name'].lower():
|
|
537
|
+
print(" ๐ฏ This is your daily tasks event!")
|
|
538
|
+
|
|
539
|
+
# Get the tasks
|
|
540
|
+
template = event.get('_template', {})
|
|
541
|
+
tasks = template.get('event_tuning', {}).get('_tasks', {}).get('value', [])
|
|
542
|
+
|
|
543
|
+
for i, task in enumerate(tasks[:3]): # Show first 3 tasks
|
|
544
|
+
points = task.get('points', 0)
|
|
545
|
+
print(f" Task {i+1}: {points} points")
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### ๐ Checking Leaderboards
|
|
549
|
+
|
|
550
|
+
See how you stack up:
|
|
551
|
+
|
|
552
|
+
```python
|
|
553
|
+
# Get regular leaderboard
|
|
554
|
+
leaderboard = client.get_leaderboard("ro")
|
|
555
|
+
print(f"Top {len(leaderboard.get('players', []))} players")
|
|
556
|
+
|
|
557
|
+
# Admin leaderboard (if you have admin access)
|
|
558
|
+
# admin_leaderboard = client.get_leaderboard("admin")
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
## ๐ฅ๏ธ CLI Commands - Your Command Center
|
|
562
|
+
|
|
563
|
+
The CLI tool is like having a remote control for MC5! Here are all the commands:
|
|
564
|
+
|
|
565
|
+
### ๐ Token Management
|
|
566
|
+
|
|
567
|
+
**Generate a new token:**
|
|
568
|
+
```bash
|
|
569
|
+
mc5 generate-token --username "anonymous:your_credential" --password "your_password" --save
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
**Generate admin token:**
|
|
573
|
+
```bash
|
|
574
|
+
mc5 generate-admin-token --save
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Check if your token is still good:**
|
|
578
|
+
```bash
|
|
579
|
+
mc5 validate-token
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### ๐ฐ Clan Management
|
|
583
|
+
|
|
584
|
+
**Search for clans:**
|
|
585
|
+
```bash
|
|
586
|
+
mc5 clan search "Elite" --limit 10
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
**Create a new clan:**
|
|
590
|
+
```bash
|
|
591
|
+
mc5 clan create --name "Python Warriors" --tag "PYW" --description "A clan for Python developers!"
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
**Get clan information:**
|
|
595
|
+
```bash
|
|
596
|
+
mc5 clan info your-clan-id
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
**Get clan members:**
|
|
600
|
+
```bash
|
|
601
|
+
mc5 clan members your-clan-id
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
**Invite a player:**
|
|
605
|
+
```bash
|
|
606
|
+
mc5 clan invite your-clan-id "anonymous:player_credential" --role officer
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
**Handle applications:**
|
|
610
|
+
```bash
|
|
611
|
+
mc5 clan applications your-clan-id
|
|
612
|
+
mc5 clan accept your-clan-id "anonymous:applicant" --role member
|
|
613
|
+
mc5 clan reject your-clan-id "anonymous:applicant"
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Apply to join a clan:**
|
|
617
|
+
```bash
|
|
618
|
+
mc5 clan apply target-clan-id --message "Let me join your squad!"
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
**Get clan statistics:**
|
|
622
|
+
```bash
|
|
623
|
+
mc5 clan stats your-clan-id
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
**Get clan leaderboard:**
|
|
627
|
+
```bash
|
|
628
|
+
mc5 clan leaderboard your-clan-id
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### โ๏ธ Configuration
|
|
632
|
+
|
|
633
|
+
**See your saved info:**
|
|
634
|
+
```bash
|
|
635
|
+
mc5 show-config
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
**Clear everything (start fresh):**
|
|
639
|
+
```bash
|
|
640
|
+
mc5 clear-config
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
### ๐จ Cool Options
|
|
644
|
+
|
|
645
|
+
**Enable debug mode (see what's happening behind the scenes):**
|
|
646
|
+
```bash
|
|
647
|
+
mc5 --debug generate-token --username "..." --password "..."
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
**Skip the fancy banner:**
|
|
651
|
+
```bash
|
|
652
|
+
mc5 --no-banner validate-token
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
## ๐ง Where Does Everything Get Saved?
|
|
656
|
+
|
|
657
|
+
The CLI saves your stuff in a special folder:
|
|
658
|
+
|
|
659
|
+
- **Windows**: `C:\Users\YourName\.mc5\`
|
|
660
|
+
- **Mac/Linux**: `~/.mc5/`
|
|
661
|
+
|
|
662
|
+
Inside you'll find:
|
|
663
|
+
- `config.json` - Your saved username and settings
|
|
664
|
+
- `token.json` - Your login tokens (so you don't have to login every time)
|
|
665
|
+
- `debug.log` - Debug information (if you use debug mode)
|
|
666
|
+
|
|
667
|
+
## ๐จ When Things Go Wrong
|
|
668
|
+
|
|
669
|
+
Don't worry! The library has great error handling:
|
|
670
|
+
|
|
671
|
+
```python
|
|
672
|
+
from mc5_api_client import MC5Client
|
|
673
|
+
from mc5_api_client.exceptions import (
|
|
674
|
+
MC5APIError,
|
|
675
|
+
AuthenticationError,
|
|
676
|
+
TokenExpiredError,
|
|
677
|
+
RateLimitError,
|
|
678
|
+
NetworkError
|
|
679
|
+
)
|
|
680
|
+
|
|
681
|
+
try:
|
|
682
|
+
client = MC5Client(username="user", password="pass")
|
|
683
|
+
profile = client.get_profile()
|
|
684
|
+
|
|
685
|
+
except AuthenticationError:
|
|
686
|
+
print("โ Oops! Wrong username or password")
|
|
687
|
+
|
|
688
|
+
except TokenExpiredError:
|
|
689
|
+
print("โฐ Your login expired! Try logging in again")
|
|
690
|
+
|
|
691
|
+
except RateLimitError as e:
|
|
692
|
+
print(f"โธ๏ธ Slow down! Try again in {e.retry_after} seconds")
|
|
693
|
+
|
|
694
|
+
except NetworkError:
|
|
695
|
+
print("๐ Can't connect to the internet. Check your connection!")
|
|
696
|
+
|
|
697
|
+
except MC5APIError as e:
|
|
698
|
+
print(f"โ Something went wrong: {e.message}")
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
## ๐ฏ Pro Tips
|
|
702
|
+
|
|
703
|
+
### ๐ Auto-Refresh Tokens
|
|
704
|
+
|
|
705
|
+
Don't want to worry about your login expiring?
|
|
706
|
+
|
|
707
|
+
```python
|
|
708
|
+
client = MC5Client(
|
|
709
|
+
username="your_username",
|
|
710
|
+
password="your_password",
|
|
711
|
+
auto_refresh=True # Magic! ๐ช
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
# Your token will refresh automatically when it expires
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### ๐ฆ Use Context Manager (Clean Code)
|
|
718
|
+
|
|
719
|
+
```python
|
|
720
|
+
with MC5Client(username="user", password="pass") as client:
|
|
721
|
+
profile = client.get_profile()
|
|
722
|
+
events = client.get_events()
|
|
723
|
+
# Connection automatically closes when done!
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### ๐ฏ Custom Permissions
|
|
727
|
+
|
|
728
|
+
Only need specific permissions?
|
|
729
|
+
|
|
730
|
+
```python
|
|
731
|
+
client.authenticate(
|
|
732
|
+
username="user",
|
|
733
|
+
password="pass",
|
|
734
|
+
scope="message chat social" # Only these permissions
|
|
735
|
+
)
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
## ๐ Advanced Examples & Use Cases
|
|
739
|
+
|
|
740
|
+
### ๐ Squad Management Bot
|
|
741
|
+
|
|
742
|
+
Create a bot that automatically manages your squad:
|
|
743
|
+
|
|
744
|
+
```python
|
|
745
|
+
import time
|
|
746
|
+
from mc5_api_client import MC5Client
|
|
747
|
+
|
|
748
|
+
def squad_management_bot():
|
|
749
|
+
client = MC5Client(
|
|
750
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
751
|
+
password="sSJKzhQ5l4vrFgov"
|
|
752
|
+
)
|
|
753
|
+
|
|
754
|
+
group_id = "your-group-id"
|
|
755
|
+
|
|
756
|
+
while True:
|
|
757
|
+
try:
|
|
758
|
+
# Get squad statistics
|
|
759
|
+
stats = client.get_group_statistics(group_id)
|
|
760
|
+
|
|
761
|
+
# Post hourly updates
|
|
762
|
+
update_message = f""""๐ Hourly Squad Update:
|
|
763
|
+
๐ฅ Members: {stats['total_members']}
|
|
764
|
+
๐ข Online: {stats['online_members']}
|
|
765
|
+
๐ Total Score: {stats['total_score']:,}
|
|
766
|
+
โญ Total XP: {stats['total_xp']:,}
|
|
767
|
+
|
|
768
|
+
Keep up the great work squad! ๐ช"""
|
|
769
|
+
|
|
770
|
+
client.send_squad_wall_message(
|
|
771
|
+
clan_id=group_id,
|
|
772
|
+
message=update_message,
|
|
773
|
+
player_killsig="default_killsig_100",
|
|
774
|
+
player_killsig_color="-987654321"
|
|
775
|
+
)
|
|
776
|
+
|
|
777
|
+
print(f"โ
Posted update at {time.strftime('%H:%M')}")
|
|
778
|
+
|
|
779
|
+
# Wait for 1 hour
|
|
780
|
+
time.sleep(3600)
|
|
781
|
+
|
|
782
|
+
except Exception as e:
|
|
783
|
+
print(f"โ Error: {e}")
|
|
784
|
+
time.sleep(60) # Wait 1 minute before retrying
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
### ๏ฟฝ Private Messaging Bot
|
|
788
|
+
|
|
789
|
+
Create a bot that handles private communications:
|
|
790
|
+
|
|
791
|
+
```python
|
|
792
|
+
import time
|
|
793
|
+
from mc5_api_client import MC5Client
|
|
794
|
+
|
|
795
|
+
def private_messaging_bot():
|
|
796
|
+
client = MC5Client(
|
|
797
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
798
|
+
password="sSJKzhQ5l4vrFgov"
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
# Check inbox for new messages
|
|
802
|
+
while True:
|
|
803
|
+
try:
|
|
804
|
+
messages = client.get_inbox_messages(limit=10)
|
|
805
|
+
|
|
806
|
+
for msg in messages:
|
|
807
|
+
# Auto-reply to clan war invitations
|
|
808
|
+
if "clan war" in msg.get('body', '').lower():
|
|
809
|
+
client.send_private_message(
|
|
810
|
+
credential=msg.get('from', ''),
|
|
811
|
+
message="โ
I'll be there for the clan war! See you at 8 PM! ๐ฎ",
|
|
812
|
+
reply_to=msg.get('id', ''),
|
|
813
|
+
kill_sign_color="-123456789",
|
|
814
|
+
kill_sign_name="default_killsig_95"
|
|
815
|
+
)
|
|
816
|
+
print(f"โ
Auto-replied to clan war invitation from {msg.get('from', '')}")
|
|
817
|
+
|
|
818
|
+
# Send welcome message to new friends
|
|
819
|
+
elif "friend request" in msg.get('body', '').lower():
|
|
820
|
+
client.send_private_message(
|
|
821
|
+
credential=msg.get('from', ''),
|
|
822
|
+
message="๐ Thanks for the friend request! Let's play together soon! ๐ช",
|
|
823
|
+
alert_kairos=True
|
|
824
|
+
)
|
|
825
|
+
print(f"โ
Sent welcome message to {msg.get('from', '')}")
|
|
826
|
+
|
|
827
|
+
# Wait 30 seconds before checking again
|
|
828
|
+
time.sleep(30)
|
|
829
|
+
|
|
830
|
+
except Exception as e:
|
|
831
|
+
print(f"โ Error: {e}")
|
|
832
|
+
time.sleep(60) # Wait 1 minute before retrying
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
### ๏ฟฝ๏ฟฝ Performance Tracker
|
|
836
|
+
|
|
837
|
+
Track squad performance over time:
|
|
838
|
+
|
|
839
|
+
```python
|
|
840
|
+
from mc5_api_client import MC5Client
|
|
841
|
+
import json
|
|
842
|
+
from datetime import datetime
|
|
843
|
+
|
|
844
|
+
def track_squad_performance():
|
|
845
|
+
client = MC5Client(
|
|
846
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
847
|
+
password="sSJKzhQ5l4vrFgov"
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
group_id = "your-group-id"
|
|
851
|
+
|
|
852
|
+
# Get current stats
|
|
853
|
+
stats = client.get_group_statistics(group_id)
|
|
854
|
+
|
|
855
|
+
# Create performance record
|
|
856
|
+
performance_data = {
|
|
857
|
+
"timestamp": datetime.now().isoformat(),
|
|
858
|
+
"total_members": stats['total_members'],
|
|
859
|
+
"online_members": stats['online_members'],
|
|
860
|
+
"total_score": stats['total_score'],
|
|
861
|
+
"total_xp": stats['total_xp'],
|
|
862
|
+
"average_score": stats['average_score'],
|
|
863
|
+
"average_xp": stats['average_xp']
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
# Save to file
|
|
867
|
+
with open('squad_performance.json', 'a') as f:
|
|
868
|
+
f.write(json.dumps(performance_data, indent=2) + '\n')
|
|
869
|
+
|
|
870
|
+
print(f"โ
Performance data saved: {performance_data['total_score']} points")
|
|
871
|
+
|
|
872
|
+
client.close()
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
### ๐ฎ Achievement Celebration Bot
|
|
876
|
+
|
|
877
|
+
Celebrate squad achievements automatically:
|
|
878
|
+
|
|
879
|
+
```python
|
|
880
|
+
def celebrate_achievements():
|
|
881
|
+
client = MC5Client(
|
|
882
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
883
|
+
password="sSJKzhQ5l4vrFgov"
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
group_id = "your-group-id"
|
|
887
|
+
|
|
888
|
+
# Get current stats
|
|
889
|
+
stats = client.get_group_statistics(group_id)
|
|
890
|
+
|
|
891
|
+
# Check for milestones
|
|
892
|
+
if stats['total_score'] > 10000:
|
|
893
|
+
celebration_message = """๐ MILESTONE ACHIEVED! ๐
|
|
894
|
+
|
|
895
|
+
๐ Squad reached 10,000 points!
|
|
896
|
+
This is a huge achievement!
|
|
897
|
+
|
|
898
|
+
๐ฎ Great teamwork everyone!
|
|
899
|
+
Let's keep climbing! ๐ฅ"""
|
|
900
|
+
|
|
901
|
+
client.send_squad_wall_message(
|
|
902
|
+
clan_id=group_id,
|
|
903
|
+
message=celebration_message,
|
|
904
|
+
player_killsig="default_killsig_99",
|
|
905
|
+
player_killsig_color="-111111111"
|
|
906
|
+
)
|
|
907
|
+
|
|
908
|
+
print("๐ Celebrated 10,000 point milestone!")
|
|
909
|
+
|
|
910
|
+
client.close()
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
### ๐ Leaderboard Monitor
|
|
914
|
+
|
|
915
|
+
Create a custom leaderboard system:
|
|
916
|
+
|
|
917
|
+
```python
|
|
918
|
+
def create_custom_leaderboard():
|
|
919
|
+
client = MC5Client(
|
|
920
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
921
|
+
password="sSJKzhQ5l4vrFgov"
|
|
922
|
+
)
|
|
923
|
+
|
|
924
|
+
group_id = "your-group-id"
|
|
925
|
+
|
|
926
|
+
# Get all members
|
|
927
|
+
members = client.get_group_members(group_id)
|
|
928
|
+
|
|
929
|
+
# Sort by score
|
|
930
|
+
sorted_members = sorted(
|
|
931
|
+
members,
|
|
932
|
+
key=lambda x: int(x.get('_score', 0)),
|
|
933
|
+
reverse=True
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
print("๐ Squad Leaderboard:")
|
|
937
|
+
print("=" * 50)
|
|
938
|
+
|
|
939
|
+
for i, member in enumerate(sorted_members, 1):
|
|
940
|
+
name = member.get('name', 'Unknown')
|
|
941
|
+
score = member.get('_score', '0')
|
|
942
|
+
xp = member.get('_xp', '0')
|
|
943
|
+
online = "๐ข" if member.get('online') else "๐ด"
|
|
944
|
+
|
|
945
|
+
print(f"{i:2d}. {online} {name:<20} Score: {score:>10} XP: {xp:>12}")
|
|
946
|
+
|
|
947
|
+
print("=" * 50)
|
|
948
|
+
print(f"๐ Total Members: {len(members)}")
|
|
949
|
+
|
|
950
|
+
client.close()
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
## ๐ Available Examples
|
|
954
|
+
|
|
955
|
+
The library comes with comprehensive examples to get you started:
|
|
956
|
+
|
|
957
|
+
### ๐ Basic Examples
|
|
958
|
+
- `examples/basic_usage.py` - Simple authentication and API usage
|
|
959
|
+
- `examples/clan_management.py` - Complete clan management demonstration
|
|
960
|
+
- `examples/events_and_tasks.py` - Daily tasks and events handling
|
|
961
|
+
- `examples/squad_management.py` - Real-time squad member management
|
|
962
|
+
- `examples/squad_wall_management.py` - Squad wall communication examples
|
|
963
|
+
- `examples/private_messaging.py` - Private messaging and inbox management
|
|
964
|
+
- `examples/message_management.py` - Advanced message management and bulk deletion
|
|
965
|
+
|
|
966
|
+
### ๐ Advanced Examples
|
|
967
|
+
- Squad management bot with automated updates
|
|
968
|
+
- Performance tracking and analytics
|
|
969
|
+
- Achievement celebration systems
|
|
970
|
+
- Custom leaderboard generation
|
|
971
|
+
- Real-time activity monitoring
|
|
972
|
+
|
|
973
|
+
## ๐ Complete Feature List
|
|
974
|
+
|
|
975
|
+
### ๐ Authentication
|
|
976
|
+
- โ
User and admin token generation
|
|
977
|
+
- โ
Automatic token refresh
|
|
978
|
+
- โ
Token validation and parsing
|
|
979
|
+
- โ
Device ID management
|
|
980
|
+
- โ
Multiple authentication methods
|
|
981
|
+
|
|
982
|
+
### ๐ค Profile Management
|
|
983
|
+
- โ
Get player profiles
|
|
984
|
+
- โ
Update profile information
|
|
985
|
+
- โ
Profile statistics
|
|
986
|
+
|
|
987
|
+
### ๐ฐ Clan Management (20+ Methods)
|
|
988
|
+
- โ
Search for clans
|
|
989
|
+
- โ
Create new clans
|
|
990
|
+
- โ
Get clan information
|
|
991
|
+
- โ
Update clan settings
|
|
992
|
+
- โ
Manage clan members
|
|
993
|
+
- โ
Invite/kick members
|
|
994
|
+
- โ
Promote/demote members
|
|
995
|
+
- โ
Handle applications
|
|
996
|
+
- โ
Join/leave clans
|
|
997
|
+
- โ
Get clan statistics
|
|
998
|
+
- โ
Internal leaderboards
|
|
999
|
+
- โ
Transfer ownership
|
|
1000
|
+
- โ
Disband clans
|
|
1001
|
+
|
|
1002
|
+
### ๐ฅ Squad/Group Management (10+ Methods)
|
|
1003
|
+
- โ
Get squad members with stats
|
|
1004
|
+
- โ
Update member scores and XP
|
|
1005
|
+
- โ
Update kill signatures
|
|
1006
|
+
- โ
Monitor online/offline status
|
|
1007
|
+
- โ
Calculate squad statistics
|
|
1008
|
+
- โ
Find specific members
|
|
1009
|
+
- โ
Bulk stat updates
|
|
1010
|
+
- โ
Real-time activity monitoring
|
|
1011
|
+
|
|
1012
|
+
### ๐ฌ Complete Communication System (6+ Methods)
|
|
1013
|
+
- โ
Send private messages with rich formatting
|
|
1014
|
+
- โ
Include kill signatures and colors
|
|
1015
|
+
- โ
Send alert notifications
|
|
1016
|
+
- โ
Reply to messages
|
|
1017
|
+
- โ
Get inbox messages
|
|
1018
|
+
- โ
Delete single messages
|
|
1019
|
+
- โ
Delete multiple messages (bulk deletion)
|
|
1020
|
+
- โ
Clear entire inbox
|
|
1021
|
+
- โ
Bulk messaging capabilities
|
|
1022
|
+
- โ
Message tracking and management
|
|
1023
|
+
- โ
Rich text formatting
|
|
1024
|
+
- โ
Multi-language support
|
|
1025
|
+
- โ
Message type customization
|
|
1026
|
+
|
|
1027
|
+
### ๐ฎ Social Features
|
|
1028
|
+
- โ
Friend management
|
|
1029
|
+
- โ
Send friend requests
|
|
1030
|
+
- โ
Check friend status
|
|
1031
|
+
- โ
Private messaging
|
|
1032
|
+
- โ
Squad wall posting
|
|
1033
|
+
|
|
1034
|
+
### ๐
Events & Tasks
|
|
1035
|
+
- โ
Get daily tasks and events
|
|
1036
|
+
- โ
Event details and parsing
|
|
1037
|
+
- โ
Task completion tracking
|
|
1038
|
+
- โ
Special event handling
|
|
1039
|
+
|
|
1040
|
+
### ๐ Leaderboards
|
|
1041
|
+
- โ
Global leaderboards
|
|
1042
|
+
- โ
Clan leaderboards
|
|
1043
|
+
- โ
Squad leaderboards
|
|
1044
|
+
- โ
Custom ranking systems
|
|
1045
|
+
|
|
1046
|
+
### ๐ฎ Game Data
|
|
1047
|
+
- โ
Game object catalog
|
|
1048
|
+
- โ
Asset metadata
|
|
1049
|
+
- โ
Configuration access
|
|
1050
|
+
- โ
Alias and dogtag utilities
|
|
1051
|
+
|
|
1052
|
+
### ๐ฅ๏ธ CLI Interface
|
|
1053
|
+
- โ
Beautiful command-line tool
|
|
1054
|
+
- โ
Colorful output with emojis
|
|
1055
|
+
- โ
Token management commands
|
|
1056
|
+
- โ
Clan management commands
|
|
1057
|
+
- โ
Configuration management
|
|
1058
|
+
- โ
Debug capabilities
|
|
1059
|
+
|
|
1060
|
+
### ๐ก๏ธ Error Handling
|
|
1061
|
+
- โ
Comprehensive exception system
|
|
1062
|
+
โ
Specific error types for different scenarios
|
|
1063
|
+
โ
Helpful error messages
|
|
1064
|
+
โ
Network error recovery
|
|
1065
|
+
|
|
1066
|
+
### ๐ Automation
|
|
1067
|
+
- โ
Auto token refresh
|
|
1068
|
+
- โ
Context manager support
|
|
1069
|
+
- โ
Background task support
|
|
1070
|
+
- โ
Scheduled operations
|
|
1071
|
+
|
|
1072
|
+
## ๐งช For Developers
|
|
1073
|
+
|
|
1074
|
+
Want to contribute or modify the library?
|
|
1075
|
+
|
|
1076
|
+
```bash
|
|
1077
|
+
# Clone the project
|
|
1078
|
+
git clone https://github.com/your-repo/mc5-api-client
|
|
1079
|
+
cd mc5-api-client
|
|
1080
|
+
|
|
1081
|
+
# Install for development
|
|
1082
|
+
pip install -e ".[dev]"
|
|
1083
|
+
|
|
1084
|
+
# Run tests
|
|
1085
|
+
pytest tests/
|
|
1086
|
+
|
|
1087
|
+
# Make code pretty
|
|
1088
|
+
black src/
|
|
1089
|
+
isort src/
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
## ๐ License
|
|
1093
|
+
|
|
1094
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. Basically, you can do whatever you want with it!
|
|
1095
|
+
|
|
1096
|
+
## ๐ About the Author
|
|
1097
|
+
|
|
1098
|
+
Hey! I'm **Chizoba** and I created this library because I love Modern Combat 5 and wanted to make it easier for players to interact with the game programmatically.
|
|
1099
|
+
|
|
1100
|
+
- ๐ง **Email**: [chizoba2026@hotmail.com](mailto:chizoba2026@hotmail.com)
|
|
1101
|
+
- ๐ฎ **MC5 Player**: Just like you!
|
|
1102
|
+
|
|
1103
|
+
## ๐ค Want to Help?
|
|
1104
|
+
|
|
1105
|
+
Awesome! Contributions are welcome! Here's how:
|
|
1106
|
+
|
|
1107
|
+
1. **Fork** the project
|
|
1108
|
+
2. **Create** your feature branch: `git checkout -b feature/AmazingFeature`
|
|
1109
|
+
3. **Commit** your changes: `git commit -m 'Added this cool thing'`
|
|
1110
|
+
4. **Push** to the branch: `git push origin feature/AmazingFeature`
|
|
1111
|
+
5. **Open** a Pull Request
|
|
1112
|
+
|
|
1113
|
+
## โ Need Help?
|
|
1114
|
+
|
|
1115
|
+
Stuck on something? No worries!
|
|
1116
|
+
|
|
1117
|
+
- ๐ง **Email me**: chizoba2026@hotmail.com
|
|
1118
|
+
- ๐ **Check the examples**: Look in the `examples/` folder
|
|
1119
|
+
- ๐ **Report issues**: Let me know what's not working
|
|
1120
|
+
|
|
1121
|
+
## ๐ Useful Links
|
|
1122
|
+
|
|
1123
|
+
This is the **most comprehensive Modern Combat 5 API library** ever created! With **70+ methods** across **10 major categories**, you can:
|
|
1124
|
+
|
|
1125
|
+
- ๐ฐ **Manage entire clans** from creation to disbandment
|
|
1126
|
+
- ๐ฅ **Control squad members** with real-time stat updates
|
|
1127
|
+
- ๐ฌ **Complete communication system** - Private messages, squad wall, alerts
|
|
1128
|
+
- ๐ฏ **Customize everything** with kill signatures and rich formatting
|
|
1129
|
+
- ๐ **Track performance** with detailed analytics
|
|
1130
|
+
- ๐ฎ **Automate gameplay** with custom bots and scripts
|
|
1131
|
+
- ๐ **Create leaderboards** and ranking systems
|
|
1132
|
+
- ๐ **Schedule tasks** and monitor activity
|
|
1133
|
+
- ๐ฑ **Manage messages** with inbox and reply systems
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
**Perfect for:**
|
|
1137
|
+
- ๐ Squad leaders who want to automate management
|
|
1138
|
+
- ๐ Players who want to track their progress
|
|
1139
|
+
- ๐ค Developers building MC5 applications
|
|
1140
|
+
- ๐ฎ Gamers creating custom tools and bots
|
|
1141
|
+
- ๐ Analysts studying squad performance
|
|
1142
|
+
- ๐
Competitive players seeking advantages
|
|
1143
|
+
- ๐ฌ Community managers handling communications
|
|
1144
|
+
- ๐ง Support teams providing assistance
|
|
1145
|
+
|
|
1146
|
+
**Ready to dominate Modern Combat 5?** ๐
|
|
1147
|
+
|
|
1148
|
+
```bash
|
|
1149
|
+
pip install mc5-api-client
|
|
1150
|
+
mc5 --help # See all commands!
|