5 - screenscrape the commodities trading screen
6 - produce the results as a tab separated values file
7 - upload the results to PCTB
9 To run it, change to this directory, type `make', and then:
11 to upload to the PCTB server. Currently we use pctb.ilk.org,
12 the testing instance of the PCTB database, pending approval from the
13 operators of the main server.
15 Or, for example, for a tab-separated values dump:
16 ./ypp-commodities --tsv >commods.tsv
18 While it is capturing the screenshots, do not move the mouse or use
19 the keyboard. Keyboard focus must stay in the YPP client window.
25 Setting the operation mode:
26 --find-window-only Just check that we can find the YPP client window.
27 --screenshot-only Page through and take screenshots, do not OCR
28 --analyse-only | --same Process previously taken screenshots
29 --everything (default) Take screenshots and process them
31 Options to vary the processing:
32 --single-page One screenful, no paging - results will be incomplete
33 --quiet Suppress progress messages
34 --screenshot-file F Store or read screenshots in F rather than _pages.ppm
35 --window-id ID Specified X window is the YPP client - do not search
36 --edit-charset Enable character set editing. See README.dictionary.
37 --no-edit-charset Do not edit charset even if _local-char*.txt exists.
38 --find-island Find and print the ocean and island. Suppresses OCR
39 and output unless used with result processing option.
40 --test-servers Set default servers to be the test servers, not
41 the real live ones (doesn't affect explicit settings).
43 Controlling what happens to the results - only one at a time:
44 --upload (default) Upload to the PCTB server
45 --tsv Print data as clean tab-separated-values file
46 --raw-tsv Dump the raw (not deduped, unsorted) OCR'd data
47 --best-prices Print best buy and sell price for each commodity
48 --arbitrage Print arbitrage opportunities
50 Privacy options, which control conversations with the dictionary server:
51 --dict-local-only * Do not talk to the server even to fetch new dictionary.
52 --dict-read-only * Only fetch new dictionary, do not submit new entries.
53 --dict-anon Don't quote pirate name if submitting entries.
54 --dict-submit Submit entries quoting my pirate name. (default)
55 Please do not use options marked * with --upload. See README.privacy.
57 Options to override which servers we talk to:
58 --pctb-server HOST|URL Talk to the PCTB server at HOST or URL.
59 --dict-submit-url URL Submit dictionary entries with HTTP POST under URL.
60 --dict-update-from SRC Fetch updated master dictionary with rsync from SRC.
61 Or set the environment variables YPPSC_PCTB{_PCTB, _DICT_UPDATE, _DICT_SUBMIT}
64 Installation requirements
65 -------------------------
67 Your X server must be 24bpp (or better).
69 This program has quite a few dependencies:
72 - For building, C compiler and build environment build-essential
73 - pnm library, including dev files for building libnetpbm10-dev
74 - pnm command line utilities for image manipulation netpbm
75 - X11 libraries, including dev files for building libx11-dev
76 - XTEST library, including dev files for building libxtst-dev
77 - Perl-compatible regexp library, including dev files libpcre3-dev
78 - Tk interpreter /usr/bin/wish tk8.4
79 - Perl module XML::Parser libxml-parser-perl
80 - Perl module JSON::Parser libjson-perl
81 - XTEST extension in the X server (part of X package)
82 - Perl interpreter and basic modules perl (usu.installed)
84 On other Linux distros the packages may have different names, but
85 these should be roughly right for Debian and its derivatives. You can
86 install them with this rune:
87 sudo apt-get install build-essential libnetpbm10-dev netpbm libx11-dev libxtst-dev libpcre3-dev tk8.4 libxml-parser-perl libjson-perl
90 The supplied helper programs
92 commod-results-processor
94 must (currently) also be in the current working directory when you run
95 the main ypp-commodities program.
97 The data files (see README.files) are also left in the current working
98 directory. There is notyet any feature to have the data files and
99 helpers be somewhere else.
105 If you need to report a bug, for example an inability to recognise,
106 please be sure to remember the exact error message and circumstances.
107 Also, for recognition problems there will probably be a very useful
108 screenshot file called `_pages.ppm'. This is likely to be very large
109 so don't just email it to me, but if you can put it up on a webpage
110 for me to download that will help. At least keep a copy of it.
112 If the problem is a failure to cope with some particular YPP client
113 display and is reproducible, try running:
114 ./ypp-commodities --raw-tsv --single-page
115 If this reproduces the problem, please email me the screenshot file
116 _pages.ppm, which will consist only of the single screen, plus the
117 error messasge. I'll then be able to understand what's wrong,
124 The main purpose of this program is to connect to the PCTB server and
125 upload data. It will do that if you run it with --upload.
127 This program will also, by default, talk to the dictionary server I
128 have set up: to download updated image dictionaries, and to upload new
129 dictionary entries which you create with the PCTB client dictionary
130 GUI. This feature is mentioned in and controllable in the GUI itself,
131 so it won't happen without you knowing about it.
133 The uploads will by default mention your ocean and pirate name; if you
134 don't want that, pass the --dict-anon option, or untick the box in the
137 See README.privacy for full details.
140 Authorship and copyright
141 ------------------------
143 The PCTB server itself is a project of Joel Lord and various others.
146 However, this screenscraper and upload client was written entirely
147 from scratch by me, Ian Jackson. It is part of ypp-sc-tools, a set of
148 third-party tools for assisting players of Yohoho Puzzle Pirates.
151 Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
153 This program is free software: you can redistribute it and/or modify
154 it under the terms of the GNU General Public License as published by
155 the Free Software Foundation, either version 3 of the License, or
156 (at your option) any later version.
158 This program is distributed in the hope that it will be useful,
159 but WITHOUT ANY WARRANTY; without even the implied warranty of
160 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
161 GNU General Public License for more details.
163 You should have received a copy of the GNU General Public License
164 along with this program. If not, see <http://www.gnu.org/licenses/>.
166 Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
167 are used without permission. This program is not endorsed or
168 sponsored by Three Rings.
171 The character and UI images copied from the YPP client, and submitted
172 to stored and shared by the YPP SC PCTB dictionary server, are those
173 provided by Three Rings as part of the YPP client and by your Java
174 installation. I regard the current use of these images in this way as
175 Fair Dealing (in the UK) or Fair Use (in the USA).
177 These images do not form part of the ypp-sc-tools distribution,
178 although the ypp-sc-tools pctb client does download them automatically
179 from my dictionary server when run in the most ordinary way.
183 ijackson@chiark.greenend.org.uk
184 Aristarchus on the Midnight ocean