- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
User:Meepsheep/sheepbot.pl
From Encyclopedia Dramatica
Jump to navigationJump to search
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::SSL;
use MediaWiki::API;
my $server = 'irc.lulz.net';
my $nick = 'hinaichigo';
my $channel = '#ed-logging';
my @owners = ('[email protected]' );
my $url = 'https://encyclopediadramatica.se';
my $acct = 'SheepBot';
my $pass = 'LOL NO';
my $mw = MediaWiki::API->new();
$mw->{config}->{api_url} = "$url/api.php";
$mw->login( { lgname => $acct, lgpassword => $pass } );
my $sock = IO::Socket::SSL->new(
PeerAddr => $server,
PeerPort => '6697',
Proto => 'tcp');
print $sock "NICK $nick\r\n";
print $sock "USER $nick * * :$nick\r\n";
while (my $input = <$sock>) {
print "$input\n";
if ($input =~ /004/) { last; }
elsif ($input =~ /433/) { die "Nickname is already in use."; }
}
print $sock "JOIN $channel\r\n";
while ( my $input = <$sock> ) {
chop $input;
$input =~ s/\cC\d{1,2}(?:,\d{1,2})?|[\cC\cB\cI\cU\cR\cO]//g;
print "$input\n";
if ($input =~ /^PING(.*)$/i) { print $sock "PONG $1\r\n"; }
if (($input =~ /^:(.*)!.*/i) and ($input =~/PRIVMSG/i)) {
my @stuffy1 = split('PRIVMSG ', $input);
my @stuffy2 = split(' :', $stuffy1[1]);
my @user1 = split('!', $input);
my @user2 = split(' ', $user1[1]);
my @user3 = split(':', $input);
my @user4 = split('!', $user3[1]);
if ($user4[0] eq '[WikiBot]') {
#(19:12) [WikiBot]: [[User:Meepsheep]] http://encyclopediadramatica.se/index.php?diff=528332&oldid=528120&rcid=562180 * Meepsheep * (-318)
my ($page) = ($input =~ /\[\[(.*)\]\] [a-zA-Z]/);
my ($user) = ($input =~ /\* (.*) \* \(/);
print $sock "PRIVMSG Meepsheep :$page - $user\r\n";
if (($page eq 'Adventure Time and Regular Show') and ($user eq 'Gray')) {
$mw->edit( {
action => 'rollback',
title => $page,
user => $user,
summary => "FUCKING NIGGER FAGGOT SHUT YOUR FUCKING MOUTH",
} );
$mw->edit( {
action => 'purge',
title => $page,
} );
}
if (($stuffy2[1] =~ /A challenger appears/) and ($page eq 'Special:Log/newusers')) {
my @hi = ("sup", "hi", "hello", "welcome", "go away", "well hi there", "o hi", "welcome to ED", "hihi", "h");
my @name = ("nigger", "nig", "nignog", "faggot", "faggo", "fag", "cocksucker", "dickhead", "noob", "newfaggot", "newfag", "n00b", $user);
my $template = '{{welcome}}';
$mw->edit( {
action => 'edit',
title => "User talk:".$user,
text => "$template\n~~~~",
createonly => 1,
summary => $hi[rand @hi].", ".$name[rand @name]
} );
}
if ($stuffy2[1] =~ /\]\] !N http/) {
unless (($page =~ "User:") or ($page =~ "Talk:") or ($page =~ "User talk:")) {
my $info = $mw->list ({
action => 'query',
list => 'users',
ususers => $user,
usprop => 'editcount',
});
foreach (@{$info}) {
my $ec = "$_->{editcount}";
if ($ec<31) {
my $ref = $mw->get_page( { title => 'User talk:'.$user } );
$mw->edit( {
action =>'edit',
title => "User talk:".$user,
text => $ref->{'*'} . "\n==hi==\n{{User:Meepsheep/shit|".$page."}}\n~~~~",
} );
} } } }
if ($stuffy2[1] =~ /\((.*)\)/) {
my ($diff) = ($input =~ /\((.*)\)/);
if ($diff =~ /\-/) {
$diff =~ s/\-//;
if ($diff>1500) {
unless ($page eq "User:".$user) {
my $info = $mw->list ({
action => 'query',
list => 'users',
ususers => $user,
usprop => 'editcount',
});
foreach (@{$info}) {
my $ec = "$_->{editcount}";
if ($ec<11) {
$mw->edit( {
action => 'rollback',
title => $page,
user => $user,
summary => "UNBLANKING IN PROGRESS",
} );
$mw->edit( {
action => 'purge',
title => $page,
} );
$mw->edit( {
action =>'edit',
title => "User:".$user,
text => "{{Blanker|".$page."}}",
} );
} } }
} } }
}
if (grep {$_ eq $user2[0]} @owners) {
if ($stuffy2[1] =~ /^\+join/i) {
my @chan = split('\+join ', $stuffy2[1]);
print $sock "JOIN ".$chan[1]."\r\n";
}
if ($stuffy2[1] =~ /^\+part/i) {
my @chan = split('\+part ', $stuffy2[1]);
print $sock "PART ".$chan[1]."\r\n";
}
if ($stuffy2[1] =~ /^\+nick/i) {
my @nnick = split('\+nick ', $stuffy2[1]);
print $sock "NICK ".$nnick[1]."\r\n";
}
if ($stuffy2[1] =~ /^\+quit/i) { print $sock "QUIT\r\n"; }
}
}
}