Posted By

Nasarias on 12/07/10


Tagged

irssi frostwire


Versions (?)

Host.pl


 / Published in: Perl
 

  1. use Irssi;
  2. use vars qw($VERSION %IRSSI);
  3.  
  4. $VERSION = "0.1";
  5. %IRSSI = (
  6. authors => 'PrincessLeia2',
  7. contact => 'lyz\@princessleia.com ',
  8. name => 'gimmie',
  9. description => 'a script, using !host will will get you a host.',
  10. license => 'GNU GPL v2 or later',
  11. url => 'http://www.princessleia.com/'
  12. );
  13.  
  14. open ( HOSTS, "<.irssi/hosts" ) or die "can't open host:$!\n";
  15. chomp( @hosts = <HOSTS> );
  16. close hosts;
  17.  
  18. sub event_privmsg {
  19. my ($server, $data, $nick, $mask, $target) =@_;
  20. my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
  21. return if ( $target !~ /#test/i );
  22. if ( $text !~ /^!/i );
  23. if ( $text =~ /^!host *?$/i ) {
  24. $urfact = $hosts[rand @hosts];
  25. $server->command ( "msg $target $urfact" );
  26. }
  27. }
  28. Irssi::signal_add('event privmsg', 'event_privmsg');

Report this snippet  

You need to login to post a comment.