User Control Panel
Advertisements

HELP US, HELP YOU!

File

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Tue Jun 14, 2005 4:11 pm    Post subject: File Reply with quote

I have a command. When the user enters !create THEIRMESSAGEHERE
it will create a directory called whatever their SN is. Inside the directory will be a .txt file called whatever their sn is. Then, they can enter !open to view the message.

I want to change it so that to create a file, they need to enter !create THEIRMESSAGETITLE:THEIR MESSAGE
And to open a file, they need to enter !open MESSAGETITLE

I know how to do the open command, I just need help with the !create command. I think it involves spliting. If I could get the the title into one variable, and the message into another, I could take it from there.

I am on a different computer, so when I get a chance, I will post the code I currently have.
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 5:48 pm    Post subject: Reply with quote

It's quite simple, if THEIRMESSAGETITLE:THEIR MESSAGE is in $1 you can just do

Code:
my ($Title, $Message) = split (':', $1);


However, if they include : in the title it will get prematurely cut off, for instance..

Code:
my $string = 'thisisa:coloninthetitle:thisisthemessage';
my ($Title, $Message) = split (':', $string);


$Title would contain 'thisisa'
$Message would contain 'coloninthetitle'
and 'thisisthemessage' would be "lost"
Back to top
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Thu Oct 13, 2005 12:42 pm    Post subject: Reply with quote

This is an old topic. I have already finished the command (http://bot-depot.com/phpBB2/viewtopic.php?t=6052), and gone on to harder projects.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group