File: sound

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (33 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * A simple script to support DCC SOUND as specified by mirc
 * I got my info directly from Tjerk, so I claim total innocence 
 * if the implementation is wrong. :P
 */

on ^ctcp "% % SOUND ?*" 
{
	# Do the 'action' part of it
	switch ($4)
	{
		()  {echo *** This sound ($3) courtesy of $0}
		(*) {echo * $0 $4-}
	}
	switch ($3)
	{
		(*.wav) {exec ${PLAYWAV} $^^^;^|^`^!^&^*$3}
		(*)     {exec ${PLAYWAV} $^^^;^|^`^!^&^*$3.wav}
	}
}

/*
 * Usage: /sound <target|*> <wavfile> <action-text>
 * All the arguments are required, according to the specification.
 *
 * The first argument is who to send it to, '*' goes to current target
 * The second argument is the wav file to be played.  The receiver is
 *	assumed to have this wav file already..
 * The rest of the arguments are "action text", ala the /me command.
 */
alias sound ctcp $0 SOUND $1-

#hop'96