mIRC Home    About    Download    Register    News    Help

Print Thread
#51947 30/09/03 05:22 AM
Joined: Sep 2003
Posts: 29
S
sopia Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
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.
#51948 30/09/03 05:27 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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.

Code:
on *:TEXT:*:#: {
  if ($istok($strip($1-),$me,32) { 
    commands go here 
  }  
}


or

Code:
on *:TEXT:*:#: {
  if ($+(*,$me,*) iswm $1-) &amp;&amp; ($+(*!,$me,*) !iswm $1-) {
    commands go here
  }
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#51949 30/09/03 06:04 AM
Joined: Sep 2003
Posts: 29
S
sopia Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
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.
#51950 01/10/03 04:51 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Optimizing the 2nd code:
Code:
on *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($me isin $1-) &amp;&amp; (! $+ $me !isin $1-) {
    commands go here
  }
}


Also adding a 3rd option, for mIRC 6.1:
Code:
on $*:TEXT:$($+(/\s*,$me,\s*/iS)):#:{
  commands go here
}


* cold edits his posts 24/7
#51951 01/10/03 06:29 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
The second one I believe should be
Code:
on $*:TEXT:$($+(/(\s|^),$me,(\s|$)/iS)):#:{ cmds }
and doesn't appear to work with nicks with a certain chars (^ [ ] -maybe others also) in them.

#51952 01/10/03 06:44 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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:
Code:
on $*:TEXT:$($+(/\s*,$replace($me,\,\\,^,\^,[,\[,],\],$({,),$(\{,),$(},),$(\},)),\s*/iS)):#:{
  commands go here
}


* cold edits his posts 24/7
#51953 01/10/03 06:59 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
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.. smile


Link Copied to Clipboard