chiark
/
gitweb
/
~matthewv
/
irc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Spell annihilates properly
[irc.git]
/
acrobat-chiark-0.2.py
diff --git
a/acrobat-chiark-0.2.py
b/acrobat-chiark-0.2.py
index 2c6b85c3cde505ecef0f9fa7b4ca2742c27e9c2b..63f52e3b38cf7cd7fc5f4450878cd4a4542f6a76 100755
(executable)
--- a/
acrobat-chiark-0.2.py
+++ b/
acrobat-chiark-0.2.py
@@
-50,6
+50,8
@@
class Acrobat(SingleServerIRCBot):
self.channel = channel
self.owner = owner
self.quotatime = time.time()
self.channel = channel
self.owner = owner
self.quotatime = time.time()
+ #List of known !commands we respond to
+ self.known =['karma','trout','info','die','quiet','list','google','say','do','reload']
#Configurable stuff - how often do we add how many fish?
self.cur_fish=5
self.max_fish=5 #Maximum of 5 fish
#Configurable stuff - how often do we add how many fish?
self.cur_fish=5
self.max_fish=5 #Maximum of 5 fish
@@
-159,6
+161,10
@@
class Acrobat(SingleServerIRCBot):
conn.notice(nick, "My owner is %s; I have karma on %s items." %
(self.owner, len(self.karma.dict.keys())))
conn.notice(nick, "My owner is %s; I have karma on %s items." %
(self.owner, len(self.karma.dict.keys())))
+ # list know commands
+ def listq(self, cmd, nick, conn, public):
+ conn.notice(nick, "%s" % string.join(self.known))
+
# trout someone
def troutq(self, cmd, nick, conn, public):
self.fish_quota()
# trout someone
def troutq(self, cmd, nick, conn, public):
self.fish_quota()
@@
-181,7
+187,7
@@
class Acrobat(SingleServerIRCBot):
if me.lower() == target.lower():
target = nick
if public == 0:
if me.lower() == target.lower():
target = nick
if public == 0:
- if random.random() <= 0.
25
:
+ if random.random() <= 0.
1
:
trout_msg+= ' (at the instigation of %s)' % nick
conn.action(self.channel, trout_msg % target)
except IndexError:
trout_msg+= ' (at the instigation of %s)' % nick
conn.action(self.channel, trout_msg % target)
except IndexError:
@@
-222,8
+228,6
@@
class Acrobat(SingleServerIRCBot):
if self.cur_fish>self.max_fish:
self.cur_fish=self.max_fish
self.quotatime=time.time()
if self.cur_fish>self.max_fish:
self.cur_fish=self.max_fish
self.quotatime=time.time()
- print self.cur_fish
- print self.quotatime
# quit irc
def quit(self, cmd, nick, conn, public):
# quit irc
def quit(self, cmd, nick, conn, public):
@@
-281,6
+285,9
@@
class Acrobat(SingleServerIRCBot):
if cmd == "info":
self.infoq(cmd, nick, conn, public)
if cmd == "info":
self.infoq(cmd, nick, conn, public)
+ # Known commands
+ if cmd == "list":
+ self.listq(cmd, nick, conn, public)
# weaponry
if cmd.split()[0] == "trout":
self.troutq(cmd, nick, conn, public)
# weaponry
if cmd.split()[0] == "trout":
self.troutq(cmd, nick, conn, public)