File: nickcomp

package info (click to toggle)
teknap 1.4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,428 kB
  • ctags: 6,297
  • sloc: ansic: 55,591; makefile: 545; sh: 112
file content (29 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
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
/*
 * Nick Completion for TekNap
 *
 * Author: Brian Weiss <brian@got.net> - 2000
 *
 * Most of this was taken from the nick completion module that shade wrote
 * for my BitchX/EPIC4 script called playdough. He deserves most of the
 * credit. Please send bug reports to me, not shade.
 */

assign NICK_COMP 1
assign NICK_COMP_CHAR :

alias nickcomp
{
	fe (%$0% ?$0? %$0 ?$0 $0% $0? $0) patt
	{
		^local findnick
		@ findnick = pattern($patt $channelnicks())
		@ function_return = findnick ? word(0 $findnick) : function_return
	}
}

on ^input "%: *" if (nick_comp)
{
	^local complete
	@ complete = nickcomp($before(: $*))
	raw 402 $C ${complete ? [$complete$nick_comp_char $1-] : [$*]}
}