|
|
|
@ -3,6 +3,58 @@ |
|
|
|
|
# (Map) Used if we try to ban someone but we haven't registered their hostname yet. |
|
|
|
|
global banqueue, kickqueue; |
|
|
|
|
|
|
|
|
|
command j(channel, key) |
|
|
|
|
{ |
|
|
|
|
if (channel == void) { |
|
|
|
|
/echo Usage: /j channel |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (channel[0] != "#") |
|
|
|
|
channel = "#" + channel; |
|
|
|
|
|
|
|
|
|
if (key == void) |
|
|
|
|
/join %channel |
|
|
|
|
else |
|
|
|
|
/join %channel %key |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
command p(channel, message) |
|
|
|
|
{ |
|
|
|
|
if (channel == void) { |
|
|
|
|
if (subwintype() == "Channel") { |
|
|
|
|
channel = subwinname(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
/echo -G /p: Not in a channel. Try /p channel |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (channel[0] != "#") |
|
|
|
|
channel = "#" + channel; |
|
|
|
|
|
|
|
|
|
if (message == void) |
|
|
|
|
/part %channel |
|
|
|
|
else |
|
|
|
|
/part %channel %message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
command w(nickname) /whois %nickname |
|
|
|
|
|
|
|
|
|
hook ctcprequest(sender, target, command, message) |
|
|
|
|
{ |
|
|
|
|
# For simplicity, set following to "false" if this is undesirable: |
|
|
|
|
response_CTCP_TIME = true; |
|
|
|
|
|
|
|
|
|
/echo ctcp: %sender %target %command %message |
|
|
|
|
|
|
|
|
|
if (command == "TIME" && response_CTCP_TIME) { |
|
|
|
|
t = now("yyyy/MM/dd hh:mm:ss t"); |
|
|
|
|
/ctcpreply %sender TIME %t |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hook start() |
|
|
|
|
{ |
|
|
|
|
# Queue for host lookup if a ban is issued, but hostname is unknown. |
|
|
|
@ -244,6 +296,10 @@ menu memberlist { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
# Used as a callback when trying to ban someone we don't know the hostname of, |
|
|
|
|
# and this numeric responds with a hostname to ban. |
|
|
|
|
# |
|
|
|
|
hook numeric(code, args, msg) |
|
|
|
|
{ |
|
|
|
|
if (code == "302") { |
|
|
|
@ -280,24 +336,23 @@ hook numeric(code, args, msg) |
|
|
|
|
# |
|
|
|
|
function privilege(channel, action, mode, members) |
|
|
|
|
{ |
|
|
|
|
maxmodes = toint(isupport("MODES")); |
|
|
|
|
totalmodes = maplen(&members); |
|
|
|
|
i = 0; |
|
|
|
|
while (i < totalmodes) { |
|
|
|
|
modelen = maxmodes; |
|
|
|
|
if ((totalmodes - i) < maxmodes) |
|
|
|
|
modelen = totalmodes - i; |
|
|
|
|
|
|
|
|
|
j = i; |
|
|
|
|
nicks = ""; |
|
|
|
|
while (j < (i + modelen)) { |
|
|
|
|
nicks = nicks + members[j] + " "; |
|
|
|
|
j = j + 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
modestr = action + strrep(mode, modelen); |
|
|
|
|
/mode %channel %modestr %nicks |
|
|
|
|
i = i + modelen; |
|
|
|
|
} |
|
|
|
|
maxmodes = toint(isupport("MODES")); |
|
|
|
|
totalmodes = maplen(&members); |
|
|
|
|
i = 0; |
|
|
|
|
while (i < totalmodes) { |
|
|
|
|
modelen = maxmodes; |
|
|
|
|
if ((totalmodes - i) < maxmodes) |
|
|
|
|
modelen = totalmodes - i; |
|
|
|
|
|
|
|
|
|
j = i; |
|
|
|
|
nicks = ""; |
|
|
|
|
while (j < (i + modelen)) { |
|
|
|
|
nicks = nicks + members[j] + " "; |
|
|
|
|
j = j + 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
modestr = action + strrep(mode, modelen); |
|
|
|
|
/mode %channel %modestr %nicks |
|
|
|
|
i = i + modelen; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|