internal void Open()
 {
     if (!IsOpen)
     {
         AgentModule.ToggleAgentInterfaceById(Agent);
     }
 }
Exemple #2
0
        protected async Task <bool> InitiateLeve()
        {
            // if (Core.Player.IsMounted)
            // {
            // ActionManager.Dismount();
            // await Coroutine.Wait(20000, () => !Core.Player.IsMounted);
            // await Coroutine.Sleep(500);
            // }
            var    patternFinder = new GreyMagic.PatternFinder(Core.Memory);
            IntPtr SearchResult  = patternFinder.Find("48 8D 05 ? ? ? ? 48 89 54 24 ? 48 89 03 Add 3 TraceRelative");
            int    agent         = AgentModule.FindAgentIdByVtable(SearchResult);

            AgentModule.ToggleAgentInterfaceById(agent);
            await Coroutine.Sleep(500);

            AtkAddonControl windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail");

            while (windowByName == null)
            {
                await Coroutine.Sleep(500);

                windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail");
            }
            if (windowByName != null)
            {
                var leves = LeveManager.Leves;
                if (leves.Length > 0)
                {
                    foreach (ff14bot.Managers.LeveWork leve in leves)
                    {
                        if (leve.GlobalId == LeveId && leve.Step == 1)
                        {
                            ulong globalId = (ulong)leve.GlobalId;
                            windowByName.SendAction(3, 3, 0xC, 3, globalId, 3, 2);                       //Set Quest
                            await Coroutine.Sleep(200);

                            windowByName.SendAction(2, 3, 4, 4, globalId);                         //Initiate
                            if (await Coroutine.Wait(10000, () => SelectYesno.IsOpen))
                            {
                                SelectYesno.ClickYes();
                            }
                            await Coroutine.Sleep(2000);

                            RaptureAtkUnitManager.GetWindowByName("GuildLeveDifficulty").SendAction(1, 3, 0);
                            await Coroutine.Sleep(3000);

                            break;
                        }
                    }
                }
                windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail");
                if (windowByName != null)
                {
                    AgentModule.ToggleAgentInterfaceById(agent);
                }
            }

            return(_done = true);
        }
Exemple #3
0
        public async Task <bool> Open()
        {
            if (IsOpen)
            {
                return(true);
            }

            AgentModule.ToggleAgentInterfaceById(_agentId);
            await Coroutine.Wait(5000, () => IsOpen);

            return(IsOpen);
        }
Exemple #4
0
        public async Task <bool> PrintMasterPieceList()
        {
            Dictionary <ff14bot.Enums.ClassJobType, int> Classes = new Dictionary <ClassJobType, int>
            {
                { ClassJobType.Carpenter, 0 },
                { ClassJobType.Blacksmith, 1 },
                { ClassJobType.Armorer, 2 },
                { ClassJobType.Goldsmith, 3 },
                { ClassJobType.Leatherworker, 4 },
                { ClassJobType.Weaver, 5 },
                { ClassJobType.Alchemist, 6 },
                { ClassJobType.Culinarian, 7 },
                { ClassJobType.Miner, 8 },
                { ClassJobType.Botanist, 9 },
                { ClassJobType.Fisher, 10 },
            };

            if (!MasterPieceSupply.Instance.IsOpen)
            {
                Logging.Write($"Trying to open window");

                AgentModule.ToggleAgentInterfaceById(95);
                await Coroutine.Wait(5000, () => RaptureAtkUnitManager.GetWindowByName("ContentsInfo") != null);

                await Coroutine.Sleep(500);

                if (RaptureAtkUnitManager.GetWindowByName("ContentsInfo") == null)
                {
                    Logging.Write($"Nope failed opening timer window");
                    return(false);
                }

                await Coroutine.Sleep(500);

                RaptureAtkUnitManager.GetWindowByName("ContentsInfo").SendAction(2, 3, 0xC, 3, 6);
                await Coroutine.Wait(5000, () => MasterPieceSupply.Instance.IsOpen);

                await Coroutine.Sleep(500);
            }

            if (!MasterPieceSupply.Instance.IsOpen)
            {
                Logging.Write($"Nope failed");
                return(false);
            }

            foreach (var job in Classes)
            {
                Logging.Write($"{job.Key}:");

                MasterPieceSupply.Instance.ClassSelected = job.Value;
                await Coroutine.Sleep(1000);

                //Can also use MasterPieceSupply.GetTurninItems() if you don't wanted starred info
                foreach (var item in MasterPieceSupply.Instance.GetTurninItemsStarred())
                {
                    Logging.Write($"{item.Key} Starred: {item.Value}");
                }
            }

            MasterPieceSupply.Instance.Close();

            return(true);
        }
Exemple #5
0
        private async Task <bool> Run()
        {
            switch (Core.Me.Icon)
            {
            case PlayerIcon.Recruiting_Party_Members:
                await Coroutine.Sleep(1000);

                break;

            case PlayerIcon.Trial_Adventurer:
            case PlayerIcon.New_Adventurer:
            case PlayerIcon.None:
            {
                if (PfWindow == null)
                {
                    AgentModule.ToggleAgentInterfaceById(AgentId);
                    await Coroutine.Wait(5000, () => PfWindow != null);

                    if (PfWindow != null)
                    {
                        PfWindow.SendAction(1, 3, 0xE);
                        await Coroutine.Wait(5000, () => PfConditionWindow != null);

                        if (PfConditionWindow != null)
                        {
                            var elements = ___Elements(PfConditionWindow);
                            var data     = Core.Memory.ReadString((IntPtr)elements[187].Data, Encoding.UTF8);
                            if (data != "")
                            {
                                PfConditionWindow.SendAction(1, 3, 0x0);
                                Log("Registering PF");
                                await Coroutine.Sleep(2000);

                                await Coroutine.Wait(5000, () => PfConditionWindow == null);

                                if (PfWindow != null)
                                {
                                    Log("Closing PF window");
                                    PfWindow.SendAction(1, 3, uint.MaxValue);
                                }
                            }
                            else
                            {
                                Log("No Comment Setup. Quiting");
                                TreeRoot.Stop("No Comment Setup");
                            }
                        }
                        else
                        {
                            Log("Condition window didn't open");
                            TreeRoot.Stop("Shit Happens");
                        }
                    }
                    else
                    {
                        Log("PF window didn't open");
                        TreeRoot.Stop("Shit Happens");
                    }
                }

                break;
            }
            }

            return(true);
        }
Exemple #6
0
 public void ToggleInstance()
 {
     AgentModule.ToggleAgentInterfaceById(Id);
 }