|Wazakindjes 5081274f24 kickban: Clarified multi-channel autokicker and wildcards imo tbh||1 year ago|
|.gitignore||3 years ago|
|LICENSE||3 years ago|
|README.md||1 year ago|
|kickban.cpp||1 year ago|
|queryspam_prot.cpp||2 years ago|
|regexwatch.cpp||2 years ago|
|sajoin_prot.cpp||2 years ago|
|sapart_rejoin.cpp||2 years ago|
This is now a collection of my modules for ZNC. ;3 Everything is tested with ZNC v1.6.3, UnrealIRCd v4.0.x and Anope v2.0.x, so it may or may not work with other versions/IRCds/services.
If you don't know how2compile modules:
autovoice, this module automatically kicks and bans people matching a certain
nick!ident@host mask when people join a channel, you get re-opped or someone changes their nick.
adduser <user> <hostmask> [channel1,channel2,...] <reason>-- you need to add a user before you can do any of the below commands ;]
addchans <user> <channel,[channel2[,...]>
delchans <user> <channel,[channel2[,...]>
The kick reason is required, unless you uncomment/change the following lines at the top of
kickban.cpp and recompile it:
//#define ENABLE_DEFAULT_REASON 1 CString defaultKickReason = "Ayy lmao";
An example for adding an autokicker would be:
/msg *kickban adduser guests Guest*!*@* * lmao ur an fuckstick. This will kick everyone with a nick like
Guest239, etc and sets a ban on the specified hostmask (
Guest*!*@*). This check runs for every channel (notice the individual
*), meaning any channel you have hops/ops/etc in will see the
Guest users being kicked. You can also restrict it to specific channels by doing something like:
/msg *kickban adduser guests Guest*!*@* #chan1,#chan2,#chan3 lmao ur an fuckstick
Besides the wildcard
* (matches 0 or more of any character), you can also use
? (must match exactly 1 character).
user field is merely the display name of that entry, it doesn't affect who it kicks. The
*chans commands are for maintaining channel restrictions, so you could do
delchans guests * and
addchans guests #privateshit for example. ;]
watch, but this one works with
ECMASCRIPT regexes. Currently it watches an entire network and channel messages/notices only (I see no point in having more hooks atm =]). The regexes are all case-insensitive.
C++ regexes require a GCC version of v4.9 or greater
Doesn't require any arguments at load time. Just load it at user or network level and add some regexes. Because of the nature of
\s for spaces instead of literal spaces
The module has some in-IRC commands obviously. ;3
add [nickregex] <regex>=> Add an entry to monitor for, optionally limited to
del <id>=> Deletes
idfrom the regex list
list=> List all regex patterns yo
test <id> [nick] <string>=> Check if regex pattern
idmatches the message
string, optionally with a nickname
buffer [count]=> Show/Set the amount of buffered lines while detached
halp=> Show in-IRC halp
Rejoins a channel after being
SAPARTed. Since that shit actually sends a
PART message on your behalf, it may get removed from ZNC entirely. The module tries to keep yo settings.
Has one optional argument
delay. That shit is in seconds and defines how long to wait before tryna rejoin. It's always at least 1 so clients don't shit themselves (i.e. Textual shows the channel grayed out even though you can send messages).
Prevents your client from opening up a bunch of tabs/windows for queries when getting spammed (usually by butts).
Takes 2 arguments:
threshold is how many times a message must be seen before it gets blocked entirely (default = 5).
timeout is in minutes and defines how long this exact message will be blocked for (default = 15).
The module checks for
PRIVMSGs aimed directly at you. If the message repeats more than
threshold times (from any source) all messages exactly like that will be blocked for
timeout minutes. This means your client will stop opening tabs/windows and you won't see any subsequent messages. =] When it gets unblocked you'll get a notification from the module.
Also, two minutes after receiving a message that wasn't classified as spam it will "cool down". This means the counter for that particular message will be reset to 0.
Protects you against forced joins (/sajoin etc). =]
This shit works by intercepting
JOIN messages and verifying if you even initiated them. If you didn't then you're being
SAJOINed and the mod will check if they are allowed ("trusted") channels (i.e. because you have them configured). If it's still like nope.avi it will send a
PART message in response (this all is invisible to the ZNC user). This may induce some "lag" because of the IRCd throttling your shit, so bnice k?
It also reports back every 2 minutes how many channels you were tried to join into. If there are none there will be no message obviously.
SAJOINed into (or attempted to kek)
#opersbut ZNC also wouldn't part it, resulting in a desync. The same happened with
/cycles done by modules like
autocycle. This is now fixed by temporarily holding off on joining such channels (2 seconds to be exact), then checking if you're supposed to attach to them.
Doesn't take any arguments, just load it and go. ;3
If you wanna edit the reporting timespan, you'll have to edit the source and recompile. Just look for:
netwerk->PutUser(":" + prefix + "email@example.com NOTICE " + nick + " :*** Over the last 2 minutes you were (tried to be) SAJOINed into " + count + " channels"); .... AddTimer(new CReportTimer(this, 120, 0, "sajoin_prot_report", "sajoin_prot_report"));
And change the
120 to the amount of seconds it should wait for its next report. May also wanna adjust the message it sends you. =]