chiark / gitweb /
Match a few more messages
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 12:45:33 +0000 (13:45 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 12:45:33 +0000 (13:45 +0100)
TODO
yoweb-scrape

diff --git a/TODO b/TODO
index d3c8a48ae7a0c535096413a5a9d4b963b31c6b8f..ffe6b982941546eff0c5763b16ca361aa933d161 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,8 +1,3 @@
 yoweb-scrape
        improve the docs
-       match these msgs
-               Ladyhratt has driven Kybernete from the ship!
-               Kybernete has bested Ryston, and turns to the rest of the ship.
-               Ye hop on the ferry and are whisked away to Cnossos Island...
-               Whisking away to yer home on the magical winds.
        ship-aid should show last vessel if we're not on a vessel
index 947e5e4c05d3089ee441a1cbf694c5c5e69d15f3..b12b5032fcb9eb7c09cfdfa867dbd34f57eb8e65 100755 (executable)
@@ -610,6 +610,10 @@ class ChatLogTracker:
                        del v[pirate]
                        del self._pl[pirate]
 
+               def disembark_me(why):
+                       self._disembark_myself()
+                       return d('disembark-me '+why)
+
                m = rm('Going aboard the (\\S.*\\S)\\.\\.\\.$')
                if m:
                        dm = ['boarding']
@@ -707,23 +711,34 @@ class ChatLogTracker:
                if m: return chat_metacmd('officer')
 
                m = rm('Ye accepted the offer to job with ')
-               if m:
-                       self._disembark_myself()
-                       return d('taking-job')
+               if m: return disembark_me('jobbing')
+
+               m = rm('Ye hop on the ferry and are whisked away ')
+               if m: return disembark_me('ferry')
+
+               m = rm('Whisking away to yer home on the magical winds')
+               if m: return disembark_me('home')
 
                m = rm('Game over\\.  Winners: ([A-Za-z, ]+)\\.$')
                if m:
                        pl = m.group(1).split(', ')
                        if not self._myself.name in pl:
-                               return d('lost boarding battle')
+                               return d('lost melee')
                        for pn in pl:
                                if ' ' in pn: continue
-                               ob_x(pn,'won boarding battle')
-                       return d('won boarding battle')
+                               ob_x(pn,'won melee')
+                       return d('won melee')
 
                m = rm('(\\w+) is eliminated\\!')
                if m: return ob1('eliminated in fray');
 
+               m = rm('(\\w+) has driven \w+ from the ship\\!')
+               if m: return ob1('boarder repelled');
+
+               m = rm('\w+ has bested (\\w+), and turns'+
+                       ' to the rest of the ship\\.')
+               if m: return ob1('boarder unrepelled');
+
                m = rm('(\\w+) has left the vessel\.')
                if m:
                        pirate = m.group(1)