/usr/share/epic5/script/ban is in epic5 1.1.11-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | IF (WORD(2 $LOADINFO()) != [pf]) { LOAD -pf $WORD(1 $LOADINFO()); RETURN; };
LOAD addset;
LOAD massmode;
# KICKBAN [channel] <nick> [reason]
#
# Ban <nick> from [channel] (default $C), then kick them.
ALIAS KICKBAN (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 ARGS)) ? SHIFT(ARGS) : C,
:NICK = SHIFT(ARGS),
:REASON = ARGS;
if (!NICK) {
XECHO -b Usage: ${K}KICKBAN [channel] <nick> [reason];
RETURN;
};
BAN $CHAN $NICK;
KICK $CHAN $NICK $REASON;
};
ALIAS KB { KICKBAN $*; };
ALIAS BK { KICKBAN $*; };
# KICK [channel] <nick> [reason]
#
# Kicks <nick> from [channel], or $C if unspecified. If no reason is given,
# uses <no reason>.
ALIAS KICK (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 $ARGS)) ? SHIFT(ARGS) : C,
:NICK = SHIFT(ARGS),
:REASON = ARGS ? [$ARGS] : [no reason];
if (!NICK) {
XECHO -b Usage: ${K}KICK [channel] <nick> [reason];
RETURN;
};
//KICK $CHAN $NICK $REASON;
};
ALIAS K { KICK $*; };
# ZAP [channel] [time] <nick> [reason]
#
# Kickbans <nick> from [channel] (default $C), waits [time] seconds (default 5)
# then unbans them.
ALIAS ZAP (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 $ARGS)) ? SHIFT(ARGS) : C,
:TIME = ISNUMBER(b10 $WORD(0 $ARGS)) ? SHIFT(ARGS) : [5],
:NICK = SHIFT(ARGS),
:REASON = ARGS ? ARGS : [come back in $TIME seconds];
IF (!NICK) {
XECHO -b Usage: ${K}ZAP [channel] [time] <nick> [reason];
RETURN;
};
IF (!ONCHANNEL($NICK $CHAN)) {
XECHO -b ${K}ZAP: $NICK is not on $CHAN;
RETURN;
};
WAIT FOR {
USERHOST $NICK -cmd {
BLESS;
IF ([$3] == [<UNKNOWN>]) {
XECHO -b ${K}ZAP: No such nick $NICK in $CHAN;
RETURN;
};
MODE $CHAN +b *!$3@$4;
//KICK $CHAN $0 $REASON;
TIMER $TIME MODE $CHAN -b *!$3@$4;
};
};
};
# CLEARBANS [channel]
#
# Remove all bans in [channel], or $C if not specified.
ALIAS CLEARBANS (CHAN DEFAULT $C) {
UNBAN $CHAN *!*@*;
};
# BAN [channel] <nick|host> [<nick|host> ...]
#
# Sets a ban on the specified nick or host. If a nick is specified, BAN
# looks at SET BAN_TYPE to determine the ban type. If not set, the default
# mask type is 2, i.e. *!*@host.
ADDSET BAN_TYPE INT;
SET BAN_TYPE 2;
ALIAS BAN (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 $ARGS)) ? SHIFT(ARGS) : C,
:WHOM = ARGS;
@ :HOSTS = [];
@ :NICKS = [];
FOR W IN ($WHOM) {
SWITCH ($W) {
(*!*@*) { UNSHIFT HOSTS $W; };
(*@*) { UNSHIFT HOSTS *!$W; };
(*) { UNSHIFT NICKS $W; };
};
};
IF (NICKS) {
WAIT FOR {
USERHOST $NICKS -cmd {
BLESS;
IF ([$3] == [<UNKNOWN>]) {
XECHO -b ${K}BAN: Couldn't find nick: $W;
RETURN;
};
UNSHIFT HOSTS $MASK($GETSET(BAN_TYPE) $0!$3@$4);
};
};
};
MASSMODE $CHAN +b $HOSTS;
};
# UNBAN [channel] <nick|mask> [<nick|mask> ...]
#
# Removes bans on [channel], or $C if unspecified. If a <nick> is given,
# removes all bans that match that nick. If a <mask> is given, remove
# that single ban.
ALIAS UNBAN (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 $ARGS)) ? SHIFT(ARGS) : C,
:WHOM = ARGS;
@ :HOSTS = [];
@ :NICKS = [];
FOR W IN ($WHOM) {
SWITCH ($W) {
(*!*@*) { UNSHIFT HOSTS $W; };
(*@*) { UNSHIFT HOSTS *!$W; };
(*) { UNSHIFT NICKS $W; };
};
};
IF (NICKS) {
@ :MASKS = [];
WAIT FOR {
USERHOST $NICKS -cmd {
BLESS;
IF ([$3] == [<UNKNOWN>]) {
XECHO -b ${K}UNBAN: Couldn't find nick: $W;
RETURN;
};
UNSHIFT MASKS $0!$3@$4;
};
};
^STACK PUSH ON 367;
^STACK PUSH ON 368;
^ON ^367 * {
BLESS;
IF (MATCH($2 $MASKS)) {
UNSHIFT HOSTS $2;
};
};
^ON ^368 ^*;
WAIT FOR {
MODE $CHAN +b;
};
^STACK POP ON 367;
^STACK POP ON 368;
};
MASSMODE $CHAN -b $HOSTS;
};
# CLEARBANS [channel]
#
# Remove all bans on [channel], or $C if unspecified.
ALIAS CLEARBANS (ARGS) {
@ :CHAN = ISCHANNEL($WORD(0 $ARGS)) ? SHIFT(ARGS) : C;
@ :HOSTS = [];
^STACK PUSH ON 367;
^STACK PUSH ON 368;
^ON ^367 * {
BLESS;
UNSHIFT HOSTS $2;
};
^ON ^368 ^*;
WAIT FOR {
MODE $CHAN +b;
};
^STACK POP ON 367;
^STACK POP ON 368;
MASSMODE $CHAN -b $HOSTS;
};
#larne 2k10
|