All pastes #172041 Raw Edit

Someone

public text v1 · immutable
·published 2006-09-15 19:52 UTC
rendered paste body
#!/usr/local/bin/perl -w

use strict;
my $mlw = 410;

Xchat::hook_command("chr", "pota_coderssumsum");

sub pota_coders2ret($$) {
    my ($txt, $nr) = @_;
    my @tA = split(/\s/, $txt);
    for(my $i = 0;$i < scalar(@tA);$i++) {
        $tA[$i] = "\003" . $i . "," . ($i+$nr) . $tA[$i];
    }
    my $ret = join(' ', @tA);
    return $ret;
}

sub pota_coderssumrand {
    my $txt = shift;
    my $et = "";
    my $b = 0;
    my $i = 0;
    while(length($et) + $b < $mlw) {
        $i = length($et);
        $et .= pota_coders2ret($txt, int(rand(16)));
        if($b < (length($et) - $i)) {
            $b = (length($et) - $i);
        }
        
    }
    Xchat::command("say $et", Xchat::get_info('channel'), Xchat::get_info('server'));
    return 1;
}
sub pota_coderssumsum {
    my $txt = shift;
    my $v = int(rand(3)) + 3;
    for(my $i=0;$i<$v;$i++) {
        pota_coderssumrand($txt);
    }
    return 1;
}