From: timriker Date: Mon, 28 Jun 2004 18:26:48 +0000 (+0000) Subject: random quote/factoid is now random for each channel X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d434e1090d20004c6eef7c1f314466eb856ffa74;p=infobot.git random quote/factoid is now random for each channel git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@962 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/IRC/Schedulers.pl b/src/IRC/Schedulers.pl index e52f4eb..739d788 100644 --- a/src/IRC/Schedulers.pl +++ b/src/IRC/Schedulers.pl @@ -128,15 +128,15 @@ sub randomQuote { return if ($_[0] eq "2"); # defer. } - my $line = &getRandomLineFromFile($bot_data_dir. "/blootbot.randtext"); - if (!defined $line) { - &ERROR("random Quote: weird error?"); - return; - } - foreach ( &ChanConfList("randomQuote") ) { next unless (&validChan($_)); + my $line = &getRandomLineFromFile($bot_data_dir. "/blootbot.randtext"); + if (!defined $line) { + &ERROR("random Quote: weird error?"); + return; + } + &status("sending random Quote to $_."); &action($_, "Ponders: ".$line); } @@ -154,22 +154,22 @@ sub randomFactoid { return if ($_[0] eq "2"); # defer. } - while (1) { - ($key,$val) = &randKey("factoids","factoid_key,factoid_value"); -### $val =~ tr/^[A-Z]/[a-z]/; # blah is Good => blah is good. - last if (defined $val and $val !~ /^ blah is good. + last if ((defined $val) and ($val !~ /^