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
Morphing Filenames

 
Post new topic   Reply to topic Printable version
 View previous topic  Turret Limiting Bot Post :: Post Ship Respawn Plugin  View next topic  
Author Message
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Mon Dec 29, 2003 12:26 pm    Post subject: Morphing Filenames Reply to topic Reply with quote

I'm trying to use a similar file system to INVBot, with a text file for each player.

Code: Show/Hide
String fname;
fname += p->name;
fname += ".txt";

ifstream file;
file.open(fname, ios::in);

doesnt work, because fname has to be a const char*, and I can't cast fname as one or use the += operator if I change the fname to it off the bat. I also tried append and that didn't work.

Does anybody have a clue how to do this?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Dec 29, 2003 3:08 pm    Post subject: Reply to topic Reply with quote

Don't make a separate text file for each player. That's just... insane.

But if you REALLY want to, derive a class from ifstream and overload open(). That would be fun.

My suggestion would be to use the PrivateProfile Windows SDK functions. Make an INI file with a section for every player.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
cypher
Guest


Offline

PostPosted: Mon Dec 29, 2003 5:00 pm    Post subject: Reply to topic Reply with quote

I agree w/ cyan ... a new file for every player is a tad much insane.. XD
Back to top
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Mon Dec 29, 2003 5:59 pm    Post subject: Reply to topic Reply with quote

Youre using a String datatype when it wants a char*. Read datatypes.h and look for the string class. Find the char* that is in the class, I believe it is "msg". Use file.open(fname.msg) and you should be fine.
_________________
There are no stupid question, but there are many inquisitive idiots.
Loot

Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Dec 29, 2003 6:34 pm    Post subject: Reply to topic Reply with quote

Oops. I feel stupid now.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Dec 30, 2003 1:18 am    Post subject: Reply to topic Reply with quote

k thanks
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Dec 30, 2003 11:36 am    Post subject: Reply to topic Reply with quote

Question: how do you set it up so that it only loads their data if they have data. (ie Someone enters for the first time and has no data to load)

nm, looked in the source for Rampage 2 1/2
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Dec 30, 2003 12:26 pm    Post subject: Reply to topic Reply with quote

Why not just have one file?? Can you imagine how much junk this bot is going to create??
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue Dec 30, 2003 12:37 pm    Post subject: Reply to topic Reply with quote

ROFL Rampage 2 1/2, damn i think of leet versions
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Dec 30, 2003 5:09 pm    Post subject: Reply to topic Reply with quote

i AM using an INI, thats why I looked in rampage's source. 50% is like the King of open-source MERV Plugins
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Dec 30, 2003 6:41 pm    Post subject: Reply to topic Reply with quote

Ok, that stuff in rampage 2 1/2 applied to tags, which I don't need. The problem I have is a new player in the INI. If they're already there, its not a problem. Is there way to check and see if a player is entered and then add them if they're not

heres the structure:
Code: Show/Hide
[Player name]
money=
exp=
level=



BTW, thanks to Splody for his iniaccess.cpp
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Thu Jan 01, 2004 2:46 pm    Post subject: Reply to topic Reply with quote

D1st0rt wrote:
i AM using an INI, thats why I looked in rampage's source. 50% is like the King of open-source MERV Plugins

Hey, all my stuff is open sourced, too, ya know.

D1st0rt wrote:
BTW, thanks to Splody for his iniaccess.cpp

Its dustpuppy's, as the info suggests in the sources. Theres a more cross- platform version of same thing in my subgame-asss converter, though it works better reading and storing to variables, than for getting one variable at a time.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
CypherJF
I gargle nitroglycerin


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

PostPosted: Thu Jan 01, 2004 6:41 pm    Post subject: Reply to topic Reply with quote

Explody -- do you have a new host since sscentral.com is down?
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Fri Jan 02, 2004 10:46 am    Post subject: Reply to topic Reply with quote

I didn't mean nothin, splody. It's just that it seems that 50% is always releasing a new thing on the mervbot site, and all his stuff has the source (unlike some of those greedy bastards who submit plugins without the source)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Fri Jan 02, 2004 11:45 am    Post subject: Reply to topic Reply with quote

explody.ssihosting.com
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Fri Jan 02, 2004 3:59 pm    Post subject: Reply to topic Reply with quote

ok, it all works now with the INI. you guys think I should upload the source once I add a few commands?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Fri Jan 02, 2004 4:54 pm    Post subject: Reply to topic Reply with quote

D1st0rt wrote:
those greedy bastards who submit plugins without the source

Nah no need to put up the source. icon_wink.gif

Hey and those of us who don't put the source in the zip just do so not to confuse the newbies. I'll gladly give my sources away to those who ask.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Fri Jan 02, 2004 4:59 pm    Post subject: Reply to topic Reply with quote

lol I just like to rant every once and a while
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
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: 302 page(s) served in previous 5 minutes.

phpBB Created this page in 0.482896 seconds : 42 queries executed (85.7%): GZIP compression disabled