mIRC Homepage
Posted By: piker Simple script - 11/01/07 07:30 PM
Hello, I need to write a script so when somebody says my nick in private it plays a sound I have got something but it doesn't work frown

alias dingding { splay $mircdirsounds\misc\dingding.wav }

on *:text:*:*:{ if ($me isin query) {
dingding
echo -at $nick has mentioned your nick in private
}
}
Posted By: Scripto Re: Simple script - 11/01/07 07:41 PM
Code:
on ^*:TEXT:*:?:{
  if ($me isin $1-) {
    splay $mircdirsounds\misc\dingding.wav 
    echo -at $nick has mentioned your nick in private
  }
}
on ^*:ACTION:*:?:{
  if ($me isin $1-) {
    splay $mircdirsounds\misc\dingding.wav 
    echo -at $nick has mentioned your nick in private
  }
}
 


Try this
Posted By: Riamus2 Re: Simple script - 11/01/07 08:16 PM
You don't need ^ on any event unless you're halting it. In some cases, that can even cause the script to do things incorrectly.
Posted By: piker Re: Simple script - 11/01/07 10:17 PM
thank you! that kind-of did it but now when my private window is the active it dings anyway ;o How could I make it so it stops dinging when it's active?
I use this script for when somebody says nick in a channel:
on *:text:*:*: {
if ($me isin $1-) {
if (($chan != $null) && ($chan != $active)) {
echo -at $nick is calling you in $chan
splay dingding.wav
}
}
Posted By: Riamus2 Re: Simple script - 11/01/07 11:52 PM
Untested, but should work. Do the same thing for actions -- just change TEXT to ACTION at the top and duplicate the rest.

Code:
on *:text:*:*: {
  ; Check if your nick is used.
  if ($me isin $1-) {
    ; Check if the target of the text is your active window.  If not, continue.  If it is, then don't do anything.
    if ($target != $active) {
      ; Echo the result and $iif will display either the channel or else PM if it's a private message.  Play the sound after.
      echo -at $nick is calling you in $iif($chan,$chan,PM) $+ .
      .splay dingding.wav
    }
  }
}

Posted By: Scripto Re: Simple script - 12/01/07 02:47 PM
Try this...

Code:
 
on *:TEXT:*:?:{
  if ($active != $window($nick)) {
    if ($me isin $1-) {
      splay $mircdirsounds\misc\dingding.wav 
      echo -at $nick has mentioned your nick in private
    }
  }
}
on *:ACTION:*:?:{
  if ($active != $window($nick)) {
    if ($me isin $1-) {
      splay $mircdirsounds\misc\dingding.wav 
      echo -at $nick has mentioned your nick in private
    }
  }
}
Posted By: Riamus2 Re: Simple script - 12/01/07 03:43 PM
Didn't notice he wanted PM only. Here's an update for the one I did above so there isn't any confusion with it.

Code:
on *:text:*:?: {
  ; Check if your nick is used.
  if ($me isin $1-) {
    ; Check if the target of the text is your active window.  If not, continue.  If it is, then don't do anything.
    if ($target != $active) {
      echo -at $nick is calling you in PM.
      .splay dingding.wav
    }
  }
}
© mIRC Discussion Forums