5 * Fetch information for crew and pirates from yoweb
6 * Display tables of puzzle standings
7 * Keep track of who is on board a vessel
9 Putting this all together, it can be used to show a table of who's
10 good at what when you're running a pillage.
12 You run it roughly like this:
13 ./yoweb-scrape ship-aid ~/yohoho/Aristarchus_midnight_chat-log-iwj
14 It has various other modes - see the usage message.
19 * Tracks boarding and departure of pirates and shows a table
20 of currently-aboard pirates with their relevant puzzle standings in
23 * Shows time and nature their last interaction with you as XO
24 (abandoning stations, being given orders) and where and when their
25 last to-you-visible chat was.
27 * Remembers whether you have ever given the pirate an order to gun
30 * Caches and severely rate-limits fetches from yoweb to avoid
31 overloading the Three Rings servers. In ship-aid mode, will
32 display twirling batons while you wait for data, so that crew
33 on board info remains correct.
35 * Can sort pirates by their skills in the key duty puzzles. Press
36 a single keystroke to sort by:
38 c: carpentry g: gunning
39 n: navigation (duty nav) t: treasure haul
40 d: driving (battle nav) a: sort by pirate name
41 It will prefer to list near the top pirates whose other skills
42 are weaker. This functionality is disabled if stdin is not a tty.
44 Things you need to know:
46 * Please don't leave it running if you're not in charge. If everyone
47 runs yoweb-scrape all the time it will produce precisely the load
48 on the yoweb servers that we want to avoid.
50 * You must enable the YPP client chat log. It is disabled by
51 default. This can be found in the client in the options panel
52 under `Ye'. Contrary to what the client UI seems to suggest, the
53 filename you specify there is not used directly: information about
54 your pirate name and ocean are added by the client, which is good
55 because yoweb-scrape can dig it out again.
57 * If you leave and then reboard a vessel, the list of pirates on
58 board may be wrong. This is because the chat log doesn't contain
59 information about who's on board the ship when you reboard it.
61 yoweb-scrape assumes that, unless it is told otherwise (or notices
62 for itself), the set of pirates on board doesn't change while
63 you're off the ship (unless you're away for more than an hour, in
64 which case it assumes the ship is empty when you return to it).
66 You can tell it otherwise with specially formatted chat messages.
67 Messages sent or received to officer chat, and messages sent (not
68 received) in private message, are scanned for special `commands' to
69 yoweb-scrape. (So you can have an officer on board the ship keep
70 your yoweb-scrape up to date if you like.)
72 The commands are of the following format:
73 /a <pirate>... /d <pirate>...
74 /a <ship-spec>: <pirate>... /d <ship-spec>: <pirate>...
76 <ship-spec> can be the full name of the ship, or or only the second
77 word (the noun). It can also be a pattern, where `*' matches any
78 (nonempty) series of characters including spaces, and which counts
79 if it matches either the whole ship name or just the noun.
84 /a smart sunfish: copperkatie
85 /a s* sunfish: anaplian
86 These are actually sent by typing in the chat box things like:
89 since other formulations interpret the scraper command as a YPP
90 chat command. This is deliberate and makes it harder to invoke by
93 If you don't specify a ship, it will assume that it's the ship that
94 you (or the officer speaking) are on board. (For full details of
95 the matching algorithm, see below.) If more than one ship is being
96 managed with yoweb-scrape, any user who wishes to issue these
98 /a relevant fish: executiveofficer
99 so that everyone else's yoweb-scrape knows which ship they're on
100 and thus which ship their /a commands refer to.
102 * For the ship duty puzzle display, and for sorting pirates by
103 skill, we take the best of Sailing and Rigging.
105 Other things to mention:
107 * There are some things which don't reliably appear in the chat log,
108 for example: when you disembark, and when a pirate leaves a duty
109 station. That can mean that yoweb-scrape isn't always as up to
110 date as you would like. You'll just have to tell it manually.
112 * The `tabulate details of my whole crew' mode takes a long time
113 to run. This is normal; it's trying to spread the load on yoweb
114 (perhaps excessively so).
116 * I haven't decided on a final copyright licence. You may treat this
119 * The program will become confused when the clocks change,
120 particularly when they go backwards. This is due to the chat log
121 containing timestamps in local time without a timezone. If this
122 bothers you, make everything be in UTC. If it does get confused,
123 you can fix it by logging off and logging on again (perhaps waiting
124 until after the duplicated hour has passed) as that writes a new
125 date record to the log and starts a new series of timestamps.
127 * It's Python so it may eat CPU and memory.
129 * You may need to install some python modules. BeautifulSoup (yes,
130 really!) is in the Debian package python-beautifulsoup
133 Some more details about tracking semantics:
135 * The program will notice that a pirate is on board if you give them
136 a stationing order or they abandon a duty station (in circumstances
137 where the game reports this in the log, which doesn't seem to be
138 all the time), and from many of the other messages that occur.
140 * Matching for ship patterns in /a and /d commands picks the first
141 of the following which applies and is not contradicted by any
142 name or partial name specified in the command:
143 - The ship we think the person telling us is on board
144 - The ship we think we are on board
145 - Any other ship we know about, if at least a something was
146 specified, and provided that is not ambiguous
147 - The specific ship name if it is completely specified,
148 possibly recording this as a new ship
149 <pirate> and <ship> can be in any case and will be converted to
150 the proper mixed-case form automatically.