From b3ddef010530bfecaa6ef7401b08fbad0c6776f4 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 23 Aug 2004 12:23:21 +0000 Subject: [PATCH] Style updates, basically, and some slight functionality changes. --- plugins/Fun.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/Fun.py b/plugins/Fun.py index 329cac448..6aa7c5f77 100644 --- a/plugins/Fun.py +++ b/plugins/Fun.py @@ -333,10 +333,8 @@ class Fun(callbacks.Privmsg): - # # The list of words and algorithm are pulled straight the mozbot # MagicEightBall.bm module. - # _responses = {'positive': ['It is possible.', 'Yes!', 'Of course.', 'Naturally.', 'Obviously.', 'It shall be.', 'The outlook is good.', 'It is so.', @@ -361,18 +359,18 @@ class Fun(callbacks.Privmsg): category = 'negative' else: category = 'unknown' - response = self._responses[category][ int(time.time()) % len(self._responses[category]) ] - return response + return random.choice(self._responses[category]) def eightball(self, irc, msg, args): """[] Ask a question and the answer shall be provided. """ - if len(args) == 0: - irc.reply(self._checkTheBall(2) ) + text = privmsgs.getArgs(args, required=0, optional=1) + if text: + irc.reply(self._checkTheBall(len(text))) else: - irc.reply(self._checkTheBall(len(string.join(args,' '))) ) + irc.reply(self._checkTheBall(random.randrange(0, 3))) _rouletteChamber = random.randrange(0, 6) _rouletteBullet = random.randrange(0, 6)