chiark / gitweb /
WIP commod ordering improvements
[ypp-sc-tools.db-test.git] / yarrg / README
1 YARRG - Yet Another Revenue Research Gatherer
2 =============================================
3
4 Overview
5 --------
6
7 This tool will:
8   - screenscrape the commodities trading screen
9   - produce the results as a tab separated values file
10   - upload the results to the YARRG and PCTB servers
11
12 To build, install the dependencies, cd to this directory and type `make'.
13
14 To screenscrape and upload to both servers, select `trade
15 commodities' from the hold of a vessel or building, and run:
16    ./yarrg
17 We upload to the dedicated yarrg server http://yarrg.chiark.net/,
18 and also to the PCTB server http://pctb.crabdance.com/.
19
20 Or, for example, for a tab-separated values dump:
21    ./yarrg --tsv >commods.tsv
22
23 While it is capturing the screenshots, do not move the mouse or use
24 the keyboard.  Keyboard focus must stay in the YPP client window.  If
25 you use Gnome or KDE you must raise the YPP client window so that it
26 is completely unobscured - the yarrg program tries to do this but
27 metacity and kwin do not honour the request.
28
29
30 Command-line options
31 --------------------
32
33 Setting the operation mode:
34   --find-window-only       Just check that we can find the YPP client window.
35   --screenshot-only        Page through and take screenshots, do not OCR
36   --analyse-only | --same  Process previously taken screenshots
37   --everything (default)   Take screenshots and process them
38
39 Options to vary the processing:
40   --single-page         One screenful, no paging - results will be incomplete
41   --quiet               Suppress progress messages
42   --screenshot-file F   Store or read screenshots in F rather than _pages.ppm
43   --window-id ID        Specified X window is the YPP client - do not search
44   --edit-charset        Enable character set editing.  See README.dictionary.
45   --no-edit-charset     Do not edit charset even if _local-char*.txt exists.
46   --find-island         Find and print the ocean and island.  Suppresses OCR
47                          and output unless used with result processing option.
48   --test-servers        Set default servers to be the test servers, not
49                          the real live ones (doesn't affect explicit settings).
50
51 Controlling what happens to the results - one or more:
52   --upload (default)    Upload to both the YARRG and PCTB servers
53   --upload-pctb         Upload to the PCTB servers
54   --upload-yarrg        Upload to the YARRG servers
55   --tsv                 Print data as clean tab-separated-values file
56   --raw-tsv             Dump the raw (not deduped, unsorted) OCR'd data
57   --best-prices         Print best buy and sell price for each commodity
58   --arbitrage           Print arbitrage opportunities
59
60 Privacy options, which control conversations with the dictionary server:
61   --dict-local-only  *  Do not talk to the server even to fetch new dictionary.
62   --dict-read-only   *  Only fetch new dictionary, do not submit new entries.
63   --dict-anon           Don't quote pirate name if submitting entries.
64   --dict-submit         Submit entries quoting my pirate name.  (default)
65 Please do not use options marked * with --upload.  See README.privacy.
66
67 Options to override which servers we talk to:
68   --yarrg-server HOST|URL When uploading to YARRG, use HOST or URL.
69   --pctb-server HOST|URL  When talking to PCTB, use HOST or URL.
70   --dict-submit-url URL   Submit dictionary updates here (default: use yarrg).
71   --dict-update-from SRC  Fetch updated master dictionary with rsync from SRC.
72 Or set the environment variables
73   YPPSC_YARRG{_YARRG, _PCTB, _DICT_UPDATE, _DICT_SUBMIT}
74
75
76 Installation requirements
77 -------------------------
78
79 Your X server must be 24bpp (or better).
80
81 This program has quite a few dependencies:
82                                                         Package (Debian etch)
83
84  - For building, C compiler and build environment       build-essential
85  - pnm library, including dev files for building        libnetpbm10-dev
86  - pnm command line utilities for image manipulation    netpbm
87  - X11 libraries, including dev files for building      libx11-dev
88  - XTEST library, including dev files for building      libxtst-dev
89  - Perl-compatible regexp library, including dev files  libpcre3-dev
90  - Tk interpreter /usr/bin/wish                         tk8.4
91  - Perl module XML::Parser                              libxml-parser-perl
92  - Perl module JSON::Parser                             libjson-perl
93  - XTEST extension in the X server                      (part of X package)
94  - Perl interpreter and basic modules                   perl (usu.installed)
95
96 On other Linux distros the packages may have different names, but
97 these should be roughly right for Debian and its derivatives.  You can
98 install them with this rune:
99   sudo apt-get install git-core build-essential libnetpbm10-dev netpbm libx11-dev libxtst-dev libpcre3-dev tk8.4 libxml-parser-perl libjson-perl
100
101
102 The supplied helper programs
103   dictionary-manager
104   commod-results-processor
105   database-info-fetch
106 must (currently) also be in the current working directory when you run
107 the main yarrg program.
108
109 The data files (see README.files) are also left in the current working
110 directory.  There is not yet any feature to have the data files and
111 helpers be somewhere else.
112
113
114 Reporting problems
115 ------------------
116
117 If you need to report a bug, for example an inability to recognise,
118 please be sure to remember the exact error message and circumstances.
119 Also, for recognition problems there will probably be a very useful
120 screenshot file called `_pages.ppm'.  This is likely to be very large
121 so don't just email it to me, but if you can put it up on a webpage
122 for me to download that will help.  At least keep a copy of it.
123
124 If the problem is a failure to cope with some particular YPP client
125 display and is reproducible, try running:
126    ./yarrg --raw-tsv --single-page
127 If this reproduces the problem, please email me the screenshot file
128 _pages.ppm, which will consist only of the single screen, plus the
129 error messasge.  I'll then be able to understand what's wrong,
130 hopefully.
131
132
133 Privacy
134 -------
135
136 The main purpose of this program is to connect to the YARRG and PCTB
137 servers and upload data.  It will do that if you run it with --upload.
138
139 This program will also, by default, talk to the dictionary server I
140 have set up: to download updated image dictionaries, and to upload new
141 dictionary entries which you create with the yarrg client dictionary
142 GUI.  This feature is mentioned in and controllable in the GUI itself,
143 so it won't happen without you knowing about it.
144
145 The uploads will by default mention your ocean and pirate name; if you
146 don't want that, pass the --dict-anon option, or untick the box in the
147 GUI.
148
149 See README.privacy for full details.
150
151
152 Disclaimers, authorship and copyright
153 -------------------------------------
154
155 The PCTB server is a project of Joel Lord and various others.
156
157 The YARRG server was inspired by PCTB and is a project of the crew
158 Special Circumstances (on the Midnight Ocean) and of the Sinister
159 Greenend Organisation.
160
161 PCTB and YARRG are both completely unofficial and Three Rings, the
162 operators of Yohoho Puzzle Pirates, have nothing to do with either of
163 them.  Please refer queries to us, not to Three Rings.  If you want to
164 reuse the code here to do substantially novel things, you should ask
165 Three Rings for permission (for example, by petitioning an Ocean
166 Master).
167
168
169 This yarrg screenscraper and upload client was written entirely from
170 scratch by me, Ian Jackson, with assistance from Stephen Early and
171 Clare Boothby.  It is part of ypp-sc-tools, a set of third-party tools
172 for assisting players of Yohoho Puzzle Pirates.
173
174 ypp-sc-tools and YARRG are
175 Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
176 Copyright (C) 2009 Clare Boothby
177 Copyright (C) 2009 Steve Early
178
179 This program is free software: you can redistribute it and/or modify
180 it under the terms of
181  (a) for the website code including the route searcher,
182       the GNU Affero General Public License and
183  (b) for the rest of the code, GNU General Public License
184 as published by the Free Software Foundation, either version 3 of
185 each applicable the License, or (at your option) any later version.
186
187 This program is distributed in the hope that it will be useful,
188 but WITHOUT ANY WARRANTY; without even the implied warranty of
189 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
190 GNU General Public License for more details.
191
192 You should have received a copy of the GNU General Public License and
193 GNU Affero General Public License along with this program.  If not,
194 see <http://www.gnu.org/licenses/>.
195
196 Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
197 are used without permission.  Once again, this program is not endorsed
198 or sponsored by Three Rings.
199
200
201 The character and UI images copied from the YPP client, and submitted
202 to stored and shared by the YPP SC YARRG dictionary server, are those
203 provided by Three Rings as part of the YPP client and by your Java
204 installation.  I regard the current use of these images in this way as
205 Fair Dealing (in the UK) or Fair Use (in the USA).
206
207 These images do not form part of the ypp-sc-tools distribution,
208 although the ypp-sc-tools yarrg client does download them automatically
209 from my dictionary server when run in the most ordinary way.
210
211
212  - Ian Jackson
213    ijackson@chiark.greenend.org.uk
214    Aristarchus on the Midnight ocean