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.
36 Things you need to know:
38 * Please don't leave it running if you're not in charge. If everyone
39 runs yoweb-scrape all the time it will produce precisely the load
40 on the yoweb servers that we want to avoid.
42 * You must enable the YPP client chat log. It is disabled by
43 default. This can be found in the client in the options panel
44 under `Ye'. Contrary to what the client UI seems to suggest, the
45 filename you specify there is not used directly: information about
46 your pirate name and ocean are added by the client, which is good
47 because yoweb-scrape can dig it out again.
49 * If you leave and then reboard a vessel, the list of pirates on
50 board may be wrong. This is because the chat log doesn't contain
51 information about who's on board the ship when you reboard it.
53 yoweb-scrape assumes that, unless it is told otherwise (or notices
54 for itself), the set of pirates on board doesn't change while
55 you're off the ship (unless you're away for more than an hour, in
56 which case it assumes the ship is empty when you return to it).
58 You can tell it otherwise with specially formatted chat messages.
59 Messages sent or received to officer chat, and messages sent (not
60 received) in private message, are scanned for special `commands' to
61 yoweb-scrape. (So you can have an officer on board the ship keep
62 your yoweb-scrape up to date if you like.)
64 The commands are of the following format:
65 /a <pirate>... /d <pirate>...
66 /a <ship-spec>: <pirate>... /d <ship-spec>: <pirate>...
68 <ship-spec> can be the full name of the ship, or or only the second
69 word (the noun). It can also be a pattern, where `*' matches any
70 (nonempty) series of characters including spaces, and which counts
71 if it matches either the whole ship name or just the noun.
76 /a smart sunfish: copperkatie
77 /a s* sunfish: anaplian
78 These are actually sent by typing in the chat box things like:
81 since other formulations interpret the scraper command as a YPP
82 chat command. This is deliberate and makes it harder to invoke by
85 If you don't specify a ship, it will assume that it's the ship that
86 you (or the officer speaking) are on board. (For full details of
87 the matching algorithm, see below.) If more than one ship is being
88 managed with yoweb-scrape, any user who wishes to issue these
90 /a relevant fish: executiveofficer
91 so that everyone else's yoweb-scrape knows which ship they're on
92 and thus which ship their /a commands refer to.
94 Other things to mention:
96 * There are some things which don't reliably appear in the chat log,
97 for example: when you disembark, and when a pirate leaves a duty
98 station. That can mean that yoweb-scrape isn't always as up to
99 date as you would like. You'll just have to tell it manually.
101 * The `tabulate details of my whole crew' mode takes a long time
102 to run. This is normal; it's trying to spread the load on yoweb
103 (perhaps excessively so).
105 * I haven't decided on a final copyright licence. You may treat this
108 * The program will become confused when the clocks change,
109 particularly when they go backwards. This is due to the chat log
110 containing timestamps in local time without a timezone. If this
111 bothers you, make everything be in UTC. If it does get confused,
112 you can fix it by logging off and logging on again (perhaps waiting
113 until after the duplicated hour has passed) as that writes a new
114 date record to the log and starts a new series of timestamps.
116 * It's Python so it may eat CPU and memory.
118 * You may need to install some python modules. BeautifulSoup (yes,
119 really!) is in the Debian package python-beautifulsoup
122 Some more details about tracking semantics:
124 * The program will notice that a pirate is on board if you give them
125 a stationing order or they abandon a duty station (in circumstances
126 where the game reports this in the log, which doesn't seem to be
127 all the time), and from many of the other messages that occur.
129 * Matching for ship patterns in /a and /d commands picks the first
130 of the following which applies and is not contradicted by any
131 name or partial name specified in the command:
132 - The ship we think the person telling us is on board
133 - The ship we think we are on board
134 - Any other ship we know about, if at least a something was
135 specified, and provided that is not ambiguous
136 - The specific ship name if it is completely specified,
137 possibly recording this as a new ship
138 <pirate> and <ship> can be in any case and will be converted to
139 the proper mixed-case form automatically.