private static void Main(string[] args)
{
DateTimeForLogs = DateTime.Now;
//Logging.Log("BuyLPI", "BuyLPI: Test", Logging.White);
//InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "BuyLPI: Test2"));
if (args.Length == 0)
{
//InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "BuyLPI: 0 arguments"));
Logging.Log("BuyLPI", "Syntax:", Logging.White);
Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI <TypeName or TypeId> [Quantity]", Logging.White);
Logging.Log("BuyLPI", "(Quantity is optional)", Logging.White);
Logging.Log("BuyLPI", "", Logging.White);
Logging.Log("BuyLPI", "Example:", Logging.White);
Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI \"Caldari Navy Mjolnir Torpedo\" 10", Logging.White);
Logging.Log("BuyLPI", "*OR*", Logging.White);
Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI 27339 10", Logging.White);
return;
}
if (args.Length >= 1)
{
_type = args[0];
}
if (args.Length >= 2)
{
int dummy;
if (!int.TryParse(args[1], out dummy))
{
Logging.Log("BuyLPI", "Quantity must be an integer, 0 - " + int.MaxValue, Logging.White);
return;
}
if (dummy < 0)
{
Logging.Log("BuyLPI", "Quantity must be a positive number", Logging.White);
return;
}
_quantity = dummy;
_totalQuantityOfOrders = dummy;
}
//InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "Starting BuyLPI... - innerspace Echo"));
Logging.Log("BuyLPI", "Starting BuyLPI...", Logging.White);
_cleanup = new Cleanup();
Cache.Instance.DirectEve = new DirectEve();
Cache.Instance.DirectEve.OnFrame += OnFrame;
// Sleep until we're done
while (_done.AddSeconds(5) > DateTime.UtcNow)
{
Thread.Sleep(50);
}
Cache.Instance.DirectEve.Dispose();
Logging.Log("BuyLPI", "BuyLPI finished.", Logging.White);
//InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "BuyLPI: Finished 2"));
}