|
Joined: Sep 2003
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 29 |
Hi, I've made an auto reply text : on *:text:*my name*:#: { if ($nick !- $me) halt else /msg #something wait a minute i'm buzy } <-- the problem is when someone do this !myname somesongname.mp3, it triggered the on text msg. My question is how to prevent the text msg not to respond to someone asking my sound file? thanks,,,,,
Keep learning everyday, you'll be a genius.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
You need to make sure that there is nothing attached to your nick. Of course this won't work anymore when you are being addressed as [yournick]. If you want to retain that possibility, go for door #2.
on *:TEXT:*:#: {
if ($istok($strip($1-),$me,32) {
commands go here
}
}
or
on *:TEXT:*:#: {
if ($+(*,$me,*) iswm $1-) && ($+(*!,$me,*) !iswm $1-) {
commands go here
}
}
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Sep 2003
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 29 |
It's worked, thank you very much.. and may u look good in avery way...
Keep learning everyday, you'll be a genius.
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Optimizing the 2nd code:
on *:TEXT:*:#: {
tokenize 32 $strip($1-)
if ($me isin $1-) && (! $+ $me !isin $1-) {
commands go here
}
}
Also adding a 3rd option, for mIRC 6.1:
on $*:TEXT:$($+(/\s*,$me,\s*/iS)):#:{
commands go here
}
* cold edits his posts 24/7
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
The second one I believe should be on $*:TEXT:$($+(/(\s|^),$me,(\s|$)/iS)):#:{ cmds } and doesn't appear to work with nicks with a certain chars ( ^ [ ] -maybe others also) in them.
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
^ and $ aren't required in this pattern. But you're right about some chars in the nick.. and using $replace would kinda turn the event into a not so nice thing to use for such a simple task.. I'd not use it then. See the horror:
on $*:TEXT:$($+(/\s*,$replace($me,\,\\,^,\^,[,\[,],\],$({,),$(\{,),$(},),$(\},)),\s*/iS)):#:{
commands go here
}
* cold edits his posts 24/7
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
hm, right, I could have sworn the \s* didn't work when I tried it before in event patterns, but it does..
|
|
|
|
|