mIRC Home    About    Download    Register    News    Help

Print Thread
#4758 03/01/03 04:36 PM
D
Dingo
Dingo
D
am i correct in assuming there is a 'on sound' and 'on nosound' event?

i've searched the help, and came up with info on 'on nosound, and wavend, midiend, mp3end; now i havn't found anything about 'on sound.

here are 2 lines of code which, at 3 am i can't figure out why they are not working:
Code:
 
on *:SOUND:*:      { echo $chan 5<=-4Sound5-=>2 $nick played $filename $+ . | halt }
on *:NOSOUND:*:    { echo $chan 5<=-4Sound5-=>2 14!1 $+ $nick $filename | halt }
 
couldsomeone please put me on the right track? smile thanks


#4759 03/01/03 04:43 PM
P
PHMinistries
PHMinistries
P
maybe try

on *:SOUND:*://echo $chan 5<=-4Sound5-=>2 $nick played $filename $+ . |
on *:NOSOUND:*://echo $chan 5<=-4Sound5-=>2 14!1 $+ $nick $filename

btw nice script

#4760 03/01/03 04:53 PM
D
Dingo
Dingo
D
thanks. i've been at this custom display thing for a month or so, right now its some modes and the sound and nosound events that arn't working for me.

i tried that code, but it still hasn't worked.
as i wrote that i thought that maybe i should use echo -a ... instead of echo $chan... i'll get back on that one smile

#4761 03/01/03 05:20 PM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
on SOUND isn't an event.
on NOSOUND is used as "on <level>:NOSOUND:<commands>" not as "on <level>:NOSOUND:*:<commands>" (not sure if it makes a difference, but it should).

#4762 03/01/03 05:23 PM
D
Dingo
Dingo
D
so is there anything i can use to capture the sounds people play?

#4763 04/01/03 12:56 AM
Joined: Dec 2002
Posts: 698
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 698
Sound is a ctcp smile
Code:
ctcp *:sound:*:{
  if ($regex($2-,/\x22(\S.*?\.(?:wav|mp3|mid))\x22/)) var %a = $regml(1),%b = $mid($2-,$calc($pos($2-,",2) +2))
  else var %a = $2,%b = $3-
  echo 2 -site * Sound: $+([,$iif(#* iswm $target,$target,private),]) $nick played $+(04,%a,) $iif(%b,06Action used: %b)
}

#4764 04/01/03 01:05 AM
D
Dingo
Dingo
D
wow... i dont supose that comes with a bit of explaination?
smile thanks Nimue - i'll heck it out when i get back home.

#4765 04/01/03 01:23 AM
Joined: Dec 2002
Posts: 698
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 698
The first line checks if the soundfile is a longname or not (for example "some file.mp3") and if so, sets the vars %a to the filename, and %b to the action (if one is used).
Else sets %a and %b to the same if NO "long file name.ext" is used
Then it echo's
[11:16] * Sound: [#channel|private] <nick> played file name.ext (and the following only if applicable) "Action used: "any action sent with the sound"
/help /sound
/help $target
/help $pos
etc for info on the individual identifiers used laugh


Link Copied to Clipboard