All pastes #73753 Raw Edit

Anonymous

public text v1 · immutable
#73753 ·published 2006-06-28 06:24 UTC
rendered paste body
my $i = 0;
my $count = 0;
my $counts = '';
foreach $quote (@quotes) {
	if($quotes[$i]->{'author'} eq $args[1]) {
		$count++;
		$counts = $counts.$i."::";
	}
	
	$i++;
}

if($count > 0) {
	my $rand = rand(int($count-1));
	my @counters = split(/::/, $counts);
	$conn->privmsg($settings{'home'}, "[".$quotes[$rand]{'author'}."] ".$quotes[$rand]{'quote'});
	
	return;
}

$conn->notice($nick, "There are no quotes by that nickname.");
return;