Ejemplo n.º 1
0
        public void RunOnceAfterStartup()
        {
            if (!_runOnceAfterStartupalreadyProcessed && DateTime.UtcNow > Cache.Instance.QuestorStarted_DateTime.AddSeconds(15))
            {
                if (Settings.Instance.CharacterXMLExists && DateTime.UtcNow > Cache.Instance.NextStartupAction)
                {
                    Cache.Instance.DirectEve.Skills.RefreshMySkills();
                    _runOnceAfterStartupalreadyProcessed = true;

                    Cache.Instance.IterateShipTargetValues("RunOnceAfterStartup");                 // populates ship target values from an XML
                    Cache.Instance.IterateInvTypes("RunOnceAfterStartup");                         // populates the prices of items (cant we use prices from the game now?!)
                    Cache.Instance.IterateUnloadLootTheseItemsAreLootItems("RunOnceAfterStartup"); // populates the list of items we never want in our local cargo (used mainly in unloadloot)

                    if (Settings.Instance.UseInnerspace)
                    {
                        InnerspaceCommands.CreateLavishCommands();

                        UpdateMissionName();

                        //enable windowtaskbar = on, so that minimized windows do not make us die in a fire.
                        Logging.Log("RunOnceAfterStartup", "Running Innerspace command: timedcommand 100 windowtaskbar on " + Settings.Instance.CharacterName, Logging.White);
                        LavishScript.ExecuteCommand("timedcommand 100 windowtaskbar on " + Settings.Instance.CharacterName);

                        if (Settings.Instance.EVEWindowXSize >= 100 && Settings.Instance.EVEWindowYSize >= 100)
                        {
                            Logging.Log("RunOnceAfterStartup", "Running Innerspace command: timedcommand 150 WindowCharacteristics -size " + Settings.Instance.EVEWindowXSize + "x" + Settings.Instance.EVEWindowYSize, Logging.White);
                            LavishScript.ExecuteCommand("timedcommand 150 WindowCharacteristics -size " + Settings.Instance.EVEWindowXSize + "x" + Settings.Instance.EVEWindowYSize);
                            Logging.Log("RunOnceAfterStartup", "Running Innerspace command: timedcommand 200 WindowCharacteristics -pos " + Settings.Instance.EVEWindowXPosition + "," + Settings.Instance.EVEWindowYPosition, Logging.White);
                            LavishScript.ExecuteCommand("timedcommand 200 WindowCharacteristics -pos " + Settings.Instance.EVEWindowXPosition + "," + Settings.Instance.EVEWindowYPosition);
                        }

                        if (Settings.Instance.MinimizeEveAfterStartingUp)
                        {
                            Logging.Log("RunOnceAfterStartup", "MinimizeEveAfterStartingUp is true: Minimizing EVE with: WindowCharacteristics -visibility minimize", Logging.White);
                            LavishScript.ExecuteCommand("WindowCharacteristics -visibility minimize");
                        }

                        if (Settings.Instance.LoginQuestorArbitraryOSCmd)
                        {
                            Logging.Log("RunOnceAfterStartup", "After Questor Login: executing LoginQuestorArbitraryOSCmd", Logging.White);
                            LavishScript.ExecuteCommand("Echo [${Time}] OSExecute " + Settings.Instance.LoginQuestorOSCmdContents.ToString(CultureInfo.InvariantCulture));
                            LavishScript.ExecuteCommand("OSExecute " + Settings.Instance.LoginQuestorOSCmdContents.ToString(CultureInfo.InvariantCulture));
                            Logging.Log("RunOnceAfterStartup", "Done: executing LoginQuestorArbitraryOSCmd", Logging.White);
                        }

                        if (Settings.Instance.LoginQuestorLavishScriptCmd)
                        {
                            Logging.Log("RunOnceAfterStartup", "After Questor Login: executing LoginQuestorLavishScriptCmd", Logging.White);
                            LavishScript.ExecuteCommand("Echo [${Time}] runscript " + Settings.Instance.LoginQuestorLavishScriptContents.ToString(CultureInfo.InvariantCulture));
                            LavishScript.ExecuteCommand("runscript " + Settings.Instance.LoginQuestorLavishScriptContents.ToString(CultureInfo.InvariantCulture));
                            Logging.Log("RunOnceAfterStartup", "Done: executing LoginQuestorLavishScriptCmd", Logging.White);
                        }

                        Logging.MaintainConsoleLogs();
                    }
                }
                else
                {
                    Logging.Log("RunOnceAfterStartup", "Settings.Instance.CharacterName is still null", Logging.Orange);
                    Cache.Instance.NextStartupAction     = DateTime.UtcNow.AddSeconds(10);
                    _runOnceAfterStartupalreadyProcessed = false;
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        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("QuestorTest1", "Syntax:", Logging.White);
                //Logging.Log("QuestorTest1", "DotNet BuyLPI BuyLPI <TypeName or TypeId> [Quantity]", Logging.White);
                //Logging.Log("QuestorTest1", "(Quantity is optional)", Logging.White);
                //Logging.Log("QuestorTest1", "", Logging.White);
                //Logging.Log("QuestorTest1", "Example:", Logging.White);
                //Logging.Log("QuestorTest1", "DotNet BuyLPI BuyLPI \"Caldari Navy Mjolnir Torpedo\" 10", Logging.White);
                //Logging.Log("QuestorTest1", "*OR*", Logging.White);
                //Logging.Log("QuestorTest1", "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("QuestorTest1", "Quantity must be an integer, 0 - " + int.MaxValue, Logging.White);
                //    return;
                //}
                //
                //if (dummy < 0)
                //{
                //    Logging.Log("QuestorTest1", "Quantity must be a positive number", Logging.White);
                //    return;
                //}
                //
                //_quantity = dummy;
                //_totalQuantityOfOrders = dummy;
            }

            Cache.Instance.QuestorStarted_DateTime = DateTime.UtcNow;

            InnerspaceCommands.CreateLavishCommands();
            //InnerspaceEvents.CreateLavishEvents();

            //InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "Starting BuyLPI... - innerspace Echo"));
            Logging.Log("QuestorTest1", "Starting QuestorTest1...", 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("QuestorTest1", "QuestorTest1 finished.", Logging.White);
            //InnerSpace.Echo(string.Format("{0:HH:mm:ss} {1}", DateTimeForLogs, "BuyLPI: Finished 2"));
        }