All pastes #22095 Raw Edit

Anonymous

public text v1 · immutable
#22095 ·published 2005-09-04 12:04 UTC
rendered paste body
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "1.0";
%IRSSI = (
        authors => 'Jonas Bolldén',
        contact => 'jonas.bollden@gmail.com',
        name => 'OnSay',
        description => 'This script answers to specific sentences',
        license => 'GNU GPL v2 or later',
        url => ''
    );

sub event_onsay {
      my ($server, $data, $nick, $mask, $target) = @_;
      my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
      if($text =~ /var (är|e|ä) fjant/i) {
              $response = "HÄÄR MAMMA!";
            } elsif($text =~ /tomte/i) {
                    $response = "ööhh hööh en hel tomtearmé!";
                  } elsif($text =~ /archangel rule(s|z)/i) {
                          $response = "Jag vet!";
                        }
      $server->command("msg $target $response");
      $response = "";
    }
Irssi::signal_add('event privmsg', 'event_onsay');