Jump to content
Gonzalez

[Perl] IRC OPBot

Recommended Posts

Posted
#!/usr/bin/perl

# rembawz.pl - IRC OPBot
# [7ru31337 - if j00 us3 th1z u'z a 7ru3 bl4c|< h4t h4><0rZZ]
# by RingZero
# www.rem0te.org

$nick = 'RemB4WZ'; # Nickname che apparia'
$ircd = 'irc.azzurra.org'; # Server IRC
$chan = '#rembawz'; # Chan IRC
$pass = 'pwdzdelbotasd'; # Password del BOT (per i comandi)
$upwd = ''; # Password del NickServ
use IO::Socket;

$sock = new IO::Socket::INET (
PeerAddr => $ircd,
PeerPort => 6667,
Proto => 'tcp'
) || "Impossibile connettersi a $ircd\n";

banner();

print $sock "NICK $nick\r\n";
print $sock "USER roflcopter 8 * :rem0te.org\r\n";
#print $sock "PRIVMSG NickServ :IDENTIFY $nick $upwd\r\n";
print $sock "JOIN $chan\r\n";

while($recv = <$sock>) {

if ($recv =~ /PRIVMSG $nick :!op (.*?) $pass/) {
print $sock "MODE $chan +o $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!deop (.*?) $pass/) {
print $sock "MODE $chan -o $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!hop (.*?) $pass/) {
print $sock "MODE $chan +h $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!dehop (.*?) $pass/){
print $sock "MODE $chan -h $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!v (.*?) $pass/) {
print $sock "MODE $chan +v $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!dev (.*?) $pass/) {
print $sock "MODE $chan -v $1\r\n";
}

if ($recv =~ /PRIVMSG $nick :!kick (.*?) $pass/) {
print $sock "KICK $chan $1 GTFO\r\n";
}

if ($recv =~ /PRIVMSG $nick :!kill $pass/) {
print $sock "PRIVMSG $chan :Addio stronzi di $chan\r\n";
print $sock "QUIT\r\n";
}

if ($recv =~ /PRIVMSG $nick :!ren (.*?) $pass/) {
print $sock "NICK $1\r\n";
}

if ($recv =~ /:(.*?)!(.*?) JOIN :$chan/) {
print $sock "PRIVMSG $chan :$1, benvenuto su $chan\r\n";
}

if ($recv =~ /PING .*?)/) {
print $sock "PONG :$1\r\n";
}

}

sub banner() {
print q {
__ _____
.----.-----.--------.| |--.| | |.--.--.--.-----.
| _| -__| || _ ||__ | | | |-- __|
|__| |_____|__|__|__||_____| |__||________|_____|

};
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...