Markov: add support for temporarily disabling chatter by supplying a negative chance
This commit is contained in:
parent
78f7614987
commit
e3ef3f48dc
|
@ -349,9 +349,10 @@ class Markov(Module):
|
||||||
|
|
||||||
targets = self._get_chatter_targets()
|
targets = self._get_chatter_targets()
|
||||||
for t in targets:
|
for t in targets:
|
||||||
a = random.randint(1, t['chance'])
|
if t['chance'] > 0:
|
||||||
if a == 1:
|
a = random.randint(1, t['chance'])
|
||||||
self.sendmsg(self.connection, t['target'], self._generate_line(t['target']))
|
if a == 1:
|
||||||
|
self.sendmsg(self.connection, t['target'], self._generate_line(t['target']))
|
||||||
|
|
||||||
def _do_shut_up_checks(self):
|
def _do_shut_up_checks(self):
|
||||||
"""Check to see if we've been talking too much, and shut up if so."""
|
"""Check to see if we've been talking too much, and shut up if so."""
|
||||||
|
|
Loading…
Reference in New Issue