User Control Panel
Advertisements

HELP US, HELP YOU!

A n00b question...

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Wed Mar 03, 2004 7:40 pm    Post subject: Reply with quote

I know you guys will say what a stupid n00b but i try to make work the say command and now it does not work... i dont get erros i tryed to midify the code like 20 times and its the samething not work so can you tell me whats wrong with the code... (i use morpheus)

Code:
 if ($msg =~#say (.*)$/) {<br />           $self->sendmsg("$1");<br />           return;<br />           }
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Wed Mar 03, 2004 7:42 pm    Post subject: Reply with quote

Err.. lol

Code:
    if ($msg =~ /^say (.*)$/) {<br />            &send($self,"Ok here is what you said:\n$1\n", "$username");<br />            goto end;<br />    }<br />    


Its for Maya/Morph
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Wed Mar 03, 2004 7:46 pm    Post subject: Reply with quote

QUOTE(Mat007 @ Mar 3 2004, 11:42 AM)
Err.. lol

Code:
    if ($msg =~ /^say (.*)$/) {<br />            &send($self,"Ok here is what you said:\n$1\n", "$username");<br />            goto end;<br />    }<br />    


Its for Maya/Morph

Thanks a lot Very Happy Very Happy
Back to top
Urbansk8
Newbie
Newbie


Joined: 07 Mar 2004
Posts: 10
Location: UK
Reputation: 26.6Reputation: 26.6Reputation: 26.6

PostPosted: Mon Mar 08, 2004 6:00 pm    Post subject: Reply with quote

Cheers i needed that as well Smile
Back to top
Calum
Not Yet a God
Not Yet a God


Joined: 21 Feb 2004
Posts: 373
Location: england
Reputation: 34.7Reputation: 34.7Reputation: 34.7

PostPosted: Mon Mar 08, 2004 6:06 pm    Post subject: Reply with quote

Code:
if ($msg =~ /^say (.*)/i) {<br />     my $words = $1;<br />     &send($self, "$1", "$username");<br />     goto end;<br />}
that is my one this says it without the this is what you said part
Back to top
UnShavenGod
Young One
Young One


Joined: 26 Feb 2004
Posts: 99

Reputation: 28.7Reputation: 28.7Reputation: 28.7

PostPosted: Tue Mar 09, 2004 4:37 am    Post subject: Reply with quote

Be sure to pay attention what everything means, you silly youngsters:

Lemme break it down so you can have more power:

$msg =~ /^say(.+)/i ;

In english:

^ = beginning of string
.+ = any bunch of characters up to a \n or end of string
i = use case-insensitive matching

So be aware that:

User: Hey say "hello" to prove you're not a bot!

Will NOT pass: $msg =~ /^say(.+)/i ;

Because "say" is not at the beggining of the string.


So you can take out the ^ for more flexibility -- and don't be afraid to wrap stuff up in more conditionals.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help 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