Skip to content

Commit

Permalink
6.14.0 Added outfitting, readme, refuel and repair properties to stat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Oliver Smith committed Mar 13, 2015
1 parent 4abbfc7 commit f94d1f8
Show file tree
Hide file tree
Showing 10 changed files with 13,921 additions and 13,708 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014
==============================================================================

v6.14.0 Mar 13 2015
. (kfsone) Station data:
- Added "outfitting", "rearm", "refuel" and "repair" fields,
- Added options to "local" and "station" commands,
- Added output to "local", "station" and "nav" commands,
- Added support to maddavo import,

v6.13.4 Mar 13 2015
. (WombatFromHell) "run" command:
- Added "--max-gain-per-ton" (--mgpt) option
Expand Down
259 changes: 138 additions & 121 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ IMPORT sub-command:
use2d: Force download of the 2-days .prices file
usefull: Force download of the full .prices file

Options can be comma separated, the following are equivalent:
--option systems --option stations --option shipvendors --option csvonly
--opt=csvs --opt=csvonly
-O csvs,csvonly

--ignore-unknown
-i
Any systems, stations, categories or items that aren't recognized
Expand All @@ -582,92 +587,6 @@ IMPORT sub-command:
you may need to add the "-i" flag to the buildcache command.


RARES sub-command:

This command looks for known rare items within the space around
a specified system.

trade.py rare [-q] <system> [--ly N.NN] [--limit N] [--price-sort] [--reverse]

<system>
System to center search on
e.g.
Lave
@Sol

--ly N.NN
DEFAULT: 42
Maximum distance to search from center system.
e.g.
--ly 0 (unlimited)
--ly 21.2

--limit N
Maximum number of results to show
e.g.
--limit 10

--reverse
-r
Reverse the order, can be used with "--ly" and "--limit" to find
the furthest-away rares

--away N.NN
--from SYSTEM1 --from SYSTEM2 ... --from SYSTEMN
Limits results to systems that are at least a given distance away
from additional systems.
e.g.
trade.py rare --ly 160 sol -r --away 140 --from lave
Shows systems starting at 160ly or less from sol,
but that are also 140ly or more from lave.
trade.py rare --ly 160 sol -r --away 140 --from lave --from xihe
As above but also compares for <= 140ly from xihe

--pad-size SML?
--pad SML?
-p
Limit results to stations that match one of the pad sizes
specified.
--pad ML? (med, lrg or unknown only)
-o ML? "" "" "" ""
--pad ? (unknown only),
--pad L (large only, ignores unknown)

--price-sort
-P
Sort by price rather than proximity

--quiet
-q
Don't include the header lines


Examples:

$ trade.py rare sol --ly 10
Station Rare Cost DistLy Alloc
------------------------------------------------------------------------
ALPHA CENTAURI/Hutton Orbital Centauri Mega Gin 3,319 4.38 7

$ trade.py rare @neto --ly 50 --price --limit 5
Station Rare Cost DistLy Alloc
-----------------------------------------------------------------------------
XIHE/Zhen Dock Xihe Biomorphic Companions 4,482 48.10 7
VEGA/Taylor City Vega Slimweed 2,398 33.44 0
LFT 1421/Ehrlich Orbital Void Extract Coffee 2,357 26.45 0
ALTAIR/Solo Orbiter Altairian Skin 489 39.78 18
V1090 HERCULIS/Kaku Plant Herculis Body Rub 160 37.33 20

Finding where to take a rare from Bast:
$ trade.py rare bast --ly 180 -r --limit 4
Station Rare Cost DistLy Alloc StnLs Pad
------------------------------------------------------------------------------------------
DELTA PHOENICIS/Trading Post Delta Phoenicis Palms 412 179.42 17 3,743 Lrg
DEURINGAS/Shukor Hub Deuringas Truffles 1,892 174.22 0 ? Lrg
HR 7221/Veron City HR 7221 Wheat 415 173.57 0 ? Lrg
ANY NA/Libby Orbital Any Na Coffee 1,790 170.32 11 ? ?


MARKET sub-command:

Lists items bought / sold at a given station; with --detail (-v) also
Expand Down Expand Up @@ -805,6 +724,18 @@ LOCAL sub-command:
--blackmarket
Limit stations to those known to have a black market.

--outfitting
Limit stations to those known to have outfitting.

--rearm
Limit stations to those known to rearm.

--refuel
Limit stations to those known to refuel.

--repair
Limit stations to those known to repair.

-v
Show stations + their distance from star

Expand Down Expand Up @@ -862,6 +793,53 @@ LOCAL sub-command:
> trade.py local SOL --blackmarket --ly 6 -vv


STATION sub-command:

This command can be used to add a new station:

> trade.py station --add "i bootis/nowhere port"
> trade.py station -a "i bootis/nowhere port" --ls 123 --pad m

Or it can be used to delete a station:

> trade.py station --remove "i bootis/nowhere port"
> trade.py station -rm "i bootis/nowhere port"

Or it can be used to update the ls-from-star, pad-size, or blackmarket
flags of an existing station:

> trade.py station --update "i bootis/nowhere port" --pad=L --ls-from-star=123 --black-market=N
> trade.py station -u "i bootis/nowhere port" --pad L --ls 123 --bm=N

If can also be used to show some basic data about a given station:

> trade.py station -v i bootis/chango
Station Data:
System....: I BOOTIS (#10438 @ -22.375,34.84375,4.0)
Station...: Chango Dock (#1288)
Also here.: Maher Stellar Research
Stn/Ls....: 1,095
B/Market..: Yes
Pad Size..: Lrg
Prices....: 33
Price Age.: 6.77 days
Best Buy..: (Buy from this station)
Tea* @ 1,217cr (Avg Sell 1,570cr)
Coffee* @ 1,047cr (Avg Sell 1,369cr)
Fish* @ 296cr (Avg Sell 482cr)
Best Sale.: (Sell to this station)
Marine Equipment* @ 4,543cr (Avg Buy 3,937cr)
Crop Harvesters* @ 2,568cr (Avg Buy 1,997cr)
Domestic Appliances* @ 714cr (Avg Buy 445cr)


This shows that 'Tea' is a star buy at this station: it is being
sold by the station for 1217cr but the average selling price is
1570credits.

A star trade (indicated by '*') is at least 10% better than the
average trading price for that commodity.

BUY sub-command:

Finds stations that are selling / where you can buy, a named list of
Expand Down Expand Up @@ -1016,52 +994,91 @@ EXPORT sub-command:
Export Table 'System' to 'data/System.csv'


STATION sub-command:
RARES sub-command:

This command can be used to add a new station:
This command looks for known rare items within the space around
a specified system.

> trade.py station --add "i bootis/nowhere port"
> trade.py station -a "i bootis/nowhere port" --ls 123 --pad m
trade.py rare [-q] <system> [--ly N.NN] [--limit N] [--price-sort] [--reverse]

Or it can be used to delete a station:
<system>
System to center search on
e.g.
Lave
@Sol

> trade.py station --remove "i bootis/nowhere port"
> trade.py station -rm "i bootis/nowhere port"
--ly N.NN
DEFAULT: 42
Maximum distance to search from center system.
e.g.
--ly 0 (unlimited)
--ly 21.2

Or it can be used to update the ls-from-star, pad-size, or blackmarket
flags of an existing station:
--limit N
Maximum number of results to show
e.g.
--limit 10

> trade.py station --update "i bootis/nowhere port" --pad=L --ls-from-star=123 --black-market=N
> trade.py station -u "i bootis/nowhere port" --pad L --ls 123 --bm=N
--reverse
-r
Reverse the order, can be used with "--ly" and "--limit" to find
the furthest-away rares

If can also be used to show some basic data about a given station:
--away N.NN
--from SYSTEM1 --from SYSTEM2 ... --from SYSTEMN
Limits results to systems that are at least a given distance away
from additional systems.
e.g.
trade.py rare --ly 160 sol -r --away 140 --from lave
Shows systems starting at 160ly or less from sol,
but that are also 140ly or more from lave.
trade.py rare --ly 160 sol -r --away 140 --from lave --from xihe
As above but also compares for <= 140ly from xihe

> trade.py station -v i bootis/chango
Station Data:
System....: I BOOTIS (#10438 @ -22.375,34.84375,4.0)
Station...: Chango Dock (#1288)
In System.: Maher Stellar Research
Stn/Ls....: 1,095
B/Market..: Yes
Pad Size..: Lrg
Prices....: 33
Price Age.: 6.77 days
Best Buy..: (Buy from this station)
Tea* @ 1,217cr (Avg Sell 1,570cr)
Coffee* @ 1,047cr (Avg Sell 1,369cr)
Fish* @ 296cr (Avg Sell 482cr)
Best Sale.: (Sell to this station)
Marine Equipment* @ 4,543cr (Avg Buy 3,937cr)
Crop Harvesters* @ 2,568cr (Avg Buy 1,997cr)
Domestic Appliances* @ 714cr (Avg Buy 445cr)
--pad-size SML?
--pad SML?
-p
Limit results to stations that match one of the pad sizes
specified.
--pad ML? (med, lrg or unknown only)
-o ML? "" "" "" ""
--pad ? (unknown only),
--pad L (large only, ignores unknown)

--price-sort
-P
Sort by price rather than proximity

This shows that 'Tea' is a star buy at this station: it is being
sold by the station for 1217cr but the average selling price is
1570credits.
--quiet
-q
Don't include the header lines


Examples:

$ trade.py rare sol --ly 10
Station Rare Cost DistLy Alloc
------------------------------------------------------------------------
ALPHA CENTAURI/Hutton Orbital Centauri Mega Gin 3,319 4.38 7

$ trade.py rare @neto --ly 50 --price --limit 5
Station Rare Cost DistLy Alloc
-----------------------------------------------------------------------------
XIHE/Zhen Dock Xihe Biomorphic Companions 4,482 48.10 7
VEGA/Taylor City Vega Slimweed 2,398 33.44 0
LFT 1421/Ehrlich Orbital Void Extract Coffee 2,357 26.45 0
ALTAIR/Solo Orbiter Altairian Skin 489 39.78 18
V1090 HERCULIS/Kaku Plant Herculis Body Rub 160 37.33 20

Finding where to take a rare from Bast:
$ trade.py rare bast --ly 180 -r --limit 4
Station Rare Cost DistLy Alloc StnLs Pad
------------------------------------------------------------------------------------------
DELTA PHOENICIS/Trading Post Delta Phoenicis Palms 412 179.42 17 3,743 Lrg
DEURINGAS/Shukor Hub Deuringas Truffles 1,892 174.22 0 ? Lrg
HR 7221/Veron City HR 7221 Wheat 415 173.57 0 ? Lrg
ANY NA/Libby Orbital Any Na Coffee 1,790 170.32 11 ? ?

A star trade (indicated by '*') is at least 10% better than the
average trading price for that commodity.


==============================================================================
Expand Down
48 changes: 46 additions & 2 deletions commands/local_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@
help='Limit stations to those known to have a ship yard.',
action='store_true',
),
ParseArgument('--outfitting',
help='Limit stations to those known to have outfitting.',
action='store_true',
),
ParseArgument('--rearm',
help='Limit stations to those known to have rearming.',
action='store_true',
),
ParseArgument('--refuel',
help='Limit stations to those known to have refueling.',
action='store_true',
),
ParseArgument('--repair',
help='Limit stations to those known to have repairs.',
action='store_true',
),
]

######################################################################
Expand Down Expand Up @@ -97,17 +113,29 @@ def run(results, cmdenv, tdb):
wantTrading = cmdenv.trading
wantShipYard = cmdenv.shipyard
wantBlackMarket = cmdenv.blackmarket
wantOutfitting = cmdenv.outfitting
wantRearm = cmdenv.rearm
wantRefuel = cmdenv.refuel
wantRepair = cmdenv.repair

def station_filter(stations):
for station in stations:
if wantTrading and not station.isTrading:
continue
if station.blackMarket != 'Y' and wantBlackMarket:
if wantBlackMarket and station.blackMarket != 'Y':
continue
if station.shipyard != 'Y' and wantShipYard:
if wantShipYard and station.shipyard != 'Y':
continue
if padSize and not station.checkPadSize(padSize):
continue
if wantOutfitting and station.outfitting != 'Y':
continue
if wantRearm and station.rearm != 'Y':
continue
if wantRefuel and station.refuel != 'Y':
continue
if wantRepair and station.repair != 'Y':
continue
yield station

for (system, dist) in sorted(distances.items(), key=lambda x: x[1]):
Expand Down Expand Up @@ -189,6 +217,22 @@ def render(results, cmdenv, tdb):
ColumnFormat("Shp", '>', '3',
key=lambda row: \
TradeDB.marketStates[row.station.shipyard])
).append(
ColumnFormat("Out", '>', '3',
key=lambda row: \
TradeDB.marketStates[row.station.outfitting])
).append(
ColumnFormat("Arm", '>', '3',
key=lambda row: \
TradeDB.marketStates[row.station.rearm])
).append(
ColumnFormat("Ref", '>', '3',
key=lambda row: \
TradeDB.marketStates[row.station.refuel])
).append(
ColumnFormat("Rep", '>', '3',
key=lambda row: \
TradeDB.marketStates[row.station.repair])
).append(
ColumnFormat("Pad", '>', '3',
key=lambda row: \
Expand Down
Loading

0 comments on commit f94d1f8

Please sign in to comment.