mIRC Home    About    Download    Register    News    Help

Print Thread
Simple script #168634 11/01/07 07:30 PM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
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
}
}

Re: Simple script [Re: piker] #168635 11/01/07 07:41 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
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

Last edited by Scripto; 11/01/07 07:45 PM.

Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Re: Simple script [Re: Scripto] #168643 11/01/07 08:16 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Simple script [Re: Scripto] #168654 11/01/07 10:17 PM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
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
}
}

Re: Simple script [Re: piker] #168671 11/01/07 11:52 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
    }
  }
}



Invision Support
#Invision on irc.irchighway.net
Re: Simple script [Re: piker] #168700 12/01/07 02:47 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
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
    }
  }
}


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Re: Simple script [Re: Scripto] #168701 12/01/07 03:43 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
    }
  }
}


Invision Support
#Invision on irc.irchighway.net