Updated jeffk and lithp.

This commit is contained in:
Jeremy Fincher 2003-10-22 19:43:38 +00:00
parent b03e5612d2
commit f7caf3f4fd
2 changed files with 37 additions and 16 deletions

View File

@ -413,6 +413,10 @@ class Fun(callbacks.Privmsg):
text = text.replace('Z', 'Th')
text = text.replace('x', 'kth')
text = text.replace('X', 'KTH')
text = text.replace('cce', 'kth')
text = text.replace('CCE', 'KTH')
text = text.replace('tion', 'thion')
text = text.replace('TION', 'THION')
irc.reply(msg, text)
_leettrans = string.maketrans('oOaAeElBTiIts', '004433187!1+5')
@ -644,8 +648,35 @@ class Fun(callbacks.Privmsg):
if random.random() < .4:
random.shuffle(L)
return ''.join(L)
def randomlyLaugh(text, probability=.3):
if random.random() < probability:
if random.random() < .5:
insult = random.choice([' fagot1', ' fagorts', ' jerks',
'fagot' ' jerk', ' dumbshoes',
' dumbshoe'])
else:
insult = ''
laugh1 = random.choice(['ha', 'hah', 'lol', 'l0l', 'ahh'])
laugh2 = random.choice(['ha', 'hah', 'lol', 'l0l', 'ahh'])
laugh1 = laugh1 * random.randrange(1, 5)
laugh2 = laugh2 * random.randrange(1, 5)
exclaim = random.choice(['!', '~', '!~', '~!!~~',
'!!~', '~~~!'])
exclaim += random.choice(['!', '~', '!~', '~!!~~',
'!!~', '~~~!'])
if random.random() < 0.5:
exclaim += random.choice(['!', '~', '!~', '~!!~~',
'!!~', '~~~!'])
laugh = ''.join([' ', laugh1, laugh2, insult, exclaim])
text += laugh
return text
text = privmsgs.getArgs(args)
if random.random() < .03:
irc.reply(msg, randomlyLaugh('NO YUO'))
return
alwaysInsertions = {
r'er\b': 'ar',
r'\bthe\b': 'teh',
@ -682,21 +713,8 @@ class Fun(callbacks.Privmsg):
text = re.sub(r'([bcdfghkjlmnpqrstvwxyz])([bcdfghkjlmnpqrstvwxyz])',
lessRandomlyShuffle, text)
if random.random() < .3:
if random.random() < .5:
insult = random.choice([' fagot1', ' fagorts', ' jerks',
'fagot'
' jerk', ' dumbshoes', ' dumbshoe'])
else:
insult = ''
laugh1 = random.choice(['ha', 'hah', 'lol', 'l0l', 'ahh'])
laugh2 = random.choice(['ha', 'hah', 'lol', 'l0l', 'ahh'])
laugh1 = laugh1 * random.randrange(1, 5)
laugh2 = laugh2 * random.randrange(1, 5)
exclaim = random.choice(['!', '~', '!~', '~!!~~', '!!~', '~~~!'])*2
laugh = ''.join([' ', laugh1, laugh2, insult, exclaim])
text += laugh
text = randomlyLaugh(text)
if random.random() < .4:
text = text.upper()

View File

@ -43,7 +43,10 @@ class FunTest(PluginTestCase, PluginDocumentation):
self.assertNotError('objects')
self.assertNotError('levenshtein Python Perl')
self.assertNotError('soundex jemfinch')
self.assertNotError('jeffk the quick brown fox is ghetto')
def testJeffk(self):
for i in range(100):
self.assertNotError('jeffk the quick brown fox is ghetto')
def testMorse(self):
self.assertResponse('unmorse [morse jemfinch]', 'JEMFINCH')