Author |
Message |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat Dec 30, 2006 3:57 pm Post subject: Confession with Questions too |
 |
|
|
|
Ok I make all my modules in python but the methods I use are not good ones when I store data to files. Right now I have it so that it stores data in individual player files, but invaild file names come up.
I know this is a horrible way of doing it. I need some code to help me.
I need to be able to store something in this format in rank.txt
Name:Money:Exp:Rank
I.E: BDwinsAlt:5000:20:1
I need to be able to write it when they leave and read it when they enter.
Please help me get this working, I would hate for some players to have to change their name. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sat Dec 30, 2006 6:11 pm Post subject: |
 |
|
|
|
Wouldn't it be better to use mysql for storage of such things? _________________
 |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat Dec 30, 2006 6:18 pm Post subject: |
 |
|
|
|
I was thinking of doing mysql, I guess ill give it a try. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:38 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sun Dec 31, 2006 6:55 am Post subject: |
 |
|
|
|
Uh, you should've been able to figure this out by reading one of your last topics: "Custom datafile. Calling back data and storing it.".
But yes, using some database-ish or any other more convenient way should be the way to go with. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Jan 01, 2007 12:03 am Post subject: |
 |
|
|
|
Thanks for redirecting me Solo. I finally understand how that works, I tweaked it a little bit for my own reasons, it's awesome man thanks so much. This may be why the zone crashes, I had a bunch of txt files trying to open and close and I fixed some other things that caused error messages. |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Mon Jan 01, 2007 7:39 pm Post subject: |
 |
|
|
|
This is exactly what the persistent data feature was designed for. You should try using that. It'll be much easier than managing your own database stuff. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Jan 04, 2007 8:19 pm Post subject: |
 |
|
|
|
Is there any way to access the data externally? With mysql for example, you would be able to display everything on a website if you wanted to. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jan 04, 2007 9:37 pm Post subject: |
 |
|
|
|
Yes I was using the same database to use web-based alias on my website. I decided to just use 1 file anyways. Everything is working, but I may try databases later on for other things. |
|
Back to top |
|
 |
|