Ejemplo n.º 1
0
        public override bool OnFrameImpl()
        {
            Agent agent;

            if (!opened_conversation)
            {
                agent = new Agent("ByID", agent_id);
                agent.StartConversation();
                opened_conversation = true;
                return(true);
            }

            // now wait until we're sure the dialog is open
            EVEWindow window = EVEWindow.GetWindowByCaption(convo_name);

            if (window == null || !window.IsValid)
            {
                return(true);
            }

            agent = new Agent("ByID", agent_id);
            List <DialogString> responses = agent.GetDialogResponses();

            if (responses == null)
            {
                return(true);
            }

            // find the one that reads "[Button]Complete Mission" - should be the first
            DialogString ds = null;

            foreach (DialogString dialogstring in responses)
            {
                if (dialogstring.Text == "[Button]Complete Mission")
                {
                    ds = dialogstring;
                    break;
                }
            }

            if (ds != null)
            {
                ds.Say(agent_id);
                SetDone("Quest Completed");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Close unnecessary EVE modal windows.
        /// </summary>
        void _closeEveWindows()
        {
            //First check for any "MessageBox" template windows
            EVEWindow infoWindow = new EVEWindow("MessageBox");

            if (infoWindow.IsValid)
            {
                //Fleet invitations are message boxes. Close it if we're not currently invited to a fleet
                if (!MeCache.Me.Fleet.Invited || MeCache.Me.Fleet.InvitationText == "NULL")
                {
                    infoWindow.Close();
                }
            }

            //Next check for any "Information" template windows
            infoWindow = new EVEWindow("ByCaption,Information");
            if (infoWindow.IsValid)
            {
                infoWindow.Close();
            }
        }
Ejemplo n.º 3
0
        public override bool OnFrameImpl()
        {
            // check if we can see the window
            EVEWindow window = EVEWindow.GetWindowByCaption(name);

            if (window != null && window.IsValid && window.HTML.Length > 0)
            {
                Page = new MissionPage(window.HTML);
                SetDone("Success");
                return(false);
            }

            // try opening the page if we haven't tried already
            if (!tried_opening)
            {
                // TODO: maybe check if the return value of this matters
                Util.FindMission(agent_id).GetDetails();
                tried_opening = true;
            }
            return(true);
        }
Ejemplo n.º 4
0
        void RunCommand(string command)
        {
            if (command == "clear")
            {
                states.Clear();
            }
            else if (command == "exit")
            {
                InnerSpace.Echo("Exiting...");
                // set up the handler for events coming back from InnerSpace
                LavishScript.Events.DetachEventTarget("OnFrame", OnFrame);
                LavishScript.Commands.RemoveCommand("ee");

                lock (lock_) {
                    Monitor.Pulse(lock_);
                }
            }
            else if (command == "update")
            {
                LavishScript.ExecuteCommand("execute evecmd_update woot");
            }
            else if (command == "undock")
            {
                State state = new UndockState();
                TryToEnterState(state);
            }
            else if (command == "gates")
            {
                List <Entity> entities = g.eve.QueryEntities("GroupID = 10");
                g.Print("Found {0} Stargates:", entities.Count);
                int i = 0;
                foreach (Entity entity in entities)
                {
                    g.Print("#{0}: [{2}] {1}", i, entity.Name, entity.ID);
                    i++;
                }
            }
            else if (command == "agents")
            {
                var agents = g.eve.GetAgents();
                if (agents == null)
                {
                    g.Print("EVE.GetAgents() return null");
                }
                else
                {
                    g.Print("Found {0} Agents:", agents.Count);
                }
            }
            else if (command == "stations")
            {
                List <Entity> entities = g.eve.QueryEntities("GroupID = 15");
                g.Print("Found {0} Stations:", entities.Count);
                int i = 0;
                foreach (Entity entity in entities)
                {
                    g.Print("#{0}: [{2}] {1}", i, entity.Name, entity.ID);
                    i++;
                }
            }
            else if (command == "missions")
            {
                List <AgentMission> missions = g.eve.GetAgentMissions();
                if (missions != null && missions.Count != 0)
                {
                    g.Print("Found {0} Missions:", missions.Count);
                    int i = 0;
                    foreach (AgentMission mission in missions)
                    {
                        g.Print("#{0}: {1}", i, mission.Name);
                        g.Print("    AgentID={0}", mission.AgentID);
                        g.Print("    Expires={0}", mission.Expires);
                        g.Print("    State={0}", mission.State);
                        g.Print("    Type={0}", mission.Type);
                        mission.GetDetails(); //opens details window
                        List <BookMark> bookmarks = mission.GetBookmarks();
                        int             j         = 0;
                        g.Print("    {0} Bookmarks:", bookmarks.Count);
                        foreach (BookMark bookmark in bookmarks)
                        {
                            g.Print("    Bookmark #{0}: [{2}] {1}", j, bookmark.Label, bookmark.ID);
                            g.Print("        Type: [{0}] {1}", bookmark.TypeID, bookmark.TypeID);
                            g.Print("        LocationType: {0}", bookmark.LocationType);
                            g.Print("        SolarSystemID: {0}", bookmark.SolarSystemID);
                            j++;
                        }
                        i++;
                    }
                }
                else if (missions == null)
                {
                    g.Print("Getting missions failed");
                }
                else
                {
                    g.Print("No missions found");
                }
            }
            else if (command.StartsWith("printwindow "))
            {
                string    window_name = command.Substring(12);
                EVEWindow window      = EVEWindow.GetWindowByName(window_name);
                if (window == null || !window.IsValid)
                {
                    window = EVEWindow.GetWindowByCaption(window_name);
                }

                if (window != null && window.IsValid)
                {
                    g.Print(window.Caption);
                    g.Print(window.HTML);

                    try // to parse some basics
                    {
                        MissionPage page = new MissionPage(window.HTML);
                        g.Print("Title: {0}", page.Title);
                        g.Print("CargoID: {0}", page.CargoID);
                        g.Print("Volume: {0}", page.CargoVolume);
                    }
                    catch { }
                }
                else
                {
                    g.Print("window \"{0}\" not found", window_name);
                }
            }
            else if (command == "printitems")
            {
                // print the items in station
                if (!g.me.InStation)
                {
                    g.Print("Not in station...");
                }
                else
                {
                    List <Item> items = g.me.GetHangarItems();
                    if (items == null)
                    {
                        g.Print("Failed to GetHangerItems");
                    }
                    else
                    {
                        int i = 0;
                        g.Print("Found {0} Items:", items.Count);
                        foreach (Item item in items)
                        {
                            g.Print("#{0}: [{2}] {1} x{3}", i, item.Name, item.ID, item.Quantity);
                            g.Print("    Description={0}", item.Description);
                            g.Print("    Type=[{0}] {1}", item.TypeID, item.Type);
                            g.Print("    Category=[{0}] {1}", item.CategoryID, item.Category);
                            g.Print("    BasePrice={0}", item.BasePrice);
                            g.Print("    UsedCargoCapacity={0}", item.UsedCargoCapacity);
                            i++;
                        }
                    }
                }
            }
            else if (command.StartsWith("printagent "))
            {
                int   id    = Int32.Parse(command.Substring(11));
                Agent agent = new Agent("ByID", id);
                if (agent != null && agent.IsValid)
                {
                    g.Print("Name: {0}", agent.Name);
                    g.Print("Station: [{0}] {1}", agent.StationID, agent.Station);
                    g.Print("Division: [{0}] {1}", agent.DivisionID, agent.Division);
                    g.Print("StandingTo: {0}", agent.StandingTo);
                    g.Print("SolarSystemID: {0}", agent.Solarsystem.ID);
                    List <DialogString> responses = agent.GetDialogResponses();
                    int i = 0;
                    g.Print("{0} Dialog Responses:", responses.Count);
                    foreach (DialogString response in responses)
                    {
                        g.Print("    Response #{0}: {1}", i, response.Text);
                        i++;
                    }
                }
                else
                {
                    g.Print("Agent not found");
                }
            }
            else if (command == "printcargo")
            {
                List <Item> items = g.me.Ship.GetCargo();

                g.Print("Found {0} Items:", items.Count);
                int i = 0;
                foreach (Item item in items)
                {
                    g.Print("#{0} {1}", i, item.Name);
                    g.Print("    Category: [{0}] {1} ({2})", item.CategoryID, item.Category, item.CategoryType.ToString());
                    g.Print("    Description: {0}", item.Description);
                    g.Print("    Group: [{0}] {1}", item.GroupID, item.Group);
                    i++;
                }
            }
            else if (command == "printroids")
            {
                List <Entity> roids = g.eve.QueryEntities("CategoryID = 25");
                g.Print("Found {0} Asteroids:", roids.Count);
                int i = 0;
                foreach (Entity roid in roids)
                {
                    if (i >= 10)
                    {
                        break;
                    }
                    g.Print("#{0} {1}", i, roid.Name);
                    g.Print("    Distance: {0}", roid.Distance);
                    g.Print("    Type: [{0}] {1}", roid.TypeID, roid.Type);
                    g.Print("    Category: [{0}] {1} ({2})", roid.CategoryID, roid.Category, roid.CategoryType);
                    g.Print("    Location: {0},{1},{2}", roid.X, roid.Y, roid.Z);
                    g.Print("    IsActiveTarget: {0} IsLockedTarget: {1}", roid.IsActiveTarget ? "Yes" : "No", roid.IsLockedTarget ? "Yes" : "No");
                    i++;
                }
            }
            else if (command.StartsWith("warp "))
            {
                State state = new WarpState(command);
                TryToEnterState(state);
            }
            else if (command.Split(' ')[0] == "dock")
            {
                State state = new DockState(command);
                TryToEnterState(state);
            }
            else if (command.Split(' ')[0] == "goto")
            {
                State state = new GotoState(command);
                TryToEnterState(state);
            }
            else if (command.Split(' ')[0] == "domission")
            {
                State state = new MissionState(command);
                TryToEnterState(state);
            }
            else if (command.Split(' ')[0] == "dodropoff")
            {
                State state = new DoDropoffState(command);
                TryToEnterState(state);
            }
            else if (command.Split(' ')[0] == "mineloop")
            {
                State state = new MineLoopState(command);
                TryToEnterState(state);
            }
            else if (command == "unloadore")
            {
                State state = new UnloadOreState();
                TryToEnterState(state);
            }
            else if (command.StartsWith("travel "))
            {
                State state = new TravelToStationState(command);
                TryToEnterState(state);
            }
            else if (command == "runlasers")
            {
                TryToEnterState(new RunMiningLasersState());
            }
        }
Ejemplo n.º 5
0
 public IEveInvWindow GetInventoryWindow()
 {
     return(EVEWindow.GetInventoryWindow());
 }
Ejemplo n.º 6
0
 public EVEWindow GetWindowByCaption(string caption)
 {
     return(EVEWindow.GetWindowByCaption(caption));
 }
Ejemplo n.º 7
0
 public EVEWindow GetWindowByName(string name)
 {
     return(EVEWindow.GetWindowByName(name));
 }
Ejemplo n.º 8
0
 public EVEWindow GetWindowByItemId(Int64 itemId)
 {
     return(EVEWindow.GetWindowByItemId(itemId));
 }