Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use warnings;
- use POE qw(Component::IRC);
- use strict;
- use utf8;
- use Encode;
- use HTML::LinkExtractor;
- use HTML::Tree;
- use HTML::Entities;
- use LWP::Simple qw($ua get);
- use URI::Escape;
- my $nickname = 'GuiltySpark';
- my $ircname = '343GS';
- my $server = '127.0.0.1';
- my @channels = ('#thf', '#help', '#ex omitted', '#ops omitted');
- my $irc = POE::Component::IRC->spawn(
- nick => $nickname,
- ircname => $ircname,
- server => $server,
- Flood => 1,
- ) or die "Cannot establish connection";
- POE::Session->create(
- package_states=> [
- main => [ qw(_default _start irc_001 irc_msg irc_public) ],
- ],
- heap => { irc=> $irc },
- );
- $poe_kernel->run();
- my $oldthyme = 1;
- sub _start {
- my $heap = $_[HEAP];
- my $irc = $heap->{irc};
- $irc->yield( register => 'all' );
- $irc->yield( connect => { } );
- return;
- }
- sub irc_001 {
- my $sender = $_[SENDER];
- my $irc = $sender->get_heap();
- print "Connected to ", $irc->server_name(), "\n";
- $irc->yield('privmsg', 'NickServ', 'identify omitted');
- $irc->yield('oper', 'GuiltySpark', 'omitted');
- $irc->yield( join => $_ ) for @channels;
- return;
- }
- sub irc_msg {
- my ($sender, $who, $text) = @_[SENDER, ARG0 .. ARG2];
- my $nick = ( split /!/, $who )[0];
- my $friendzor = "HostServ";
- my $member = "Member\@TheHaloForum.com";
- my $exclusive = "Exclusive\@TheHaloForum.com";
- my $moderator = "Moderator\@TheHaloForum.com";
- # check message text for password
- if($text eq "omitted")
- {
- irc->yield( privmsg => $friendzor => 'set $nick $member');
- irc->yield('privmsg', $nick, "Your vhost is now Member\@TheHaloForum.com, reconnect to the server to use it. Now whenever you identify with this nickname, you will be assigned this vhost.");
- }
- if($text eq "omitted")
- {
- irc->yield('privmsg', $friendzor, "set $nick $exclusive");
- irc->yield('privmsg', $nick, "Your vhost is now Exclusive\@TheHaloForum.com, reconnect to the server to use it. Now whenever you identify with this nickname, you will be assigned this vhost.");
- }
- if($text eq "omitted")
- {
- irc->yield('privmsg', $friendzor, "set $nick $moderator");
- irc->yield('privmsg', $nick, "Your vhost is now Moderator\@TheHaloForum.com, reconnect to the server to use it. Now whenever you identify with this nickname, you will be assigned this vhost.");
- }
- }
Add Comment
Please, Sign In to add comment