From 3392e08441c616560cd1c12e20603724bb8ca19e Mon Sep 17 00:00:00 2001 From: alalalalbongo Date: Tue, 19 Jul 2016 17:06:59 +0200 Subject: [PATCH] fix bizarre rng bug --- MarkovBot.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MarkovBot.pl b/MarkovBot.pl index 863c803..5f7bddd 100644 --- a/MarkovBot.pl +++ b/MarkovBot.pl @@ -51,7 +51,8 @@ sub said { $self->say(channel => config("irc_channel"), body => "lad"); } my $chattiness = $redis->get("$redis_prefix:chattiness"); - if (rand 100 < $chattiness) { + my $rand = rand 100; + if ($rand < $chattiness) { # generate a shitpost my @line = split " ", $msg->{body}; return unless scalar(@line) > 1;