mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
#160522 01/10/06 12:06 AM
Joined: Sep 2006
Posts: 71
O
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
alright, great! it works! umm..how would I go abouts making a dialog (I think that is what its called) so I can enable it or disable it?

#160523 01/10/06 04:43 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
A dialog takes time and isn't something I'll write. If you want to make one, you can read /help dialogs to see how.

Instead, here's a quick right click method:

Code:
on *:text:*:*: {
  if (lol isin $1- && %play.sound == On) {
    splay $findfile($mircdir\lol\,*.wav,$rand(1,$findfile($mircdir\lol\,*.wav,0)))
  }
  elseif (hi isin $1- && %play.sound == On) {
    splay $findfile($mircdir\hello\,*.wav,$rand(1,$findfile($mircdir\hello\,*.wav,0)))
  }
}

on *:input:*: {
  if (lol isin $1- && %play.sound == On) {
    splay $findfile($mircdir\lol\,*.wav,$rand(1,$findfile($mircdir\lol\,*.wav,0)))
  }
  elseif (hi isin $1- && %play.sound == On) {
    splay $findfile($mircdir\hello\,*.wav,$rand(1,$findfile($mircdir\hello\,*.wav,0)))
  }
}

menu * {
  Sounds
  .$iif(%play.sound == On,Turn Sounds Off,Turn Sounds On): $iif(%play.sound == On,set %play.sound Off,set %play.sound On)
}


Just right click to turn the sounds On/Off.


Invision Support
#Invision on irc.irchighway.net
#160524 02/10/06 12:56 AM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
I was posting some days ago "WORKING CODE atleast for me;)"

This was the code:(
Code:
on *:text:*:#:{
  if ($chan == #chan1) {
    if ($nick == me1) {
      var %string = hello
      if (%string !isin $1-) { splay sound35kb.wav }
    }
  }
  elseif ($chan == #chan2) {
    if ($nick == me2) {
      var %string = call
      if (%string !isin $1-) { splay sound35kb.wav }
    }
  }
  elseif ($chan == #chan3) {
    if ($nick == me3) {
      var %string = there
      if (%string !isin $1-) { splay sound35kb.wav }
    }
   }
 } 
 


OK! You all had right;) It schould not contain !isin just isin.

It worked and played the sound but for wrong reason...
and I think I found why it wouldn´t play with just isin.
Those users I tested with used color in their text.
When a user have another color (other than black) it won´t play the sound.

me1 say "hello" in #chan1 = working
me1 say "hello" in chan1 = NOT working (NOTE
the purple color)

Does this sound possible? and if it does;
Is there any way to add color info?

#160525 02/10/06 02:01 AM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
I´m stugling

Also notice that lets say 2 of those 3 users sit in same #chan.
me1 and me2 sit in #chan1
Then I hear sound when me1 type "hello"
but not when me2 type "call"

Code:
on *:text:*:#:{
  if ($chan == #[color:red]chan1[/color]) {
    if ($nick == [color:blue]me1[/color]) {
      var %string = [color:green]hello[/color]
      if (%string isin $1-) { splay sound35kb.wav }
    }
  }
  elseif ($chan == #[color:red]chan1[/color]) {
    if ($nick == [color:blue]me2[/color]) {
      var %string = [color:brown]call[/color]
      if (%string isin $1-) { splay sound35kb.wav }
    }
  }
  elseif ($chan == #chan2) {
    if ($nick == me3) {
      var %string = there
      if (%string isin $1-) { splay sound35kb.wav }
    }
   }
 }

#160526 02/10/06 05:23 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Well, I think the problem is that you have if chan1, and elseif chan1. Try the code below:
Code:
on *:text:*:#:{
  if ($chan == #chan1) {
    if ($nick == me1) {
      if (hello isin $1-) { splay sound35kb.wav }
    }
    elseif ($nick == me2) {
      if (call isin $1-) { splay sound35kb.wav }
    }
  }
  elseif ($chan == #chan2) {
    if ($nick == me3) {
      if (there isin $1-) { splay sound35kb.wav }
    }
  }
} 

#160527 02/10/06 05:29 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
You could also try this
Code:
on *:text:*:#:{
  if ($chan == #chan1) && ($nick == me1) && (hello isin $1-) { splay sound35kb.wav }
  elseif ($chan == #chan1) && ($nick == me2) && (call isin $1-) { splay sound35kb.wav }
  elseif ($chan == #chan2) && ($nick == me3) && (there isin $1-) { splay sound35kb.wav }
}  


I didn't test it, but it's worth a try. It should work imo.

Note: with nicknames me1 and me2, I hope it's not referring to your own nick.
This code will only trigger when someone else in the channel is saying hello, call or there.

#160528 02/10/06 01:09 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can do either code that OrionsBelt posted. Just replace:

if (lol isin $1-)

with:

if (lol isin $strip($1-))

Do this with all words. That will take care of your color problem.


Invision Support
#Invision on irc.irchighway.net
#160529 02/10/06 03:09 PM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
The code is excellent
Thank you again smile

Code:
on *:text:*:#:{
if ($chan == #chan1) && ($nick == me1) && (hello isin $strip($1-)) { splay sound35kb.wav }
elseif ($chan == #chan1) && ($nick == me2) && (call isin $strip($1-)) { splay sound35kb.wav }
elseif ($chan == #chan2) && ($nick == me3) && (there isin $strip($1-)) { splay sound35kb.wav }
}   


I also added the (text isin $strip($1-)) --> Thanks

Page 3 of 3 1 2 3

Link Copied to Clipboard