From 6cf8963cfc8dc562f7ec8f3c5d538f05a0e7a0be Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Thu, 16 Aug 2012 06:58:14 +0000 Subject: Disabled message-sending-throttling Added a command to view uptime/cpu/ram usage statistics The hilight/dehilight commands can accept a comma-separated list of nicks The exempt command is now deprecated A restriction-system has been added to replace the old exemption system, and also includes additional restrictions that can be added, such as "don't let this account use !ops" Added a plugin command, so other bots can have ASM generate alerts Updated users and flags Updated channel hilights Replaced code that shows up in several places to split a long privmsg into two parts with a utility function Added a detection class for fuzzy-matching against a nick blacklist Fixed some major memory leaks, the bot stays stable around 30MB rather than shooting up to 65MB after a couple of days The bot now uses nickserv REGAIN instead of ghost/release/nick Added channel modes, ban lists, and quiet lists to state tracking Ignore chanserv in netsplit detections Track time/setter when a topic is changed in a channel Monitor if a channel is set +r and is still +r 45 minutes later, if so generate an alert Print status and how long it took to sync once the bot has started and synced, and warn about failed syncings. --- config-default/channels.xml | 61 ++++++++++++++-------------- config-default/commands.xml | 88 ++++++++++++++++++++++++++++++----------- config-default/restrictions.xml | 13 ++++++ config-default/users.xml | 13 +++--- 4 files changed, 118 insertions(+), 57 deletions(-) create mode 100644 config-default/restrictions.xml (limited to 'config-default') diff --git a/config-default/channels.xml b/config-default/channels.xml index c9312b7..ecefc7a 100644 --- a/config-default/channels.xml +++ b/config-default/channels.xml @@ -2,6 +2,11 @@ + + + DLange + + @@ -42,15 +47,13 @@ - ST47 + Dominian denny - numist tomaw WildPikachu Gary vorian DLange - pinPoint njan @@ -61,13 +64,21 @@ WildPikachu denny - numist - PhilKC + tomaw + Gary + vorian + DLange + njan + Dominian ##linux-ops + + + + @@ -80,6 +91,12 @@ + + + Kelsie + + + ttuttle @@ -121,6 +138,7 @@ + @@ -152,21 +170,18 @@ Dave2 Martinp23 SeJo - pctony Corey - theacolyte- nhandler - Plazma - Plazma-Rooolz mquin ttuttle njan ttuttle + gry + Adran denny Gary JonathanD ZoFreX - DLange PriceChild werdan7 dax @@ -179,6 +194,10 @@ + + + + NeddySeagoon @@ -207,7 +226,6 @@ Thehelpfulone tomaw - DLange RichiH @@ -317,7 +335,6 @@ Martinp23 PeterSymonds vvv - Barras AfterDeath DeltaQuad Snowolf @@ -371,13 +388,13 @@ Not_the_NSA Kanonkas PeterSymonds - Barras AfterDeath Logan_ jeremyb AfterDeath charitwo TBloemink + Mh7kJ slakr @@ -403,7 +420,6 @@ Thehelpfulone Tempodivalse Tanvir - Barras peteforsyth Az1568 Cbrown1023 @@ -425,7 +441,6 @@ - Barras PeterSymonds Snowolf Thehelpfulone @@ -436,8 +451,8 @@ Fluffernutter Pmlineditor juancarlos - omtsh MBisanz + Mh7kJ #wikimedia-ops @@ -488,7 +503,6 @@ jeremyb Maximillion stwalkerster - Barras DeltaQuad Gfoley4 Logan_ @@ -497,6 +511,7 @@ Tanvir TBloemink Rjd0060 + Shirik bumm13_ Cyrius DanielB @@ -538,7 +553,6 @@ stwalkerster Jamesofur SpitfireWP - Barras jeremyb DeltaQuad Theo10011 @@ -548,7 +562,6 @@ Steven_Zhang Shirik TBloemink - foxj Rjd0060 Cobi Golbez @@ -634,8 +647,6 @@ Snowolf Tanvir TBloemink - Barras - Barras Ocaasi mabdul KFP @@ -690,13 +701,6 @@ #wikimedia-ops - - - - - - - @@ -706,7 +710,6 @@ marienz mrmist dave2 - RichiH ##asb-nexus diff --git a/config-default/commands.xml b/config-default/commands.xml index 56db997..19e91ac 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -1,4 +1,16 @@ + + privmsg($event->{to}->[0], "This bot has been running for " . (time - $::starttime) . " seconds" . + ", is tracking " . (scalar (keys %::sn)) . " nicks" . + " across " . (scalar (keys %::sc)) . " tracked channels." . + " It is using " . $size . "KB of RAM" . + " and has used " . $cputime . " of CPU time."); + ]]> + privmsg($event->{to}->[0], $1 . " is on: " . ASM::Util->commaAndify(@{$::sn{lc $1}->{mship}})); @@ -164,7 +176,7 @@ {channel}->{$chan}->{hilights}->{$level})) { $::channels->{channel}->{$chan}->{hilights}->{$level} = []; } - my @tmphl = @{$::channels->{channel}->{$chan}->{hilights}->{$level}}; - push(@tmphl, $nick); - $::channels->{channel}->{$chan}->{hilights}->{$level} = \@tmphl; + foreach my $nick (@nicks) { + my @tmphl = @{$::channels->{channel}->{$chan}->{hilights}->{$level}}; + push(@tmphl, $nick); + $::channels->{channel}->{$chan}->{hilights}->{$level} = \@tmphl; + } ASM::XML->writeChannels(); - $conn->privmsg($event->{to}->[0], "$nick added to $level risk hilights for $chan"); + $conn->privmsg($event->{to}->[0], ASM::Util->commaAndify(@nicks) . " added to $level risk hilights for $chan"); ]]> getLink(lc $chan); if ( lc $link ne lc $chan ) { $conn->privmsg($event->{to}->[0], "Error: $chan is linked to $link - use $link instead."); @@ -202,11 +216,13 @@ foreach my $risk ( keys %::RISKS ) { next unless defined($::channels->{channel}->{$chan}->{hilights}->{$risk}); my @ppl = @{$::channels->{channel}->{$chan}->{hilights}->{$risk}}; - @ppl = grep { lc $_ ne lc $nick } @ppl; + foreach my $nick (@nicks) { + @ppl = grep { lc $_ ne lc $nick } @ppl; + } $::channels->{channel}->{$chan}->{hilights}->{$risk} = \@ppl; } ASM::XML->writeChannels(); - $conn->privmsg($event->{to}->[0], "Removing hilights for $nick in $chan"); + $conn->privmsg($event->{to}->[0], "Removing hilights for " . ASM::Util->commaAndify(@nicks) . " in $chan"); ]]> @@ -275,15 +291,29 @@ > io 'exempt.txt'; - $conn->privmsg($event->{to}->[0], $x . " exempted"); + $conn->privmsg($event->{to}->[0], "This command is now deprecated. Use ;restrict nick/account/host lineToRestrict +notrigger instead, i.e. ;restrict account eir +notrigger"); + ]]> + + + {$type . 's'}->{$type}->{$who}->{$restriction}; + $conn->privmsg($event->{to}->[0], "Removed $restriction restriction for $type $who"); + } + if ($mode eq '+') { + if (! defined($::restrictions->{$type . 's'}->{$type}->{$who})) { + $::restrictions->{$type . 's'}->{$type}->{$who} = {}; + } + $::restrictions->{$type . 's'}->{$type}->{$who}->{$restriction} = $restriction; + $conn->privmsg($event->{to}->[0], "Added $restriction restriction for $type $who"); + } + ASM::XML->writeRestrictions(); ]]> {nick}}->{dnsbl} == 0) { + if (ASM::Util->notRestricted(lc $event->{nick}, "noops")) { my $tgt = $event->{to}->[0]; $tgt = $1 if (defined($1)); my $msg = $1; @@ -293,17 +323,10 @@ $conn->schedule(30, sub { delete($::ignored{$tgt})}); my $hilite=ASM::Util->commaAndify(ASM::Util->getAlert($tgt, 'opalert', 'hilights')); my $txtz = "[\x02$tgt\x02] - $event->{nick} wants op attention ($msg) $hilite"; - foreach my $tgt2 (ASM::Util->getAlert($tgt, 'opalert', 'msgs')) { #unfortunately wikipedia has way too many ops, and it breaks things - if (length($txtz) <= 380) { - $conn->privmsg($tgt2, $txtz); - } else { - my $splitpart = rindex($txtz, " ", 380); - $conn->privmsg($tgt2, substr($txtz, 0, $splitpart)); - $conn->privmsg($tgt2, substr($txtz, $splitpart)); - } - } + my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); + ASM::Util->sendLongMsg($conn, \@tgts, $txtz); } -# } + } ]]> @@ -314,4 +337,23 @@ $conn->privmsg($event->{to}->[0], "$str blacklisted"); ]]> + + {nick} plugin)\x02 - ${reason}; ping "; + $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $risk, 'hilights')) if (ASM::Util->getAlert(lc $chan, $risk, 'hilights')); + $txtz = $txtz . ' !att-' . $chan . '-' . $risk; + my @tgts = ASM::Util->getAlert($chan, $risk, 'msgs'); + if (length($txtz) <= 380) { + $conn->privmsg(\@tgts, $txtz); + } else { + my $splitpart = rindex($txtz, " ", 380); + $conn->privmsg(\@tgts, substr($txtz, 0, $splitpart)); + $conn->privmsg(\@tgts, substr($txtz, $splitpart)); + } + ]]> + diff --git a/config-default/restrictions.xml b/config-default/restrictions.xml new file mode 100644 index 0000000..c022a7c --- /dev/null +++ b/config-default/restrictions.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/config-default/users.xml b/config-default/users.xml index d083b8e..c01a206 100644 --- a/config-default/users.xml +++ b/config-default/users.xml @@ -1,27 +1,29 @@ - + - - + + + - + + @@ -29,6 +31,7 @@ + @@ -36,6 +39,6 @@ - + -- cgit v1.2.3