In-Development TradeDangerous: power-user trade optimizer

Yup, confirmed.

I spawned in LHS 3447 and went to two different stations which have different commodities markets.
 
And that's what they mean't by "one economy per system" :) I even called it a long time ago ... Typical for me that it only becomes a reality the day I say "sod it, lets just use systems". ROFL.

Ok. So we won't do that then :) And I'm pretty sure we now have multiple stations with the same name - I'm /fairly/ sure I saw two "Chu Hub"s last night.
 
Well, Shinrarta turns out to be LTT 4549, so I've added that and Jameson Memorial. I've also just added an "import" sub-command so it's easier to share snippets.

I'll add a task for myself to add an "export" command which will also keep at track of when you last exported which station to which "channel", e.g, and make a channel plugin system so that if you name an export channel that has a plugin, it'll automatically run that external code. That'll allow people to set up private zmq networks, web shares, whatever, as well as integrate with things like maddavo's.
 
Code:
trade.py update -G -A -F Meredith

Window stays infront of TD

bazinga.jpg
 
Last edited:
Downloaded the latest version. Downloaded the very small databases and files from maddavo's site. Tried many thinks to add some data to where I've been plonked in the Gamma. Usually the same error. Error below.

Code:
>trade.py buildcache -f
*** INTERNAL ERROR: UNIQUE constraint failed: System.name
CSV File: data\System.csv:1117
SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?)
Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']

Have checked the .prices file and the .csv files, there are no duplicated lines/sections.

As an aside, interesting that there is hardly any data, but there is data for the system where I have been put.
 
You did: *** INTERNAL ERROR: UNIQUE constraint failed: System.name

It's NOT case sensitive: "Aiabiko", "AIABIKO", "aIaBiKo" all the same
 
Code:
trade.py update -G -A -F Meredith

Window stays infront of TD

View attachment 2286

This gui thing is sooooo much quicker for entering prices. I was really getting frustrated with the double-clicking/mousing - now I can almost do it all via keyboard.

Is there a way that the gui could respond to left/right arrows? I like to use the down-arrow to get to the next line but then I have to go all the way over to the tab key if there is a buy price and stock. Oh, also can you make it so that if there is no stock entered but there is a buy price then it automagically enters a "?" ?

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

Downloaded the latest version. Downloaded the very small databases and files from maddavo's site. Tried many thinks to add some data to where I've been plonked in the Gamma. Usually the same error. Error below.

Code:
>trade.py buildcache -f
*** INTERNAL ERROR: UNIQUE constraint failed: System.name
CSV File: data\System.csv:1117
SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?)
Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']

Have checked the .prices file and the .csv files, there are no duplicated lines/sections.

As an aside, interesting that there is hardly any data, but there is data for the system where I have been put.

You need to download the System.csv file - the system Aiabiko is Gamma only - it was renamed from Beta3. There is probably data for the system you spawned in because someone else spawned there too. I think there are only a finite number of random spawn points.
 
So I've tried redownloading all your data maddavo, and now I have this error.

Code:
>trade.py update "Tokubei Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: ShipVendor.station_id
CSV File: data\ShipVendor.csv:2
SQL Query: INSERT INTO ShipVendor (ship_id,station_id,cost) VALUES((SELECT Ship.ship_id FROM Ship WHERE Ship.name = ?),(SELECT Station.station_id FROM Station WHERE Station.name = ?),?)
Params: ['Cobra', 'Aulin Enterprise', '0']
 
So I've tried redownloading all your data maddavo, and now I have this error.

Aulin Enterprise isn't in the Station.csv - someone needs to go there and enter some prices. The ShipVendor.csv file refers to some stations that aren't in the Station.csv .

Delete all but the first line in the ShipVendor.csv
 
I've just noticed there's a saitek folder. What is that for please?

It's so you can do

Code:
trade.py run --cr 100 --ly 7.56 --cap 4 --fr Aiabiko --hops 3 --check --x52

You'll get the usual checklist, but it'll also put the checklist on the X52 MFD.

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

Downloaded the latest version. Downloaded the very small databases and files from maddavo's site. Tried many thinks to add some data to where I've been plonked in the Gamma. Usually the same error. Error below.

Code:
>trade.py buildcache -f
*** INTERNAL ERROR: UNIQUE constraint failed: System.name
CSV File: data\System.csv:1117
SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?)
Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']

Have checked the .prices file and the .csv files, there are no duplicated lines/sections.

As an aside, interesting that there is hardly any data, but there is data for the system where I have been put.

@maddavo: Can you change the first line of your System.csv and Station.csv:

System.csv
Code:
unq:name,pos_x,pos_y,pos_z,name@Added.added_id,modified

Station.csv
Code:
name@System.system_id,unq:name,ls_from_star

Then TD can do the uniqueness check itself and give better feedback.
 
Aulin Enterprise isn't in the Station.csv - someone needs to go there and enter some prices. The ShipVendor.csv file refers to some stations that aren't in the Station.csv .

Delete all but the first line in the ShipVendor.csv

So how will ShipVendor.csv be updated going forwards?

But I've done as you suggest thanks, and now I get this.

Code:
td>trade.py update "Virtanen  Ring"
trade.py: ERROR: Unrecognized origin station: Virtanen Ring

If add that station to staion.csv and try again, I get:

Code:
trade.py update "Virtanen Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id
CSV File: data\Station.csv:27
SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?)
Params: ['LTT 16764', 'Virtanen Ring', '0']

Looking in the system.csv file, I can see the system is not there, but don't know how to add the LTT 16764 system, as I don't know co-ordinates, so now I'm stuck.

(I did a small test, and added a line to system.csv with some fake co-ordinates, and trade.py would then run). Am I missing something here?

As an aside, after I added the station to station.csv and got that 2nd error, how does the programme know that the station is in the ''LTT 16764" system, when the system isn't in the databases?
 
Last edited:
So how will ShipVendor.csv be updated going forwards?

But I've done as you suggest thanks, and now I get this.

Code:
td>trade.py update "Virtanen  Ring"
trade.py: ERROR: Unrecognized origin station: Virtanen Ring

If add that station to staion.csv and try again, I get:

Code:
trade.py update "Virtanen Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id
CSV File: data\Station.csv:27
SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?)
Params: ['LTT 16764', 'Virtanen Ring', '0']

Looking in the system.csv file, I can see the system is not there, but don't know how to add the LTT 16764 system, as I don't know co-ordinates, so now I'm stuck.

(I did a small test, and added a line to system.csv with some fake co-ordinates, and trade.py would then run). Am I missing something here?

As an aside, after I added the station to station.csv and got that 2nd error, how does the programme know that the station is in the ''LTT 16764" system, when the system isn't in the databases?

Right now the System.csv that comes with TD is only useful for the beta 3 area. If you'd like to contribute new systems, look for Wolverine's thread on crowd-sourcing the system data. We're hoping that the FD guys, esp Michael Brookes, will throw us a bone with a list of some systems or something but given that there is a significant number of players who think that external tools like this is some form of cheating (because they haven't actually applied two brain cells to the problem) it's possible we might have to build the data set ourselves.

I'm quite happy to integrate TD with one of the data sets. There's a preliminary pass at making it work with "EDStars" in the misc directory, but their data only has a few dozen stars in it right now.
 
Thanks for the clarification. Any chance you could add an 'add' function as well as the existing update?

And how does trade.py know that the station is in that system if there is no system data?
 
So how will ShipVendor.csv be updated going forwards?

I think we'll be using that to store info on where we can buy ships but for the moment it can be blank.

But I've done as you suggest thanks, and now I get this.

Code:
td>trade.py update "Virtanen  Ring"
trade.py: ERROR: Unrecognized origin station: Virtanen Ring

If add that station to staion.csv and try again, I get:

Code:
trade.py update "Virtanen Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id
CSV File: data\Station.csv:27
SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?)
Params: ['LTT 16764', 'Virtanen Ring', '0']

Looking in the system.csv file, I can see the system is not there, but don't know how to add the LTT 16764 system, as I don't know co-ordinates, so now I'm stuck.

(I did a small test, and added a line to system.csv with some fake co-ordinates, and trade.py would then run). Am I missing something here?

As an aside, after I added the station to station.csv and got that 2nd error, how does the programme know that the station is in the ''LTT 16764" system, when the system isn't in the databases?

OK! There's alot there, much of it I think might be addressed on an 'info' page I made - see HERE.

Basically, you've done the right thing by adding the station to the Station.csv but you've come across the problem that the System "LTT 16764" isn't in the System.csv . The coordinates of the system are needed for the System.csv. I've been adding systems to the System.csv and also updating RedWizzard's list - he keeps TOR (The One Reference) until the crowdsourcing website is up. The System.csv is based on TOR.

If you can't wait, go to HERE and send me a PM with the distances from LTT 16764 to the systems listed there and I'll add them into the System.csv and the TOR for you OR just enter the distances into the page and send me a PM with the json output for the system. Sorry for the cryptic nature of some of this stuff.
 
@maddavo: Can you change the first line of your System.csv and Station.csv:

System.csv
Code:
unq:name,pos_x,pos_y,pos_z,name@Added.added_id,modified

Station.csv
Code:
name@System.system_id,unq:name,ls_from_star

Then TD can do the uniqueness check itself and give better feedback.

Done.

BTW: MB said that System names should be unique but Station names may not be - what do we do if we come across a duplicate station name?
 
That's perfect instructions thank you. Think I'll go and 'crowd source' a few of the systems around my starting point and PM you. I've already tried EDStarCoordinator to try and get some co-ordinates, but it wasn't able to help as I think I'm the first.
 
I don't seem able to update anything after the buy and sell prices i.e. demand and supply

Not sure I have the patience to play this game without the trade data.
 
Last edited:
Back
Top Bottom