File: autoop.tcl

package info (click to toggle)
circus 0.43-1
  • links: PTS
  • area: non-free
  • in suites: hamm, potato, slink
  • size: 1,868 kB
  • ctags: 236
  • sloc: tcl: 6,574; sh: 157; ansic: 66; makefile: 36
file content (41 lines) | stat: -rw-r--r-- 894 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
30
31
32
33
34
35
36
37
38
39
40
41
#
#
# effort for a simple auto-op list for cIRCus
#
# Very minimal. But then again, scripting in cIRCus is very minimal.

#
# 20 april 97 First initial version 0.01 Ivo van der Wijk

source "scripts/server.tcl"

#
# This is your auto-op list. It contains channel - mask pairs, where channel
# can also be a '*' for all channels, and mask can contain (simple) wildcards
set oplist {
	{ * *!*ivo@*nijenrode.nl }
	{ #zuurtje *!*ivo@xs?.xs4all.nl }
	{ #zuurtje *!*bas@*xs4all.nl }
}

global oplist

proc auto_op {chan who} {
#
# I'm not much of a tcl programmer... next line should extract the nickname
# from a string like nick!user@host

	set nick [ string range $who 0 [ expr [ string first "!" $who ] - 1 ] ]
  	mode $chan "+o $nick"
}

proc	init_auto_op {oplist} {
# initialize autoop

	foreach pair $oplist {
		cbind JOIN [lindex $pair 0] [lindex $pair 1] auto_op
	}
}

init_auto_op $oplist