Release 1.0
Released Apr 03, 2005 @ 09:07.
Summary
initial release
Notes
Ready to run!
It currently has 272 nouns and 143 adjectives.
Changes
everything ;)
Download
View
Slap.py.tar.gz
(tar archive
4Kb)
like to see the Slap module extended by a single check. It should check if the victim
is itself and respond appropriately. Below is a patch that should address this
and clean up some minor issues:
@@ -41,12 +41,9 @@
import supybot.conf as conf
-import supybot.utils as utils
from supybot.commands import *
-import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.ircmsgs as ircmsgs
-import supybot.privmsgs as privmsgs
import supybot.registry as registry
import supybot.callbacks as callbacks
@@ -79,13 +76,17 @@
victim = msg.nick
if not channel: # no channel given
channel = msg.args[0]
- if irc.nick == channel: #private chat
+ if ircutils.strEqual(irc.nick, channel): #private chat
channel = msg.nick
if not number:
number = 1
- for i in range(number):
- text = string.replace(self._buildSlap(), "$nick", victim)
- irc.queueMsg(ircmsgs.action(channel, text))
+
+ if ircutils.strEqual(victim, irc.nick): #being asked to hit itself
+ irc.reply(random.choice(self.comebacks))
+ else:
+ for i in range(number):
+ text = string.replace(self._buildSlap(), "$nick", victim)
+ irc.queueMsg(ircmsgs.action(channel, text))
slap = wrap(slap, [optional('channel'), optional('nick'), optional('int')])
def _buildSlap(self):
@@ -114,6 +115,9 @@
around = ''
return 'slaps $nick %s with %s %s %s' % (
around, an, adj, noun)
+ comebacks = ['no way', 'how studpid do you think I am?',
+ 'sure and afterwards should I kick myself too?']
+
nouns = ['trout','space ship','Orlando Bloom','pi','apple pie',
'rad scorpion','rock band','metal band','Lord of the Rings',
'One','board','tv','floppy 5.25"','dschinn','dice','shadowrunner',
Replies to this comment