In-Development TradeDangerous: power-user trade optimizer

Ok thanks for this, I read bdragon's posts on manually editing the Systems.csv file and that seems to have worked with a few more edits of Stations.csv and tradedangerous.prices to get buildcache to go without errors (Mainly derp/missing system/station names) but it has worked.

I read about submit-distances.py but didn't try it because I feel more confident with EDSC's web interface so I'll continue to use that for system co-ords.

I also tried out edscupdate.py and confirmed a few (10) systems (only 434 to go, I think I'll try to do 10+ each time before I start playing, seems simple enough and only takes a few moments).

So, from what posts I read (I'm not sure I understood much of it. I'm not very bright, but I can lift heavy things...) I should/could do the following procedure:

1. Register new system with EDSC (Web interface)
2. Manually modify TD's System.csv (Found Sublime Text thanks to previous poster about using alternatives..thanks)
3. buildcache
4. Routinely use edscupdate.py to confirm edsc data and hope that one day my entered system will be incorporated in to TD's shared System.csv

Is this about right? or have I missed something bleeding obvious?
 
If i remember correctly, the submit_distances has been updated, so it automatically adds systems that were able to be calculated. The same goes with edscupdate. At edscupdate use the --random option to just get 10 systems to check.
For me it's quicker in submit_distances to just enter the 5 minimum entries and afterwards just skip the rest with q.
 
Hi guys, signed up to the forums just to get a little help with TD. >.<

When I try to run trade.py update -G xihe/zhen I get an error back which reads as follows:

Code:
Can't find a usable init.tcl in the following directories: ... This probably means that Tcl wasn't  installed properly.

I can't cut and paste from the cmd window so you'll have to imagine the directories listings. They all point to various folders in my TD repo folder.

I didn't find a requirements.txt file so if there's something I'm missing, please let me know! I'm excited to start using the tool.

Thanks in advance!
 
Maddavo Market Share now updated to track prices for new item Painite/Minerals. If you haven't already updated your Item.csv there is an updated one available for download on the front page.
 
I can't cut and paste from the cmd window so you'll have to imagine the directories listings.

To copy from the cmd window, right-click to get the popup menu and select 'Mark' then drag to highlight the desired area, then right-click anywhere in the cmd window and this will copy the selection into the clipboard.
 
How exciting! Thanks for the tip!

Code:
(env) D:\Dropbox\repos\tradedangerous>python trade.py update -G xihe/zhen
NOTE:
. Press CTRL-C here to abort edit, otherwise just close the update window to sav
e.
. '-F' makes the window show in-front of the E:D Window.
. '-A' forces all items to be listed.


NOTE: Current data 2.08-2.08 days old.
ERROR: Can't find a usable init.tcl in the following directories:
    C:/Python34/lib/tcl8.6 D:/Dropbox/repos/tradedangerous/env/lib/tcl8.6 D:/Dro
pbox/repos/tradedangerous/lib/tcl8.6 D:/Dropbox/repos/tradedangerous/env/library
 D:/Dropbox/repos/tradedangerous/library D:/Dropbox/repos/tradedangerous/tcl8.6.
1/library D:/Dropbox/repos/tcl8.6.1/library






This probably means that Tcl wasn't installed properly.
 
If i remember correctly, the submit_distances has been updated, so it automatically adds systems that were able to be calculated. The same goes with edscupdate. At edscupdate use the --random option to just get 10 systems to check.
For me it's quicker in submit_distances to just enter the 5 minimum entries and afterwards just skip the rest with q.

Ok thanks for that I'll give submit_distances a go...just need to find another NEW system... Thanks


Maddavo Market Share now updated to track prices for new item Painite/Minerals. If you haven't already updated your Item.csv there is an updated one available for download on the front page.

maddavo,

Just wanted to say thanks for all your efforts with Maddavo's Market Data website (leave it to an Aussie to get it done, right?) but, I'm a little confused as to how the Corrections.csv is supposed to be used? I can't find any instructions/information on how its supposed to work. Do you just read it and manually make the corrections?
 
Last edited:
maddavo,

Just wanted to say thanks for all your efforts with Maddavo's Market Data website (leave it to an Aussie to get it done, right?) but, I'm a little confused as to how the Corrections.csv is supposed to be used? I can't find any instructions/information on how its supposed to work. Do you just read it and manually make the corrections?

Thanks!

The Corrections.csv is for future support for TD. At the moment all the corrections are in the TD code in corrections.py. If you go to the "View Station Corrections" page (direct link here: http://www.davek.com.au/td/corrections.asp ) this will give all the station corrections that can be copy/pasted into the local corrections.py . But just be aware that when you get a new version of TD then you may need to update/re-edit the corrections again.

Cheers,
Maddavo
 
I really wish I could help kirstjin, but I don't know much about python on Windows. For me I just followed these instructions blindly and the magic worked (https://bitbucket.org/kfsone/tradedangerous/wiki/Setup_Guide/).

I might suggest removing and re-installing Python and/or placing your repo somewhere other than your dropbox folder. I know dropbox does some funky things to the Windows file system to monitor for updates and do version control.

Wish I could help more...
 
How exciting! Thanks for the tip!

Code:
(env) D:\Dropbox\repos\tradedangerous>python trade.py update -G xihe/zhen
NOTE:
. Press CTRL-C here to abort edit, otherwise just close the update window to sav
e.
. '-F' makes the window show in-front of the E:D Window.
. '-A' forces all items to be listed.


NOTE: Current data 2.08-2.08 days old.
ERROR: Can't find a usable init.tcl in the following directories:
    C:/Python34/lib/tcl8.6 D:/Dropbox/repos/tradedangerous/env/lib/tcl8.6 D:/Dro
pbox/repos/tradedangerous/lib/tcl8.6 D:/Dropbox/repos/tradedangerous/env/library
 D:/Dropbox/repos/tradedangerous/library D:/Dropbox/repos/tradedangerous/tcl8.6.
1/library D:/Dropbox/repos/tcl8.6.1/library






This probably means that Tcl wasn't installed properly.

In my C:\Python34 the tcl8.6 folder is under the C:\Python34\tcl folder not under C:\Python34\lib. Did you do a default Python install?
 
Last edited:
I have written a small shell-like interface for TradeDangerous called "itrade".
You can directly run the TradeDangerous commands from it, but it also provides some nice features like variables and aliases with optional place holders and some other helpful functions.
It's written in just a few hours in Python like TradeDangerous itself, so don't expect a GUI or anything too fancy. If you don't want to work on the command line at all it's not for you, but for me it makes things much easier than working directly with trade.py.

You can download it here:
View attachment 19471

Please read the itrade.txt for instructions:
Code:
itrade

itrade presents the user with a shell-like interface to directly call trade.py.
It also provides several helpful functions to simplify the calls.


- Setup -
In the directory where "itrade.py" is located there has to be a "itrade.ini" (if not, create one).
This file must contain the following section:
[MAIN]
tradepath = C:\path\to\trade dangerous
logpath = c:\path\to\Elite Dangerous\Logs

tradepath is the path to the directory where trade.py is located.
logpath is optional, but needed for certain features to get the current system name.

- Basic function -
Commands
:q

Running itrade.py presents a shell-like user interface to directly call trade.py.
Whatever you type will be used as command line parameters for trade.py:
>>: run --cap 4 --credits 20000 --ly 7
	-> trady.py run --cap 4 --credits 20000 --ly 7
>>: --help
	-> trade.py --help

You can use
>>: :q
to quit itrade.
Notice the ':' before the 'q'. This prefix is always used for the special functions provided by itrade.


- Variables -
Variables are used for storing simple values you need regularly.

-- Defining variables --
Commands
:var
:delvar

You can create variables that are persisted and can be used in your calls.
For example when you always fly with a capacity of 4, you might want to declare a variable for that:
>>: :var cap 4

Usage ":var [NAME] [VALUE]"
Everything after the NAME will be used as value (including spaces!).
Omitting the VALUE prints the current value, omitting the NAME prints a list of all defined variables.

Variables are delete with the command :delvar
Usage ":delvar [NAME]"

-- Using variables --
To use variable you have to put them in semicolons:
:var cap 4
>>: run --cap ;cap; --credits 20000 --ly 7
This is the same as
>>: run --cap 4 --credits 20000 --ly 7

-- Predefined variables --
There are predefined variables (well, one at the moment) that cannot be assigned manually.
sys : Holds the current system name from the log file (verbose logging must be enabled).
If using 'sys', you will be asked to confirm the system name from the logs by simply pressing enter,
or you can enter a different name, when it could not be retrieved correctly from the logs.

Usage is the same as for normal variables:
>>: run --from ;sys; --cap 4 --credits 20000 --ly 7

-- Important rules for variables --
You should never use variables in varaibles (e.g. ":var a ;b;").
This is not supported and depending on parameter and order ";b;" might or might not be replaced with the value of a variable "b".

Even if the value of a variable contains quotes, it is always bound to one parameter.
>>: :var station Burnell Station
>>: run --from Sol/;station;
This would result in the following trade.py call:
trade.py --from "Sol/Burnell Station"
That is working fine.
However
>>: :var ly --ly 7
>>: run --from Sol/;station; ;ly;
Would not work, as it would be called as:
trade.py --from "Sol/Burnell Station" "--ly 7"

If you want a simplification like this, you should look into aliases (documented later in this document).


- Aliases -
Aliases are used for storing abbreviations of commonly used commands.
Commands
:alias
:delalias

Usage ":alias [NAME] [COMMAND]"
Omitting the COMMAND prints the current COMMAND, omitting the NAME prints a list of all defined aliases.

Aliases are delete with the command :delalias
Usage ":delalias [NAME]"

-- Simple aliases --
Aliases are defined like variables, but you can store a whole command in them.
>>: :alias myrun run --cap 4 --credits 20000 --ly 7

Then you can just type "myrun" and it executes the whole command.

!Important!
Aliases are called without the ':'-prefix. So variables cannot be named like a basic trade.py option (e.g run).

-- Aliases with variables --
Variables can be used in aliases
>>: :var cap 4 
>>: :alias myrun run --from ;sys; --cap ;cap; --credits 20000 --ly 7
>>: myrun
	-> run --from SOL --cap 4 --credits 20000 --ly 7

-- Aliases with place holders --
You can define place holders in aliases with {0}, {1} .. {n}:
>>: :alias myrun run --from {0} --cap {1}
The place holders will be replaced with the arguments you type after the alias (you can use variables):
>>: myrun ;sys;/Station 4
	-> run --from SOL/Station --cap 4

The place holder ids must be starting with 0 and be continuously.
Additional typed arguments that are not needed for place holders will be appended to the call of the alias:
>>: :alias myrun run --cap 4 --credits 20000 --ly 7
>>: myrun --from SOL/Station
	-> run --cap 4 --credits 20000 --ly 7 --from SOL/Station

-- Aliases calling other aliases --
If the first option defined in alias is the name of another alias, then that alias will be invoked.
Place holders are evaluated for each alias individually (the arguments of the first alias are used for the place holders of the second).
Example:
>>: :alias myrun run --fr {0} --cap 4 --credits {1} --ly 7
>>: :alias myrun2 myrun ;sys;/{0}
>>: myrun2 Station 20000 -v
	-> run -fr SOL/Station --cap 4 --credits 20000 --ly 7 -v

!Important!
Do not create infinite loops like
>>: :alias a b
>>: :alias b c
>>: :alias c a
>>: a


- Integrated python functions -
If your input starts with ':' and is no itrade function, what you type after the ':' will be evaluated as a python expression:
>>: : 4 * 6.8 / 2.1
12.95238095238095

If you type '::' a python shell will open (if the python executable is in your PATH).

Very awesome!

- - - - - Additional Content Posted / Auto Merge - - - - -

what was the --emp and -md commands for again?

"trade.py run --help" is your friend.

--emp = --empty which lets you specify how far your ship can jump when empty. It's used by "--start-jumps" and "--end-jumps".

and how do i use --opt=csvs? whats the entire command is it likw trade.py --opt=csvs

Per the README, the OP and my posts:

Code:
$ trade.py import --plug=maddavo --opt=csvs

or if you are using the tools in the scripts directory,

Code:
$ tdimad --opt=csvs

and --max 0.5 dosent work its saying
Code:
trade.py: ERROR: ambiguous option: --max could match --max-days-old, --max-routes

Again with "--help". Where did you get "--max" from? Which of the two options it was confused about did you actually mean? "--max-days-old" and "--age" do the same thing, and since 0.5 routes wouldn't make sense, I figure that you probably mean "--age 0.5" which restricts results to data that has been submitted in the last 12 hours.

-Oliver
 
I want to update the station data for stations I'm visiting when I find information missing or false and have a few questions about that:

What is the right way to measure the distance between station and star?
For example the databases (including TradeDangerous) I found say that Mokosh/Lubin Orbital is 1071 LS from the star, but when docked at the station, it looks like 1041 LS:
View attachment 19484
Is that wrong data in the databases or is measuring done differently?
Additionally, where can I see in game which is the maximum landing pad size supported by a station?

If I find that data is wrong or missing, can I just correct it and eventually create Pull Requests for the corrected csv-files?

Most people (me included) just use the distance from your arrival point, but that can vary by a few light seconds, plus people claim that some of the difference is due to simulation of the orbits of the planets in realtime (I say claim only because I haven't seen or looked for confirmation of this myself).

To be honest we really only care to within +/-100ls. If it says 1041 and you see 1071, it's fine :)

If it says 1041 and you see 192,1071 ...

tumblr_inline_mok7jhHaaZ1qz4rgp.png


- - - - - Additional Content Posted / Auto Merge - - - - -

New commodity appeared in 1.2 - Painite.

Edit item.csv thusly (don't have diff on my doze box, so you get this ;))

Code:
'Minerals','Bauxite',1
'Minerals','Bertrandite',2
'Minerals','Coltan',3
'Minerals','Gallite',4
'Minerals','Indite',5
'Minerals','Lepidolite',6
'Minerals','Painite',7
'Minerals','Rutile',8
'Minerals','Uraninite',9

Gave you credit when I pushed it :)
 
Firstly, love tradedangerous, and love learning to use it </grovel>

I'm not sure why this question has not been asked before (at least I cant find where its been asked) but how can I add a system that has no stations?

It's my understanding that even if there are no stations in a system TD will still need this data to accurately plot a course? I'm sure I've seen some systems listed in jump routes that don't have stations so how can I add my own?

I have already used maddavo's instructions to calculate positions and have entered those systems into both EDSC and ROSS (eddb) but unlike the station and price data which is updated through maddavo's site/plugin, the system.csv is NOT updated.

Do I have to manually edit TD's System.csv? If so, can you suggest an appropriate mac friendly tool to do so (TextEdit can't cut it) and how can I export these new systems back to other TD users?

Again love TD, long live the TD, etc,etc,

It's been asked - basically, right now, the official td/data/System.csv is curated by me - it's just mean't to be there to get people started, which is proving to be a naff concept and we're moving away from it. But at the moment, it's down to me, and I've been seeing a nurse, well actually a few.

What I do is run the "edscupdate.py" script (to which there is now an --add-to-local-db, --add or -A option) to sanity check new entries against my current location. I just haven't had time to do it recently (there are a small handful of systems that are screwed up that it just doesn't want to correct, GAMMA MUSCAE, etc).

But yes, you can add them by hand, or you can import them from one of the other sources. I'm kind of hoping someone will take the Maddavo plugin and copy it to fetch data from eddb, but apparently I've not been dropping strong enough hints ;)

For editing the .csv files, they're just plain text, so anything should work - but personally I use http://www.sublimetext.com/3; it satisfies the Vi, Emacs and Notepad user in me all at once.

If you want to know why: watch the demo on the front page for a minute: http://www.sublimetext.com/
 
Is this about right? or have I missed something bleeding obvious?

Nope, at the moment that's about right, the other thing you can do is

Code:
trade.py import --plug=maddavo --opt=csvs

to import System, Station and ShipVendor data from Maddavo's. Or if you want to only import systems from him (not stations or shipvendors or prices)

Code:
trade.py import --plug=maddavo --opt=systems --opt=csvsonly

If you're using the scripts (see scripts/README.txt)

Code:
tdimad --opt=csvs
or
tdimad --opt=systems --opt=csvonly

I've just checked in a change that lets you comma-separate multiple options, e.g.

Code:
--opt=systems,stations,shipvendors,csvonly
is equivalent to
--opt=systems --opt=stations --opt=shipvendors --opt=csvonly
or
--opt=csvs,csvonly
 
Hi guys, signed up to the forums just to get a little help with TD. >.<

When I try to run trade.py update -G xihe/zhen I get an error back which reads as follows:

Code:
Can't find a usable init.tcl in the following directories: ... This probably means that Tcl wasn't  installed properly.

I can't cut and paste from the cmd window so you'll have to imagine the directories listings. They all point to various folders in my TD repo folder.

I didn't find a requirements.txt file so if there's something I'm missing, please let me know! I'm excited to start using the tool.

Thanks in advance!

I'm not a Python install guru, but I'm assuming you're using Windows, and this sounds like the symptoms of a problem the happens when (a) you're using Python 2.7 or (b) you've installed multiple bitnesses of Python - 32-bit and 64-bit.

To find out which version of Python you have:

Code:
python --version

If it's 2.7, uninstall, reinstall 3.4.2.

If it's 3.4.2 already, then you probably want to do the following:

1. Uninstall Python (via control panel),
2. Delete the folder C:\Python34\ (or whever you installed Python),
3. Reinstall Python 3.4.2. You very likely want the 64-bit version, and it proves to be faster running TD.

See the install guide here: https://bitbucket.org/kfsone/tradedangerous/wiki/Setup Guide
 
Last edited:
Most people (me included) just use the distance from your arrival point, but that can vary by a few light seconds, plus people claim that some of the difference is due to simulation of the orbits of the planets in realtime (I say claim only because I haven't seen or looked for confirmation of this myself).

To be honest we really only care to within +/-100ls. If it says 1041 and you see 1071, it's fine :)

If it says 1041 and you see 192,1071 ...
Well, I guess this has become much more easy to determine now, since in 1.2 they changed
- Add 'arrival point' line to station pop-up on system map, giving distance (in light-seconds) from the largest star in the system
So once in system map, you can see the distances for each station (I assume distance to arrival point is what matters, and not distance from station to its nearest star, when that's already 1000LS away from the arrival point...)
 
Note: I just committed 112 new systems. Systems I'm still seeing with bad positions include:

COL 285 SECTOR HV-D B13-5
COL 285 SECTOR QE-M B22-6
GAMMA MUSCAE
M CARINAE
 
Note: I just committed 112 new systems. Systems I'm still seeing with bad positions include:

COL 285 SECTOR HV-D B13-5
COL 285 SECTOR QE-M B22-6
GAMMA MUSCAE
M CARINAE

What are you saying, Oliver? Do you want someone to go there and submit distances?
I have a spaceship!
 
Last edited:
Back
Top Bottom