FYI that won't work. Your code expects a file with at least a certain amount of data in it.
It just expects the file to exist, hence the "echo >data\tradedangerous.prices". Try it.
FYI that won't work. Your code expects a file with at least a certain amount of data in it.
I think it would be useful to have a list of commands and what they do..
Im trying to piece things together but I keep seeing commands that I had no clue about previously. For example, CTRL-C, this closes the program? Previously I thought just closing the cmd window would close out the program.
thanks![]()
Yes. That's an idiotic Python issue. The "pip" script is generally atCode:C:\Python34\Scripts\pip.exe
You'll need to fully specify the path to run pip, or go inside the Scripts directory and run pip from there.
emdn-tap.py -v --commit 30 --warn 2>warnings.txt
Whats is this doing??
I can run this command alone and it starts telling me that it is committing records.
ED is not even running.
Where is the data coming from and going to?
Also..
Im not sure how to use it..
So..
Currently there are only 3 commands
cleanup
run
update
??
Speaking about roundtrips. Given the amazing speed of TD. Would it be possible to find the best roundtrips, not for two but for for example 3-4 stations. So it involves buying/selling at multiple stations to get the best trade route.
XYYYYYYY : costs 250 + 350 => 600cr, profit = 100 + 210 => 310cr
XXYYYYYY : costs 500 + 300 => 800cr, profit = 200 + 180 => 380cr
XXXYYYYY : costs 750 + 250 => 1000cr, profit = 300 + 150 => 450cr
XXXX---- : costs 1000 + 0 => 1000cr, profit = 400 + 0 => 400cr
YYYYYYYY : costs 0 + 400 => 400cr, profit = 0 + 120 => 120cr
$ ./trade.py run --ship cobra --from chango --cr 100 --hops 8
I BOOTIS/Chango Dock -> BD+47 2112/Olivas Settlement:
>-> At I BOOTIS/Chango Dock, Buy: 6 x Algae,
+ At RAKAPILA/Stone Enterprise, Buy: 32 x Biowaste,
+ At I BOOTIS/Chango Dock, Buy: 36 x Food Cartridges,
+ At RAKAPILA/Stone Enterprise, Buy: 36 x Clothing,
+ At AULIN/Aulin Enterprise, Buy: 12 x Agri-Medicines, 7 x Biowaste,
+ At WYRD/Vonarburg Co-operative, Buy: 36 x Fish,
+ At AULIN/Aulin Enterprise, Buy: 30 x Agri-Medicines, 2 x Pesticides, 3 x Biowaste,
+ At WYRD/Vonarburg Co-operative, Buy: 36 x Fish,
<-< Olivas Settlement gaining 43,394cr => 43,494cr total
$ ./trade.py run --ship cobra --from chango --cr 100 --hops 8 -v -v -v
With 100cr / From I BOOTIS/Chango Dock / To Anywhere
36 cap, 8 hops, max 2 jumps/hop and max 7.30 ly/jump
I BOOTIS/Chango Dock -> BD+47 2112/Olivas Settlement:
Start CR: 100
Hops : 8
Jumps : 14
Gain CR : 43,394
Gain/Hop: 5,424
Final CR: 43,494
>-> At I BOOTIS/Chango Dock, Buy:
| 6 x Algae @ 15cr each, 90cr total,
| 100cr => i Bootis -> Aulin -> Rakapila => Gain 480cr (80cr/ton) => 580cr
+ At RAKAPILA/Stone Enterprise, Buy:
| 32 x Biowaste @ 18cr each, 576cr total,
| 580cr => Rakapila -> Aulin -> i Bootis => Gain 1,568cr (49cr/ton) => 2,148cr
+ At I BOOTIS/Chango Dock, Buy:
| 36 x Food Cartridges @ 19cr each, 684cr total,
| 2,148cr => i Bootis -> Aulin -> Rakapila => Gain 2,988cr (83cr/ton) => 5,136cr
+ At RAKAPILA/Stone Enterprise, Buy:
| 36 x Clothing @ 129cr each, 4,644cr total,
| 5,136cr => Rakapila -> Aulin => Gain 4,392cr (122cr/ton) => 9,528cr
+ At AULIN/Aulin Enterprise, Buy:
| 12 x Agri-Medicines @ 783cr each, 9,396cr total,
| 7 x Biowaste @ 18cr each, 126cr total,
| 9,528cr => Aulin -> BD+47 2112 -> Wyrd => Gain 3,950cr (207cr/ton) => 13,478cr
+ At WYRD/Vonarburg Co-operative, Buy:
| 36 x Fish @ 358cr each, 12,888cr total,
| 13,478cr => Wyrd -> BD+47 2112 -> Aulin => Gain 10,260cr (285cr/ton) => 23,738cr
+ At AULIN/Aulin Enterprise, Buy:
| 30 x Agri-Medicines @ 783cr each, 23,490cr total,
| 2 x Pesticides @ 97cr each, 194cr total,
| 3 x Biowaste @ 18cr each, 54cr total,
| 23,738cr => Aulin -> BD+47 2112 -> Wyrd => Gain 9,352cr (267cr/ton) => 33,090cr
+ At WYRD/Vonarburg Co-operative, Buy:
| 36 x Fish @ 358cr each, 12,888cr total,
| 33,090cr => Wyrd -> BD+47 2112 => Gain 10,404cr (289cr/ton) => 43,494cr
<-< Olivas Settlement gaining 43,394cr => 43,494cr total
$ ./trade.py run --ship cobra --from chango --cr 100 --hops 8 --avoid aulinenter --avoid morgor --avoid dahan --avoid asellus --avoid ross1015 --avoid lhs2887 --avoid bolg --margin 0
I BOOTIS/Chango Dock -> I BOOTIS/Chango Dock:
>-> At I BOOTIS/Chango Dock, Buy: 6 x Algae,
+ At RAKAPILA/Stone Enterprise, Buy: 32 x Biowaste,
+ At I BOOTIS/Chango Dock, Buy: 36 x Food Cartridges,
+ At RAKAPILA/Stone Enterprise, Buy: 13 x Dom. Appliances, 10 x Biowaste,
+ At I BOOTIS/Chango Dock, Buy: 36 x Food Cartridges,
+ At RAKAPILA/Stone Enterprise, Buy: 28 x Dom. Appliances, 8 x Biowaste,
+ At I BOOTIS/Chango Dock, Buy: 36 x Food Cartridges,
+ At RAKAPILA/Stone Enterprise, Buy: 36 x Dom. Appliances,
<-< Chango Dock gaining 24,830cr => 24,930cr total
About speed: Its amazing, and you stated with some tweaking it could be even be much better/faster. Should TD ever becoming not fast enough, you could always go the MT route - if you deem that needed.
As I stated before: I can see this become the engine of choice for GUI builders - if optional JSON/XML output is implemented. Is that something you would like to pursue/see happen?
Excellent..
So, basically I can open up my cmd prompt..
run emdn-tap
Open another cmd prompt for my trade.py calculations
Run cleanup once in awhile.
And be all good.. correct??
Also..am I correct in saying that I do Not need to run Andreas EMDN and firehose for this to work??
Think this depends on whether you allowed Python to add itself to the system PATH during installation and/or whether you made it available for all users.
If you chose not to do those things, then you won't have access to "pip" from the command line without doing what Rikkles describes.
Yes you are right. I'm using Windows' PowerShell which doesn't seem to take the system environment variables properly. If I use cmd then all is correct.
I'm such a disaster with Windows... Only use it for games, for everything else there's unix variants.
Hmmm, there is no Windows GUI for this yet, right? Maybe I should make one.![]()
It just expects the file to exist, hence the "echo >data\tradedangerous.prices". Try it.
Expecting: '@ SYSTEM / Station'.
Got: 'ECHO is on'
Hmmm, there is no Windows GUI for this yet, right? Maybe I should make one.![]()
<Window x:Class="TradeDangerousGUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="TradeDangerousGUI" Height="319" Width="357" MinWidth="357" MinHeight="319">
<Grid Margin="0,0,2,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="136"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="146"/>
<RowDefinition Height="Auto" MinHeight="29"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Left" Height="132" VerticalAlignment="Top" Width="78" Margin="10,10,0,0">
<Label x:Name="lbShip" Content="Ship:" HorizontalAlignment="Left" VerticalAlignment="Top" Width="52" Height="26"/>
<Label Content="Hops:" HorizontalAlignment="Left" VerticalAlignment="Top" Width="68" Height="26"/>
<Label x:Name="lbFrom" Content="From:" HorizontalAlignment="Left" VerticalAlignment="Top" Width="52" Height="26"/>
<Label x:Name="lbCredits" Content="Credits:" HorizontalAlignment="Left" VerticalAlignment="Top" Width="52" Height="26"/>
<Label x:Name="lbCredits_Copy" Content="Insurance:" HorizontalAlignment="Left" VerticalAlignment="Top" Width="68" Height="26"/>
</StackPanel>
<StackPanel Height="132" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Left" Width="126">
<ComboBox x:Name="cbShips" VerticalAlignment="Top" SelectionChanged="ComboBox_SelectionChanged" SelectedIndex="0" Height="26" Margin="0,0,10,0">
<ComboBoxItem Content="Viper"/>
<ComboBoxItem Content="Eagle"/>
<ComboBoxItem Content="Sidewinder"/>
<ComboBoxItem Content="Hauler"/>
<ComboBoxItem Content="Cobra"/>
<ComboBoxItem Content="Lakon Type 6"/>
<ComboBoxItem Content="Lakon Type 9"/>
<ComboBoxItem Content="Anaconda"/>
</ComboBox>
<xctk:IntegerUpDown x:Name="intHops" FormatString="N0" Value="2" Increment="1" Minimum="1" Height="26" VerticalAlignment="Top" Margin="0,0,10,0"/>
<ComboBox x:Name="cbFrom" VerticalAlignment="Top" SelectedIndex="3" Height="26" Margin="0,0,10,0">
<ComboBoxItem Content="26 Draconis"/>
<ComboBoxItem Content="Acihaut"/>
<ComboBoxItem Content="Aganippe"/>
<ComboBoxItem Content="Asellus Primus"/>
<ComboBoxItem Content="Aulin"/>
<ComboBoxItem Content="Aulis"/>
<ComboBoxItem Content="BD+47 2112"/>
<ComboBoxItem Content="BD+55 1519"/>
<ComboBoxItem Content="Bolg"/>
<ComboBoxItem Content="Chi Herculis"/>
<ComboBoxItem Content="CM Draco"/>
<ComboBoxItem Content="Dahan"/>
<ComboBoxItem Content="DN Draconis"/>
<ComboBoxItem Content="DP Draconis"/>
<ComboBoxItem Content="Eranin"/>
<ComboBoxItem Content="G 239-25"/>
<ComboBoxItem Content="GD 319"/>
<ComboBoxItem Content="h Draconis"/>
<ComboBoxItem Content="Hermitage"/>
<ComboBoxItem Content="i Bootis"/>
<ComboBoxItem Content="Ithaca"/>
<ComboBoxItem Content="Keries"/>
<ComboBoxItem Content="Lalande 29917"/>
<ComboBoxItem Content="LFT 1361"/>
<ComboBoxItem Content="LFT 880"/>
<ComboBoxItem Content="LFT 992"/>
<ComboBoxItem Content="LHS 2819"/>
<ComboBoxItem Content="LHS 2884"/>
<ComboBoxItem Content="LHS 2887"/>
<ComboBoxItem Content="LHS 3006"/>
<ComboBoxItem Content="LHS 3262"/>
<ComboBoxItem Content="LHS 417"/>
<ComboBoxItem Content="LHS 5287"/>
<ComboBoxItem Content="LHS 6309"/>
<ComboBoxItem Content="LP 271-25"/>
<ComboBoxItem Content="LP 275-68"/>
<ComboBoxItem Content="LP 64-194"/>
<ComboBoxItem Content="LP 98-132"/>
<ComboBoxItem Content="Magec"/>
<ComboBoxItem Content="Meliae"/>
<ComboBoxItem Content="Morgor"/>
<ComboBoxItem Content="Nang Ta-khian"/>
<ComboBoxItem Content="Naraka"/>
<ComboBoxItem Content="Opala"/>
<ComboBoxItem Content="Ovid"/>
<ComboBoxItem Content="Pi-fang"/>
<ComboBoxItem Content="Rakapila"/>
<ComboBoxItem Content="Ross 1015"/>
<ComboBoxItem Content="Ross 1051"/>
<ComboBoxItem Content="Ross 1057"/>
<ComboBoxItem Content="Styx"/>
<ComboBoxItem Content="Surya"/>
<ComboBoxItem Content="Tilian"/>
<ComboBoxItem Content="WISE 1647+5632"/>
<ComboBoxItem Content="Wyrd"/>
</ComboBox>
<xctk:IntegerUpDown x:Name="intCredits" FormatString="N0" Value="1000" Increment="1000" Margin="0,0,10,0" Minimum="0" Height="26" VerticalAlignment="Top"/>
<xctk:IntegerUpDown x:Name="intInsurance" FormatString="N0" Value="1000" Increment="1000" Margin="0,0,10,0" Minimum="0" Height="26" VerticalAlignment="Top"/>
</StackPanel>
<Button x:Name="btCalculate" Content="Calculate" HorizontalAlignment="Left" VerticalAlignment="Top" Width="76" Height="22" Margin="10,5,0,0" Grid.Row="1" Click="btCalculate_Click"/>
<StackPanel Grid.Column="2" Height="100" Margin="2,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="111">
<RadioButton x:Name="rbStandardDetails" Content="Default details" GroupName="rbgrpDetails"/>
<RadioButton x:Name="rbMoreDetails" Content="More details" GroupName="rbgrpDetails"/>
<RadioButton x:Name="rbEvenMoreDetails" Content="Even more details" GroupName="rbgrpDetails"/>
</StackPanel>
<TextBox x:Name="tbResult" Grid.ColumnSpan="3" Margin="10" Grid.Row="2" TextWrapping="Wrap" Text="Hit calculate, Commander!" IsReadOnly="True"/>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.IO;
namespace TradeDangerousGUI
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
private void btCalculate_Click(object sender, RoutedEventArgs e)
{
string strDetails = "";
if (rbStandardDetails.IsChecked == true)
strDetails = "";
else if (rbMoreDetails.IsChecked == true)
strDetails = " -v";
else if (rbEvenMoreDetails.IsChecked == true)
strDetails = " -vv";
string strShellCommand = "";
strShellCommand = "trade.py run" + strDetails + " " + "--sh \"" + cbShips.Text + "\" --ho " + intHops.Value.ToString() + " --from \"" + cbFrom.Text + "\" --cr " + intCredits.Value.ToString() + " --ins " + intInsurance.Value.ToString();
var process = new Process();
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
process.StartInfo.FileName = "python.exe";
process.StartInfo.Arguments = strShellCommand;
process.Start();
tbResult.Text = "";
tbResult.Text = strShellCommand + Environment.NewLine + Environment.NewLine;
while (process.StandardOutput.Peek() > -1)
{
tbResult.AppendText(process.StandardOutput.ReadLine() + Environment.NewLine );
}
while (process.StandardError.Peek() > -1)
{
tbResult.AppendText(process.StandardError.ReadLine() + Environment.NewLine);
}
process.WaitForExit();
}
}
}
After two hours of testing the first stuff seems to work. I'm not sure about your 26 Draconis system in your script. Example: trade.py run --sh "Viper" --ho 2 --from "26 Draconis" --cr 999999 --ins 1000
The error message is pretty long.
Traceback (most recent call last):
File "trade.py", line 745, in <module>
main()
File "trade.py", line 737, in main
return args.proc(args)
File "trade.py", line 407, in runCommand
processRunArguments(args)
File "trade.py", line 340, in processRunArguments
originStation = tdb.lookupStation(originName)
File "c:\Users\xxx\Desktop\kfsone-tradedangerous-3eddcf579641\tradedb.py", line 530, in lookupStation
raise ValueError("System '%s' has %d stations, please specify a station instead." % (name, len(system.stations)))
ValueError: System '26 Draconis' has 0 stations, please specify a station instead.
ValueError: System '26 Draconis' has 0 stations, please specify a station instead.
Found Access again. Thanks for the very detailed answers. Gonna reread them. again next week. Arm TD has 2 resources, manual file and Emdn-Tap. Someone created Elite-metrics a Webapi Fed by Emden. The API gives back stuff like latest Prices. So no Need to have Emdn-tap Running. Perhaps usefull for TD?
ValueError: System '26 Draconis' has 0 stations, please specify a station instead.