This is an old revision of the document!


#!/usr/bin/perl
open(HANDLE, "/home/kiu/.xchat2/xchatlogs/rettungskapsel-#ccc.log");
open(NC, "|nc -u matrix 2323");
select((select(NC), $| = 1)[0]);

while ($record = <HANDLE>) {
}

print NC "IRCBot started";

while (1) {
    if (! ($record = <HANDLE>)) {
        sleep 1;
    }

    $_ = $record;
    if ($record =~ m/MATRIX/) {
        $record =~ s/[\'\"\*\^\|\`|\_]//g;
        $record =~ s/(.*)\t//;
        $record =~ s/\((.*)\) has//;
        $record =~ s/MATRIX//;
        $record =~ s/ä/ae/;
        $record =~ s/ü/ue/;
        $record =~ s/ö/oe/;
        $record =~ s/Ä/Ae/;
        $record =~ s/Ü/Ue/;
        $record =~ s/Ö/Oe/;
        $record =~ s/ß/ss/;

        print "$record";
        print NC "$record";
    }

}

close(HANDLE);
close(NC);
  • matrix_irc_script.1203460813.txt.gz
  • Last modified: 2021/04/18 12:32
  • (external edit)