1 diff -ruN --exclude {arch} --exclude .arch-ids servus--dev--0--patch-2/ChangeLog.d/servus--dev--0 servus--dev--0--patch-4/ChangeLog.d/servus--dev--0
2 --- servus--dev--0--patch-2/ChangeLog.d/servus--dev--0 2005-07-22 23:17:44.000000000 +0100
3 +++ servus--dev--0--patch-4/ChangeLog.d/servus--dev--0 2005-07-22 23:17:45.000000000 +0100
5 # arch-tag: automatic-ChangeLog--rjk@greenend.org.uk--2004/servus--dev--0
8 +2005-07-22 22:02:48 GMT Richard Kettlewell <rjk@greenend.org.uk> patch-4
13 + servus--dev--0--patch-4
15 + * commands.py: slashq command implements slashing of a pair of names
16 + * Servus-chiark.py: configuration and setup for slash command
19 + ChangeLog.d/servus--dev--0 Servus-chiark.py commands.py
22 +2005-07-22 21:36:36 GMT Richard Kettlewell <rjk@greenend.org.uk> patch-3
27 + servus--dev--0--patch-3
29 + * Servus-chiark.py: save karma file each time it is changed, not just on
30 + graceful termination; and rename it into place.
31 + This prevents unnecessary forgetting of karma.
34 + ChangeLog.d/servus--dev--0 Servus-chiark.py
37 2005-07-22 21:29:40 GMT Richard Kettlewell <rjk@greenend.org.uk> patch-2
40 diff -ruN --exclude {arch} --exclude .arch-ids servus--dev--0--patch-2/Servus-chiark.py servus--dev--0--patch-4/Servus-chiark.py
41 --- servus--dev--0--patch-2/Servus-chiark.py 2005-07-22 23:17:43.000000000 +0100
42 +++ servus--dev--0--patch-4/Servus-chiark.py 2005-07-22 23:17:45.000000000 +0100
44 # Peter Corbett <ptc24@cam.ac.uk>
45 # Matthew Vernon <matthew@debian.org>
46 # Stephen Early <steve@greenend.org.uk>
47 +# Richard Kettlewell <rjk@greenend.org.uk
49 # Acrobat configuration file
53 # Everything else in this file is configuration-specific.
57 # Most command implementations are stored in a separate module.
66 + ' (while %s watches)',
67 + "Sorry, but %s stole my pen.",
68 + "Who do you want to slash?",
69 + "I have writer's block!",
73 # Hacky command to output the current fishpond state
74 def fishq(bot, cmd, nick, conn, public,f):
75 from irclib import irc_lower
77 karmadb[thing] += amount
79 karmadb[thing] = amount
82 + tmp = "%s.tmp" % karmafilename
84 - f = open(karmafilename, "w")
86 cPickle.dump(karmadb, f)
89 - sys.stderr.write("Problems dumping karma: probably lost :(")
90 + os.rename(tmp, karmafilename)
92 + sys.stderr.write("error writing karma: %s" % e)
94 -# When the bot exits we should save the karma db
95 def quit(bot,cmd,nick,conn,public):
97 c.quitq(bot,cmd,nick,conn,public)
98 def reload(bot,cmd,nick,conn,public):
100 c.reloadq(bot,cmd,nick,conn,public)
102 # Command processing: whenever something is said that the bot can hear,
104 "karmadel": (c.karmadelq,karmadb),
105 "info": (c.infoq,karmadb),
106 "trout": (c.troutq,troutcfg),
107 + "slash": (c.slashq, slashcfg),
108 "fish": (fishq,fish),
109 "flirt": (c.troutq,flirtcfg),
110 "quiet": (c.nofishq,fish),
111 diff -ruN --exclude {arch} --exclude .arch-ids servus--dev--0--patch-2/commands.py servus--dev--0--patch-4/commands.py
112 --- servus--dev--0--patch-2/commands.py 2005-07-22 23:17:43.000000000 +0100
113 +++ servus--dev--0--patch-4/commands.py 2005-07-22 23:17:45.000000000 +0100
115 conn.action(bot.channel, trout_msg % target)
119 +def slashq(bot, cmd, nick, conn, public, cfg):
127 + fish_quota(fishpond)
129 + conn.notice(nick, quietmsg%fishpond.Boring_Git)
131 + if fishpond.cur_fish<=0:
132 + conn.notice(nick, nofishmsg)
134 + target = string.join(cmd.split()[1:])
135 + who = cmd.split()[1:]
137 + conn.notice(nick, "it takes two to tango!")
140 + conn.notice(nick, "we'll have none of that round here")
142 + me = bot.connection.get_nickname()
143 + slash_msg = random.choice(fishlist)
144 + # The bot won't slash people with themselves
145 + if irc_lower(who[0]) == irc_lower(who[1]):
146 + conn.notice(nick, "oooooh no missus!")
148 + # The bot won't slash with itself, instead slashing the requester
150 + if irc_lower(me) == irc_lower(who[n]):
152 + # Perhaps someone asked to slash themselves with the bot then we get
153 + if irc_lower(who[0]) == irc_lower(who[1]):
154 + conn.notice(nick, "you wish!")
156 + # There's a chance the game may be given away if the request was not
159 + if random.random()<=selfslashchance:
160 + slash_msg=slash_msg+(selfslash%nick)
162 + bot.automsg(public,nick, slash_msg % (who[0], who[1]))
163 + fishpond.cur_fish-=1
165 # Shut up trouting for a minute
166 def nofishq(bot, cmd, nick, conn, public, fish):