Markov: add support for temporarily disabling chatter by supplying a negative chance

This commit is contained in:
Brian S. Stephan 2011-10-21 16:59:57 -05:00
parent 78f7614987
commit e3ef3f48dc
1 changed files with 4 additions and 3 deletions

View File

@ -349,6 +349,7 @@ class Markov(Module):
targets = self._get_chatter_targets()
for t in targets:
if t['chance'] > 0:
a = random.randint(1, t['chance'])
if a == 1:
self.sendmsg(self.connection, t['target'], self._generate_line(t['target']))