Forum

> > CS2D > General > Editing your Userstats (Rank/KPD/stuff)
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Editing your Userstats (Rank/KPD/stuff)

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Editing your Userstats (Rank/KPD/stuff)

Lee
Moderator Off Offline

Zitieren
Download Link:
http://www.speedyshare.com/697961824.html

Usage
If you ever wanted to modify your userstats.dat (the file that contains all of the kills/ranking/info, you'll find that if you tried to open the file in a normal editor, it's just a jumble of weird characters. Well here's program that let's you work with the userstats.dat file. On top of that it can also export the userstats.dat to a SQL file and run it against the MySQL database.

This library requires Python and (optionally) MySQLdb.

Just extract this into your cs2d/sys/stats directory.

Don't forget to read the README (Link) file.

Demos:
Demo (Link)

Example: You want to change everyone's name to "KPD of their_kpd"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from userstats import Stats

#Parse the userstats.dat file
Stats.filename = 'userstats.dat'

#Log into MySQL via username = 'root' and No password 
Stats.login('root')

#Cache the variables. This is very convenient
stats = Stats.stats
model = Stats.model

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#

for player in stats:
	try:
		player.name = "KPD of %s"%str(float(player.kills/player.death))
	except:
		player.name = "KPD of %s"%str(player.kills)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#

#Updates and saves both the MySQL and userstats.dat Data
Stats.run()

You'll find a userstats.dat.backup and a userstats.dat.sql. If you have MySQL installed you'll also find a new database called userstats with a table called stats filled with the userstats information.

alt Re: Editing your Userstats (Rank/KPD/stuff)

SQ
Moderator Off Offline

Zitieren
Val_Claude hat geschrieben
its childhish. play fair and raise ur rank

Leegao just wanna help someone.
Stop posting your useless posts.

@Leegao
Perfect, exacly what I just needed

alt Re: Editing your Userstats (Rank/KPD/stuff)

GhostFreak
COMMUNITY BANNED Off Offline

Zitieren
Val_Claude has written:
its childhish. play fair and raise ur rank

Blazzingxx has written:
Leegao just wanna help someone.
Stop posting your useless posts.

@Leegao
Perfect, exacly what I just needed


dont worry val claude is banned

alt Re: Editing your Userstats (Rank/KPD/stuff)

Lee
Moderator Off Offline

Zitieren
spartan029 hat geschrieben
Thanks leegao. Did you write this program? And is this program universal? Can it open other ".dat" formated files and edit or view them?


No, .dat is just a file extension, this will only work with cs2d's userstats.dat file. Also, note that you must have Python installed in order to use this program.

alt Re: Editing your Userstats (Rank/KPD/stuff)

spartan029
User Off Offline

Zitieren
leegao hat geschrieben
spartan029 hat geschrieben
Thanks leegao. Did you write this program? And is this program universal? Can it open other ".dat" formated files and edit or view them?


No, .dat is just a file extension, this will only work with cs2d's userstats.dat file. Also, note that you must have Python installed in order to use this program.


Oh then I'm screwed. well can you send me a link for it? I will try.

Erm. Did you write the program?

alt Re: Editing your Userstats (Rank/KPD/stuff)

Lee
Moderator Off Offline

Zitieren
yes, it's actually a class library for python. The usage is covered within the readme. It might be a bit advanced for casual users (this was developed to create a rankings site for the [TGV] servers)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht