From: Ian Jackson Date: Sun, 17 May 2009 12:45:33 +0000 (+0100) Subject: Match a few more messages X-Git-Tag: 1.0~28 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=df5a08b4a0046990ff235a9fdc17262ac071deaa;ds=sidebyside Match a few more messages --- diff --git a/TODO b/TODO index d3c8a48..ffe6b98 100644 --- 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 diff --git a/yoweb-scrape b/yoweb-scrape index 947e5e4..b12b503 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -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)