File: autoop

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 (76 lines) | stat: -rw-r--r-- 2,072 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# AutoOp   by Ian Frechette 12-10-92 
# EPIC modifications as neccesary by Jeremy Nelson

# the people you want to be opped by default.  Wildcards are allowed.
# the patterns must be of the form user@host
if (!op_list) 
	{@ op_list = [bob@example.bob.edu foo@*.bar.com]}

# the channels you want people to be opped on by default.  Wildcards
# are allowed.  '*' simply means all channels apply.
if (!chan_list)
	{@ chan_list = [* #example]}

# Show the the people currently in the autoop list
alias showop
{
	@ count = 0
	@ ao.name = []
	echo *** AutoOp list.  Addop user@host to add.  Delop <num>  to remove
	echo *** <num> nickname!username@hostname 
	fe ($op_list) ao.name {
		echo *** $[5]count $ao.name
		@ count++
	}
}

# Just like showop but works with channels.
alias showchan
{
	@ count = 0
	@ ao.name = []
	echo *** AutoOp chan list.  Addchan #channel add.  Delchan <num>  to remove
	echo *** <num> #channel
	fe ($chan_list) ao.name {
		echo *** $[5]count $ao.name
		@ count++
	}
}

# Given a number.. deletes that person from the autoop list.. 
# use SHOWOP to list.
alias delop {
    if (rmatch("$0" *1 *2 *3 *4 *5 *6 *7 *8 *9 *0))
        { @ op_list = notw($0 $op_list) }
        { echo *** Usage: delop <number>;echo *** See showop }
}
    
# Given a number.. deletes that channel from the autoop channel list.. 
# use SHOWCHAN to list.
alias delchan {
    if (rmatch("$0" *1 *2 *3 *4 *5 *6 *7 *8 *9 *0))
        { @ chan_list = notw($0 $chan_list) }
        { echo *** Usage: delchan <number>;echo *** See showchan }
}

# Add an autochanop to the list.
alias addop {
    if ([$0])
	{ push op_list $0 }
	{ echo *** Usage addop username@host;echo *** wildcards are allowed }
}

# Add an autochanop channel to the list.
alias addchan {
    if ([$0])
	{ push chan_list $0 }
	{ echo *** Usage addchan #channel;echo *** wildcards are allowed }
}

#
# the actual ON that does the work
# This is the hook as it would be used in ircii-EPIC
#
on #-join 666 '% \\[$chan_list\\] \\[$op_list\\]' {
	timer ${10 + rand(10)} if \(!ischanop\($0 $1\)\) \{//mode $1 +o $0\}
}