User Control Panel
Advertisements

HELP US, HELP YOU!

Nameme Command. :)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
M4RTIN
Member
Member


Joined: 31 Dec 2004
Posts: 134

Reputation: 19.2Reputation: 19.2

PostPosted: Tue Mar 01, 2005 4:01 pm    Post subject: Reply with quote

Hey everyone,

I saw this on another bot were a user would say:

Quote:
!nameme Hey people


And then the bots name would change to:

Quote:
BotsName | Hey people by martinored


So, i wrote this command. It does exactly the same as it.

Code:
<br /># Fully Coded by Martin<br /><br />if($msg =~ /^nameme (.*)/) <br />{<br />    ($mainname,$theclient) = split (/@/,$username); <br />$bot->{store}->{UsersBotSettings}->{UserDisplayName} = "$1 by $mainname";<br />      $msn->setName( "$bot->{store}->{Settings}->{DisplayName} $bot->{store}->{UsersBotSettings}->{UserDisplayName} }" );<br /><br />}<br />


Very Happy HAVE FUN GUYS!

PS: You may need to change the variables to suit your bot Wink

EDIT:

The split part taken me along time to figure out, so please no harse comments Smile
Back to top
alienz
Almost An Agent
Almost An Agent


Joined: 22 Mar 2004
Posts: 1436
Location: Mars
Reputation: 55.7

PostPosted: Tue Mar 01, 2005 4:38 pm    Post subject: Reply with quote

QUOTE(M4RTIN @ Mar 1 2005, 11:01 AM)
The split part taken me along time to figure out, so please no harse comments Smile

What's so difficult about a split?

_________________
Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Back to top
M4RTIN
Member
Member


Joined: 31 Dec 2004
Posts: 134

Reputation: 19.2Reputation: 19.2

PostPosted: Tue Mar 01, 2005 4:40 pm    Post subject: Reply with quote

It was a new thing to me, and i couldnt get it working untill recently.

Everyone has to learn at some point Smile
Back to top
cornetto soft
Member
Member


Joined: 19 Feb 2004
Posts: 103
Location: Ille et Vilaine - Bretagne - FRANCE
Reputation: 29Reputation: 29Reputation: 29

PostPosted: Tue Mar 01, 2005 5:10 pm    Post subject: Reply with quote

Yeah very good Wink

Don't pay attention to Alienz ! He says a lot of things, but hardly clever.
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Tue Mar 01, 2005 6:13 pm    Post subject: Reply with quote

You will need to "escape" the @, by putting "\" in front of it. Also, use "my" Smile.

Code:
my ($mainname,$theclient) = split (/\@/,$username);


Nice though Smile

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Mar 01, 2005 6:35 pm    Post subject: Reply with quote

QUOTE(cornetto soft @ Mar 1 2005, 12:10 PM)
Yeah very good Wink

Don't pay attention to Alienz ! He says a lot of things, but hardly clever.

Maybe he wasn't trying to be clever. I think it was just sarcasm.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
cornetto soft
Member
Member


Joined: 19 Feb 2004
Posts: 103
Location: Ille et Vilaine - Bretagne - FRANCE
Reputation: 29Reputation: 29Reputation: 29

PostPosted: Tue Mar 01, 2005 7:06 pm    Post subject: Reply with quote

QUOTE(Cer @ Mar 1 2005, 07:35 PM)
QUOTE(cornetto soft @ Mar 1 2005, 12:10 PM)
Yeah very good Wink

Don't pay attention to Alienz ! He says a lot of things, but hardly clever.

Maybe he wasn't trying to be clever. I think it was just sarcasm.

Yeah i know !! But it is not very gentle to say that ! It mean : you are very stupid ! Split is easy !!
... Maybe i'm wrong ! (and i hope it, i'm sure alienz is a very good and kind guy)
Back to top
alienz
Almost An Agent
Almost An Agent


Joined: 22 Mar 2004
Posts: 1436
Location: Mars
Reputation: 55.7

PostPosted: Tue Mar 01, 2005 7:31 pm    Post subject: Reply with quote

QUOTE(cornetto soft @ Mar 1 2005, 12:10 PM)
Yeah very good Wink

Don't pay attention to Alienz ! He says a lot of things, but hardly clever.

Judging from most of your posts, youre about two IQ points shy of a rock. I asked a question, nothing more.


Quote:
Yeah i know !! But it is not very gentle to say that ! It mean : you are very stupid ! Split is easy !!
... Maybe i'm wrong ! (and i hope it, i'm sure alienz is a very good and kind guy)


I am, but trying to be cool to me now is too little too late, should've thought about that before you insulted me.

As for the split, thats a very basic Perl function. It's not difficult at all if you bother to acually learn about the language rather than copying code.

_________________
Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Back to top
cornetto soft
Member
Member


Joined: 19 Feb 2004
Posts: 103
Location: Ille et Vilaine - Bretagne - FRANCE
Reputation: 29Reputation: 29Reputation: 29

PostPosted: Tue Mar 01, 2005 9:10 pm    Post subject: Reply with quote

Quote:
Judging from most of your posts, youre about two IQ points shy of a rock

And I insulted you ?

You know, if i said that, it's because after looking at your *lazy*éputation's points, and after reading some of your messages, i thought you were not always very kind with users...

M4RTIN was proud of his command ! And i fear that you might say unpleasant things about it !

But I don't hate you at all ! And maybe you decided to be more gentle ! That's why, i apologize to have been nasty...
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Tue Mar 01, 2005 11:02 pm    Post subject: Reply with quote

Umm is it suppost to show the tld? Cause it does. I did this to fix it:
Code:
my($mainname) = split (/\@|.com|.net|.org/,$username);


I tested it like:
Code:
#!/usr/bin/perl<br /><br />my $username = "ian@msndev.net";<br />my ($mainname) = split (/\@|.com|.net|.org/,$username);<br /><br />print $mainname;<br />print "\n";
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Mar 02, 2005 12:07 am    Post subject: Reply with quote

QUOTE(TCS @ Mar 1 2005, 06:02 PM)
Umm is it suppost to show the tld? Cause it does. I did this to fix it:
Code:
my($mainname) = split (/\@|.com|.net|.org/,$username);


I tested it like:
Code:
#!/usr/bin/perl<br /><br />my $username = "ian@msndev.net";<br />my ($mainname) = split (/\@|.com|.net|.org/,$username);<br /><br />print $mainname;<br />print "\n";

Quote:
my $username = "ian@msndev.net";


Your problem is that you can't use the @ symbol like that while inside double quotes: Perl thinks you're talking about an array "@msndev", and so the variable $username now equals "ian.net"

You can either escape the @ with \@, or put it in single quotes:

Code:
my $username = "ian\@msndev.net";<br /><br />--OR--<br /><br />my $username = 'ian@msndev.net';

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Wed Mar 02, 2005 2:59 am    Post subject: Reply with quote

Never mind than, works fine.

But why do you split $theclient.. I don't even see it getting used..
Back to top
M4RTIN
Member
Member


Joined: 31 Dec 2004
Posts: 134

Reputation: 19.2Reputation: 19.2

PostPosted: Wed Mar 02, 2005 7:31 am    Post subject: Reply with quote

Yeah, But becuase i only learn to split, i thought you had to split it into two variables.

:unsure:
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Wed Mar 02, 2005 8:43 am    Post subject: Reply with quote

Came from my bot.......

Actually posted a similar command (i called it nameme) a while ago.

But its not the same code as mine............
Back to top
alienz
Almost An Agent
Almost An Agent


Joined: 22 Mar 2004
Posts: 1436
Location: Mars
Reputation: 55.7

PostPosted: Wed Mar 02, 2005 6:22 pm    Post subject: Reply with quote

QUOTE(M4RTIN @ Mar 2 2005, 02:31 AM)
Yeah, But becuase i only learn to split, i thought you had to split it into two variables.

:unsure:

Obviously if youre SPLITTING something, there's going to be two. DUH

_________________
Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



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