Forum

> > CS2D > General > Editing your Userstats (Rank/KPD/stuff)
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Editing your Userstats (Rank/KPD/stuff)

11 replies
To the start Previous 1 Next To the start

old Editing your Userstats (Rank/KPD/stuff)

Lee
Moderator Off Offline

Quote
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.

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

SQ
Moderator Off Offline

Quote
Val_Claude has written
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

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

GhostFreak
COMMUNITY BANNED Off Offline

Quote
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

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

Lee
Moderator Off Offline

Quote
spartan029 has written
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.

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

spartan029
User Off Offline

Quote
leegao has written
spartan029 has written
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?

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

Lee
Moderator Off Offline

Quote
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)
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview