X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fdecode-pctb-marketdata;h=6cdecc658d1e2065237e9f12c6aeea025adcdb12;hb=4c4f06d95a80d3261197222464c05de519928602;hp=d798aad03a1e8de8bc274e5de9837c5635801848;hpb=e888c1dd3476ca49bccf82b93b4a3633587d400d;p=ypp-sc-tools.db-live.git diff --git a/pctb/decode-pctb-marketdata b/pctb/decode-pctb-marketdata index d798aad..6cdecc6 100755 --- a/pctb/decode-pctb-marketdata +++ b/pctb/decode-pctb-marketdata @@ -1,8 +1,11 @@ #!/usr/bin/perl +# This specific file is hereby placed in the public domain, or nearest +# equivalent in law, by me, Ian Jackson. 5th July 2009. + use IO::Handle; -open CM, "#commodmap#.tsv" or die $!; +open CM, "_commodmap.tsv" or die $!; $debug=1 if @ARGV; @@ -95,3 +98,92 @@ $r= read STDIN,$b,1; STDIN->error and die $!; STDIN->eof or die; $b and die; + + + + +# +# +#Version number (3 ascii digits) followed +#by LF (i.e. 0x0A). Current version is\ +# 005 +# +# 0000 30 30 35 0a 005. +# +## of shops/stalls (in ascii) + LF +# 0000 31 0a 1. +# +#list of shop names in ascii (without the +#possessive part and by specifying the \ +#shop type in an abbreviated way which is +#mentioned below). The shop names are +#separated \ by line feeds (0x0A). To +#specify the shop type append the "^" +#character and then \ one of the +#following characters depending upon the +#shop type: +# Apothecary = A +# Distillery = D +# Furnisher = F +# Iron Monger = I +# Shipyard = S +# Tailor = T +# Weavery = W +# +# 0000 4f 6c 64 20 49 72 6f 6e 73 69 Ol d Ironsi +# 0010 64 65 73 0a des. +# +## of buy offers (in binary) +# 0010 05 00 +# +#commodIndex offerCount buy 0/5 +# 0010 0a 00 01 00 Grog x 1 +#[shopIndex val amt] +# 0010 01 00 1d 00 75 00 OI 29 qty 75 +# +#commodIndex offerCount buy 1/5 +# 0020 0b 00 01 00 Fine x 1 +#[shopIndex val amt]... (all in binar\ y) +# 0020 01 00 33 00 e9 03 OI 51 qty 0x3e9 +# +#commodIndex offerCount buy 2/5 +# 0020 0c 00 01 00 Small shot x 1 +#[shopIndex val amt] +# 0020 01 00 OI +# 0030 0f 00 e9 03 15 qty 0x3e9 +# +#commodIndex offerCount buy 3/5 +# 0030 0d 00 01 00 Medium shot x 1 +#[shopIndex val amt] +# 0030 01 00 1c 00 e9 03 OI 28 qty 0x3e9 +# +#commodIndex offerCount buy 4/5 +# 0030 0e 00 Large shot +# 0040 01 00 x 1 +#[shopIndex val amt] +# 0040 01 00 26 00 e9 03 OI 38 0x3e9 +# +# +## of sell offers (in binary) +# 0040 04 00 +# +#commodIndex offerCount sell 0/4 +# 0040 09 00 01 00 Swill x 1 +#[shopIndex val amt] +# 0040 01 00 OI +# 0050 17 00 e8 03 23 0x3e8 +#commodIndex offerCount sell 1/4 +# 0050 0a 00 01 00 Grog x 1 +#[shopIndex val amt] +# 0050 01 00 1e 00 73 03 OI 30 qty 0x373 +#commodIndex offerCount sell 2/4 +# 0050 0c 00 Small shot +# 0060 01 00 x 1 +#[shopIndex val amt] +# 0060 01 00 10 00 07 00 OI 16 qty 7 +#commodIndex offerCount sell 3/4 +# 0060 0d 00 01 00 Medium shot x 1 +#[shopIndex val amt] +# 0060 01 00 1e 00 OI 30 +# 0070 02 00 qty 2 +#