chiark / gitweb /
ChatLogTracker._onboard_event takes a vessel argument
[ypp-sc-tools.db-live.git] / yoweb-scrape.txt
1 Ian Jackson writes ("Choice of vessel for pillaging"):
2 > What I really want is something that redacts it into a table (ideally,
3 > by trawling the chat log).  I don't suppose someone fancies writing
4 > the yoweb screenscraper :-) ?
5
6 Here it is.  You run it like this:
7   ./yoweb-scrape ship-aid ~/yohoho/Aristarchus_midnight_chat-log-iwj 
8 It has various other modes - see the usage message.
9
10 Key features:
11
12  * Tracks boarding and departure of pirates and shows a table
13    of currently-aboard pirates with their relevant puzzle standings in
14    a compressed format.
15
16  * Shows time and nature their last interaction with you as XO
17    (abandoning stations, being given orders) and where and when their
18    last to-you-visible chat was.
19
20  * Remembers whether you have ever given the pirate an order to gun
21    since they boarded.
22
23  * Caches and severely rate-limits fetches from yoweb to avoid
24    overloading the Three Rings servers.  In ship-aid mode, will
25    display twirling batons while you wait for data, so that crew
26    on board info remains correct.
27
28 I know of one key defect:
29
30  * If you leave and then reboard a vessel, the list of pirates on
31    board may be wrong.  This is because the chat log doesn't contain
32    the necessary information.  The script assumes that the set of
33    pirates on board doesn't change while you're off the ship (unless
34    you're away for more than an hour, in which case it assumes the
35    ship is empty when you return to it).
36
37    This means that there needs to be a way to manually add and remove
38    pirates.  This is as follows: send or receive a message on the crew
39    officer chat, or send (not receive!) a private message, of the
40    following format:
41          /a <pirate>...                 /d <pirate>...
42          /a <ship>: <pirate>...         /d <ship>: <pirate>...
43    <pirate> and <ship> can be in any case and will be converted to
44    the proper mixed-case form automatically.  <ship>, if it is not
45    provided, will be assumed to be the one you're on (so officers
46    shouldn't send these runes unless only one ship is out).  If <ship>
47    is supplied it may be the full ship name, or only the second word.
48
49    For example:
50          /a haddock: aiah
51          /d aiah
52          /a smart sunfish: copperkatie
53    These are actually sent by typing in the chat box things like:
54          /o /d plonker
55          /off /a hypiscles
56    since other formulations interpret the scraper command as a YPP
57    chat command.  This is deliberate and makes it harder to invoke by
58    mistake.
59
60    These messages can also be sent by some other officer in your crew
61    while you are off the vessel (although currently a bug means that
62    if you board some _other_ vessel then these messages for the vessel
63    you come back to may not be properly recorded).
64
65    The program will notice that a pirate is on board if you give them
66    a stationing order or they abandon a duty station (in circumstances
67    where the game reports this in the log, which doesn't seem to be
68    all the time), and from many of the other messages that occur.
69
70 Other things to mention:
71
72  * There's nothing really resembling a manual.
73
74  * It doesn't notice when you yourself disembark.  That's because
75    that's not recorded in the chat log.
76
77  * Many people may find the output rather basic - it's ASCII art - and
78    it's not very customisable.
79
80  * It spends a while reading the whole of your chat log which can be
81    very long.  Perhaps it should be smarter (eg, bisect the log
82    to find `nearly now').
83
84  * It could have lots more features in general.
85
86  * The `tabulate details of my whole crew' mode takes a long time
87    to run.  This is normal; it's trying to spread the load on yoweb
88    (perhaps excessively so).
89
90  * I have it in git right now but here is just a copy of the single
91    file which is the script.  I'm planning to put my rum calculator
92    and other useful things into the same repo and put it on chiark
93    somewhere.  For my reference, this is from tree revision
94      15799130f8d34856b9cefe3c71103564413fa04a
95
96  * I haven't decided on a final copyright licence.  You may treat this
97    version as GPLv3.
98
99  * The program will become confused when the clocks change,
100    particularly when they go backwards.  This is due to the chat log
101    containing timestamps in local time without a timezone.  If this
102    bothers you, make everything be in UTC.  If it does get confused,
103    you can fix it by logging off and logging on again (perhaps waiting
104    until after the duplicated hour has passed) as that writes a new
105    date record to the log and starts a new series of timestamps.
106
107  * You have to enable the chat log for the ship-aid mode.
108
109 Ian.
110
111
112
113 Ian Jackson writes ("Re: Choice of vessel for pillaging"):
114 > Ian Jackson writes ("Choice of vessel for pillaging"):
115 > > What I really want is something that redacts it into a table (ideally,
116 > > by trawling the chat log).  I don't suppose someone fancies writing
117 > > the yoweb screenscraper :-) ?
118
119 > Here it is.  You run it like this:
120 >   ./yoweb-scrape ship-aid ~/yohoho/Aristarchus_midnight_chat-log-iwj 
121 > It has various other modes - see the usage message.
122
123 A couple more things:
124
125  * Please don't leave it running if you're not in charge.  If
126    everyone runs this it will produce precisely the load on the yoweb
127    servers that we want to avoid.
128  * It's Python so it may eat CPU and memory.
129  * You may need to install some python modules of course.
130  * Here's a version which is an attachment rather than asking you
131    to cut-and-paste.  That will save on you mangling it and getting
132    weird python errors.
133
134 Ian.
135
136 yoweb-scrape as a binary blobule, y [Press RETURN to save to a file]