User Control Panel
Advertisements

HELP US, HELP YOU!

Filtering %2020 out of names?

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
jordanovjarra
Member
Member


Joined: 07 Nov 2003
Posts: 140

Reputation: 33.2Reputation: 33.2Reputation: 33.2

PostPosted: Tue Dec 30, 2003 9:26 pm    Post subject: Reply with quote

Hey when *lazy* join a chat with my bot i use this,

Code:
sub Join {<br />   my ($self,$user,$friendly) = @_;<br />   $self->sendmsg("Welcome $user");<br />}<br />


But, theres a problem because when the user has a space in there name it shows up as %20 and was wondering how i can filter this out ?
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Tue Dec 30, 2003 9:49 pm    Post subject: Reply with quote

Code:
sub Join {<br />my ($self,$user,$friendly) = @_;<br />use URI::Escape;<br />$user = uri_unescape($user);<br />$self->sendmsg("Welcome $user");<br />}


i usually put the use statements at the top of the file with the rest but it is ok there
you could also use

Code:
$user =~ s/%20/ /ig;


but since names are escaped like that might as well unescape them
Back to top
jordanovjarra
Member
Member


Joined: 07 Nov 2003
Posts: 140

Reputation: 33.2Reputation: 33.2Reputation: 33.2

PostPosted: Tue Dec 30, 2003 10:00 pm    Post subject: Reply with quote

thanks keenie, my bots startin to take shape now Smile
Back to top
Sypher
Senior Member
Senior Member


Joined: 01 Jan 2004
Posts: 233
Location: The Netherlands
Reputation: 39.8Reputation: 39.8Reputation: 39.8Reputation: 39.8

PostPosted: Thu Jan 01, 2004 3:40 pm    Post subject: Reply with quote

The code is straaaange (in the first post)

I put it in my bot.pl and only I, the owner, get that message and *lazy* else does...

Strange?

_________________
Sypher
Developer of Codera
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl 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