Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
ifstream help

 
Post new topic   Reply to topic Printable version
 View previous topic  need same random seed with push of a b... Post :: Post Stop ctf flagger from warping back to ...  View next topic  
Author Message
Falco_
Newbie


Age:36
Gender:Gender:Male
Joined: Jun 05 2005
Posts: 4
Location: North Carolina
Offline

PostPosted: Mon Jun 13, 2005 11:28 pm    Post subject: ifstream help Reply to topic Reply with quote

Could someone help me with a top 5 plug. Basically it will record all of the players that have played elim and will search through a file to find the best to worst rec and will display it when you say !top # Does merv support searching through a file and deleting old info? (For example: a name is already in a file, and has its win:loss ratio; i want to change it but del the old info) If there is a better way to do this please tell me because i always code the long way. lol.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Mon Jun 13, 2005 11:54 pm    Post subject: Reply to topic Reply with quote

No merv doesn't support a feature such as this natively. I personally like using INI files because their quick and ez - though they are probably inefficient? But as for you, I'd suggest making your own internal structure - read the data from the file - handling the ordering of the data as you read in each new entry.
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Falco_
Newbie


Age:36
Gender:Gender:Male
Joined: Jun 05 2005
Posts: 4
Location: North Carolina
Offline

PostPosted: Tue Jun 14, 2005 10:32 am    Post subject: ifstream Reply to topic Reply with quote

Quote:
-read the data from the file

so should i do it this way to insert the info?
Code: Show/Hide
//this is for to put the info in the file

ofstream file("topelim.ini", ios::app);
String s;
s += "*arena Game over";
s += " - The Winner is: ";
.....
s += winner->name;
s += " [";
s += wins;
s += "-";
s += losses;
s += "]";

file << winner->name << wins << losses << endl;


If i just keep entering winner->name over and over, it will never replace the old data. Please explain a better way.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:35
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Tue Jun 14, 2005 11:40 am    Post subject: Reply to topic Reply with quote

If you need help making the bot read from a text file such as an INI, refer here.
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Jun 14, 2005 2:57 pm    Post subject: Re: ifstream Reply to topic Reply with quote

Read the data in from the file as you write it out to a temporary file (or a temporary data structure). Update any data you want. Copy the temp file back over the original one (or from the data structure).
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 309 page(s) served in previous 5 minutes.

phpBB Created this page in 0.452237 seconds : 29 queries executed (95.1%): GZIP compression disabled