Skip to content

Commit

Permalink
chatbot: fix trigger chance
Browse files Browse the repository at this point in the history
  • Loading branch information
anydot committed Nov 24, 2010
1 parent e1c7526 commit 5f89aa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion irssi/scripts/chatbot.pl
Expand Up @@ -31,7 +31,10 @@ sub on_msg {

return if grep {lc eq lc $nick} split(/ /, Irssi::settings_get_str('bot_megahal_ignore'));
if ($message !~ s/^\s*$mynick[,:]\s*(.*)$/$1/i) {
return if (int(rand(Irssi::settings_get_int('bot_megahal_triggerchance'))));
return
unless Irssi::settings_get_int('bot_megahal_triggerchance');
return
if (int(rand(Irssi::settings_get_int('bot_megahal_triggerchance'))));
# With very small chance, we will reply to the user.
}

Expand Down

0 comments on commit 5f89aa7

Please sign in to comment.