File: fake-dcc

package info (click to toggle)
epic4 1%3A3.0-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,756 kB
  • sloc: ansic: 56,285; makefile: 631; sh: 161; perl: 30
file content (32 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (11)
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
/*
 * Ok.  Here is the plan:
 *
 * We have a variable, $fake_dcc, that contains a list of words that can
 * be substituted for ``DCC'' as a CTCP.
 *
 * The sender randomly picks a word off that list and uses it.
 * The receiver then reparses the handshake if its on his list.
 *
 * Don't be fooled.  This script is not nearly as useful as it
 * might be made to be.  Its just a contrived example.
 */

@ fake_dcc = [FOO BAR GOOTCHIE]

/*
 * Sender's side
 */
on ^send_to_server "% % % PRIVMSG % :$chr(1)DCC*" {
	quote PRIVMSG $4 :$chr(1)$getrandword($fake_dcc) $6-
}

/*
 * Receiver's side
 */
on ^raw_irc "% PRIVMSG % :$chr(1)\\[$fake_dcc\\]*" {
	pretend $0 $1 $2 :$chr(1)DCC $4-
}

alias getrandword @ function_return = word($rand($#) $*)

#jfn'96