File: fake-dcc

package info (click to toggle)
epic 3.004-10
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,180 kB
  • ctags: 3,207
  • sloc: ansic: 40,836; makefile: 526; sh: 121; perl: 17
file content (32 lines) | stat: -rw-r--r-- 761 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
/*
 * 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 reciever 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-
}

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

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

#jfn'96