mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 3 1 2 3
#160502 27/09/06 10:18 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
Yeah, I also like that new code better indead.
I originally added the variable, since I didnt get it to work when we started with detecting "call me" (two words).

But still, I don't think this will solve the problem, since the code I posted worked fine as well, although it was a little longer and contained an unneeded variable.


it should work just fine is the variables are all in place meaning that nick from channel 1 should be nick from channel 1 and not 2

and nick from channel 2 should be nick from channel 2 not 1 saying the proper words.

call me is easily identified by using if (call me iswm $1-) or if ($1-$2 == call me)


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160503 27/09/06 10:20 PM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
true;)

Tried on a frech installed PC. Still nothing.

Works fine with just 1 command but not when you add more than that.

#160504 27/09/06 10:23 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
true;)

Tried on a frech installed PC. Still nothing.

Works fine with just 1 command but not when you add more than that.


ok are you SURE that your setting the proper environment when testing like Billgates ison #channel 1 saying call?

and mom is on channel 2 saying hello?

because that should work just fine I tested the environment and everything runs

HEre try this code remove all exisiting code and make sure notice.wav is in your SOUNDS folder in your miRCdir

Code:
on *:text:*:#:{
  if ($nick == billgates) && ($nick ison #chat) && (call isin $1-) { echo -a $nick said your name and the word call was in | splay $mircdirsounds\notice.wav }
  elseif ($nick == mom) && ($nick ison #channel2) && (hello isin $1-) { echo -a $nick said your name and the word call was in | splay $mircdirsounds\notice.wav }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160505 27/09/06 10:36 PM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
Code:
on *:text:*:#:{
  if ($nick == metest1) && ($nick ison #help) {    
    if (test isin $1-) { splay ready.wav }
  }
  elseif ($nick == metest2) && ($nick ison #helpgood) { 
    if (hello isin $1-) { splay ready.wav }
  }
}  


THIS IS ???
I´m remote with different user in both those channels
listen to this!
Wen I type test in any of those channels with nick "metest1" it I here the sound. ??? hmm

When using nick "metest2" in any of those 2 channels. I DON´T here anything?

#160506 27/09/06 10:48 PM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Quote:

THIS IS ???
I´m remote with different user in both those channels
listen to this!
Wen I type test in any of those channels with nick "metest1" it I here the sound. ??? hmm

When using nick "metest2" in any of those 2 channels. I DON´T here anything?


First you may hear the sound if metest1 is on #help and #helpgood at the same time. Did you join #helpgood as metest1 then test it or were you in both channels?
This is why i go for ($chan == #help) and not ($nick ison #help). Cus you can be on that channel and it will always work no matter what. But if the channel equals what you tell it to, then it only works there.

Second, are you typing hello or text with metest2? I'd get rid of elseif and just use if. Some times, elseif isn't really needed.


We don't just write the scripts, we put them to the test! (ScriptBusters)
#160507 27/09/06 10:49 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
Code:
on *:text:*:#:{
  if ($nick == metest1) && ($nick ison #help) {    
    if (test isin $1-) { splay ready.wav }
  }
  elseif ($nick == metest2) && ($nick ison #helpgood) { 
    if (hello isin $1-) { splay ready.wav }
  }
}  


THIS IS ???
I´m remote with different user in both those channels
listen to this!
Wen I type test in any of those channels with nick "metest1" it I here the sound. ??? hmm

When using nick "metest2" in any of those 2 channels. I DON´T here anything?


Well i was assuming that he was on 2 different channels thus why he wanted it to be seperated. but if he wanted the $nicks to do stuff on their own he can remove the #channel sdtuff all togheter and just evaluate the nicks

ok so when your using metest2 in channel #helpgood and you type hello does it work or doesnt work? remember what you see in the script


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160508 28/09/06 12:43 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Quote:
call me is easily identified by using if (call me iswm $1-) or if ($1-$2 == call me)


Just a note, you don't need the second $... if ($1-2 == call me) is fine. Not a problem, obviously... just commenting. laugh

And it does sound like he's typing "test" with both nicks instead of "test" with nick1 and "hello" with nick2.


Invision Support
#Invision on irc.irchighway.net
#160509 28/09/06 02:48 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
That's exactly what im thinking because I tried the script from my first script shown which i have no tested and using splay $mircdirsounds\filename.wav is a good routine of playing the theme through sounds folder. and the IF and Elseif is ok


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160510 28/09/06 11:00 AM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
In status window I get this when any user write something?
* /if: close bracket not found (line 2, soundscript)

My line (the complete code) looks like this
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 }
        }
         


Same thing here. When I tested the first part of the code it works
on *:text:*:#:{
if ($chan == #chan1) {
if ($nick == me1) {
var %string = hello
if (%string isin $1-) { splay sound35kb.wav }
}

When I add the rest "elseif" --> Nothing will work. Not even the first one.

#160511 28/09/06 03:28 PM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Look at the code, you are missing brackets and it's offsetting everyhitng else. That could be why alot of it isn't working.
Code:
on *:text:*:#:{
  if ($chan == #chan1) {
    if ($nick == me1) {
      var %string = hello
      if (%string isin $1-) { splay sound35kb.wav }
    }
  [color:red]}[/color]
  elseif ($chan == #chan2) {
    if ($nick == me2) {
      var %string = call
      if (%string isin $1-) { splay sound35kb.wav }
    }
  [color:red]}[/color]
  elseif ($chan == #chan3) {
    if ($nick == me3) {
      var %string = there
      if (%string isin $1-) { splay sound35kb.wav }
    }
   [color:red]}[/color]
 [color:red]}[/color]
 


Same here:
Code:
on *:text:*:#:{
  if ($chan == #chan1) {
    if ($nick == me1) {
      var %string = hello
      if (%string isin $1-) { splay sound35kb.wav }
    }
  [color:red]}[/color]
[color:red]}[/color]



For every open {, you must have a closing }


We don't just write the scripts, we put them to the test! (ScriptBusters)
#160512 28/09/06 09:32 PM
Joined: Sep 2006
Posts: 14
R
Ratoko Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2006
Posts: 14
FOUND IT BY SOME HELP FROM A FRIEND laugh

WORKING CODE atleast for me;)

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



THANKS FOR ALL SUPPORT IN THIS FORUM! laugh

#160513 28/09/06 09:54 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Hmmmm.
Doesn't it like work the other way around now?
If HELLO is NOT in $1- then play the file?

Weird, but ok. Glad to hear that you got it working.

#160514 28/09/06 10:41 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yeah, the way he has it isn't right... it'll play the sound anytime the person says anything except when the word is there.

His problem was the }'s, which are fixed in his updated script.


Invision Support
#Invision on irc.irchighway.net
#160515 29/09/06 03:57 PM
Joined: Sep 2006
Posts: 71
O
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
this is exactly what I want also, but I want it to play a sound on any given channel when I type lol. I want it to play different sound files in a directory ex.. I say lol in a channel it reas wav files from lol dir in sounds.

#160516 29/09/06 04:44 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Try that. You can replace the "lol" and "hi" stuff with other words. If you want it to only trigger if that is the only word, then change "lol isin $1-" to "$1- == lol" (no quotes). Also, you can change the directory locations... right now, it's locating the LOL and HELLO folders in the mIRC directory... adjust as needed.

Code:
on *:text:*:#: {
  if (lol isin $1-) {
    splay $findfile($mircdir\lol\,*.wav,$rand(1,$findfile($mircdir\lol\,*.wav,0)))
  }
 elseif (hi isin $1-) {
    splay $findfile($mircdir\hello\,*.wav,$rand(1,$findfile($mircdir\hello\,*.wav,0)))
  }
}


Note that it is set up to play the first matching sound and not any others... so, if someone typed "hi ... this is fun. lol", it will play the LOL sound, but not the HI sound (LOL is first in the script). This is why I think use $1- == lol would be easier as you wouldn't have more than one word at a time. You could take out the else in the elseif (just use if) and then it would probably queue those up and play one, then play the other... not sure that you really want that, though.


Invision Support
#Invision on irc.irchighway.net
#160517 29/09/06 06:23 PM
Joined: Sep 2006
Posts: 71
O
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
Quote:
ok, its not working..I get this

Code:
* /splay: invalid parameters
-  


ok it does work, but not when I enter it myself..

Last edited by o0Chris0o; 29/09/06 06:27 PM.
#160518 29/09/06 09:38 PM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
use on INPUT for what you type.


We don't just write the scripts, we put them to the test! (ScriptBusters)
#160519 30/09/06 04:19 AM
Joined: Sep 2006
Posts: 71
O
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
where it says on text?

#160520 30/09/06 07:38 AM
Joined: Sep 2006
Posts: 71
O
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
hmmm still don't work when I enter "lol" in any channel..but it works for anyone else..hmm weird..

#160521 30/09/06 01:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
on TEXT does *not* work for yourself. You need to use on INPUT (which is formatted a little differently).
Code:
on *:input:#: {
  if (lol isin $1-) {
    splay $findfile($mircdir\lol\,*.wav,$rand(1,$findfile($mircdir\lol\,*.wav,0)))
  }
  elseif (hi isin $1-) {
    splay $findfile($mircdir\hello\,*.wav,$rand(1,$findfile($mircdir\hello\,*.wav,0)))
  }
}


*You'll still need the original code I posted... the original is for others typing text and this is for you typing text*


Invision Support
#Invision on irc.irchighway.net
Page 2 of 3 1 2 3

Link Copied to Clipboard