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