Guest User

Untitled

a guest
Jul 27th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. use warnings;
  2. use POE qw(Component::IRC);
  3. use strict;
  4. use utf8;
  5. use Encode;
  6. use HTML::LinkExtractor;
  7. use HTML::Tree;
  8. use HTML::Entities;
  9. use LWP::Simple qw($ua get);
  10. use URI::Escape;
  11.  
  12. my $nickname = 'GuiltySpark';
  13. my $ircname = '343GS';
  14. my $server = '127.0.0.1';
  15.  
  16. my @channels = ('#thf', '#help', '#ex omitted', '#ops omitted');
  17.  
  18. my $irc = POE::Component::IRC->spawn(
  19. nick => $nickname,
  20. ircname => $ircname,
  21. server => $server,
  22. Flood => 1,
  23. ) or die "Cannot establish connection";
  24.  
  25. POE::Session->create(
  26. package_states=> [
  27. main => [ qw(_default _start irc_001 irc_msg irc_public) ],
  28. ],
  29. heap => { irc=> $irc },
  30. );
  31.  
  32. $poe_kernel->run();
  33.  
  34. my $oldthyme = 1;
  35.  
  36. sub _start {
  37. my $heap = $_[HEAP];
  38.  
  39. my $irc = $heap->{irc};
  40.  
  41. $irc->yield( register => 'all' );
  42. $irc->yield( connect => { } );
  43. return;
  44. }
  45.  
  46. sub irc_001 {
  47. my $sender = $_[SENDER];
  48.  
  49. my $irc = $sender->get_heap();
  50.  
  51. print "Connected to ", $irc->server_name(), "\n";
  52.  
  53. $irc->yield('privmsg', 'NickServ', 'identify omitted');
  54. $irc->yield('oper', 'GuiltySpark', 'omitted');
  55. $irc->yield( join => $_ ) for @channels;
  56. return;
  57. }
  58.  
  59. sub irc_msg {
  60. my ($sender, $who, $text) = @_[SENDER, ARG0 .. ARG2];
  61. my $nick = ( split /!/, $who )[0];
  62. my $friendzor = "HostServ";
  63.  
  64. my $member = "Member\@TheHaloForum.com";
  65. my $exclusive = "Exclusive\@TheHaloForum.com";
  66. my $moderator = "Moderator\@TheHaloForum.com";
  67.  
  68. # check message text for password
  69. if($text eq "omitted")
  70. {
  71. irc->yield( privmsg => $friendzor => 'set $nick $member');
  72. 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.");
  73.  
  74. }
  75. if($text eq "omitted")
  76. {
  77. irc->yield('privmsg', $friendzor, "set $nick $exclusive");
  78. 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.");
  79. }
  80. if($text eq "omitted")
  81. {
  82. irc->yield('privmsg', $friendzor, "set $nick $moderator");
  83. 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.");
  84. }
  85. }
Add Comment
Please, Sign In to add comment