Exemplo n.º 1
0
        protected override async Task <bool> RunAsync()
        {
            AtkAddonControl window = RaptureAtkUnitManager.GetWindowByName(_windowName);

            if (window == null)
            {
                PatternFinder patternFinder = new PatternFinder(Core.Memory);
                IntPtr        agentVtable   = patternFinder.Find(_agentOffset);
                int           agentId       = AgentModule.FindAgentIdByVtable(agentVtable);

                AgentModule.GetAgentInterfaceById(agentId).Toggle();
                await Coroutine.Wait(5000, () => RaptureAtkUnitManager.GetWindowByName(_windowName) != null);

                window = RaptureAtkUnitManager.GetWindowByName(_windowName);
            }

            if (window != null)
            {
                // Choose Dungeon
                window.SendAction(2, 3, 15, 4, (ulong)Dungeon - 1);
                await Coroutine.Sleep(250);

                // Register for Duty
                window.SendAction(1, 3, 14);
            }

            return(false);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Sends a reset command to a window
        /// </summary>
        internal static async Task ClickReset(uint number)
        {
            if (number >= 2)
            {
                throw new ArgumentOutOfRangeException();
            }

            if (IsOpen && !SD.Reset)
            {
                await Close();
            }

            if (DeepDungeonMenu.IsOpen)
            {
                await DeepDungeonMenu.OpenResetMenu();
            }

            Logger.Info("Clicking Reset slot {0} // {1}", number + 1, SD.Reset);
            await Coroutine.Wait(5000, () => IsOpen);

            AtkAddonControl window = RaptureAtkUnitManager.GetWindowByName(WindowNames.DDsave);

            window.SendAction(2, 3, number, 3, 2);
            await Coroutine.Wait(500, () => SelectYesno.IsOpen);

            await Coroutine.Sleep(500);

            //confirm that we want to delete this data.
            if (SelectYesno.IsOpen)
            {
                AtkAddonControl window1 = RaptureAtkUnitManager.GetWindowByName("SelectYesno");
                window1.SendAction(1, 0, 1);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///     clicks a save slot. number should be greater than 0
        /// </summary>
        /// <param name="number"></param>
        internal static async Task ClickSaveSlot(uint number)
        {
            if (number >= 2)
            {
                throw new ArgumentOutOfRangeException();
            }

            if (IsOpen && SD.Reset)
            {
                await Close();
            }

            if (DeepDungeonMenu.IsOpen)
            {
                await DeepDungeonMenu.OpenSaveMenu();
            }

            Logger.Info("Clicking Save slot {0} // {1}", number + 1, SD.Reset);


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

            AtkAddonControl window = RaptureAtkUnitManager.GetWindowByName(WindowNames.DDsave);

            window.SendAction(1, 3, number);

            await Coroutine.Yield();
        }
Exemplo n.º 5
0
        internal static async Task OpenResetMenu()
        {
            AtkAddonControl wind = RaptureAtkUnitManager.GetWindowByName(WindowNames.DDmenu);

            if (wind == null)
            {
                throw new Exception(
                          "Open Reset Menu Failed. POTD Menu is not open. (The bot will attempt to correct this issue)");
            }

            wind.SendAction(1, 3, 1);
            await Coroutine.Wait(3000, () => DeepDungeonSaveData.IsOpen);
        }
Exemplo n.º 6
0
        public static SendActionResult TrySendAction(this AtkAddonControl window, int pairCount, params uint[] param)
        {
            if (window == null || !window.IsValid)
            {
                return(SendActionResult.InvalidWindow);
            }

            try
            {
                window.SendAction(pairCount, param);
                return(SendActionResult.Success);
            }
            catch (Exception ex)
            {
                Logger.Instance.Error(ex.Message);
                return(SendActionResult.InjectionError);
            }
        }
Exemplo n.º 7
0
        internal static async Task OpenSaveMenu()
        {
            AtkAddonControl menu = RaptureAtkUnitManager.GetWindowByName(WindowNames.DDmenu);

            if (menu == null)
            {
                return;
            }

            try
            {
                menu.SendAction(1, 3, 0);
                await Coroutine.Wait(3000, () => DeepDungeonSaveData.IsOpen);
            }
            catch (Exception ex)
            {
                Logger.Verbose("{0}", ex);
            }
        }
Exemplo n.º 8
0
        private async Task <bool> Reduction()
        {
            //Reduce
            if (ReduceSettings.Instance.AEZoneCheck && ReduceSettings.Instance.AEZone != 0)
            {
                if (WorldManager.ZoneId != (ushort)ReduceSettings.Instance.AEZone)
                {
                    return(false);
                }
                await Coroutine.Sleep(5000);
            }

            await GeneralFunctions.StopBusy(false, true, true);

            while (InventoryManager.FilledSlots.Any(x => inventoryBagIds.Contains(x.BagId) && x.IsReducable)) //&& WorldManager.ZoneId == (ushort) ReduceSettings.Instance.AEZone )
            {
                var item = InventoryManager.FilledSlots.FirstOrDefault(x => inventoryBagIds.Contains(x.BagId) && x.IsReducable);

                if (item == null)
                {
                    break;
                }
                Log($"Reducing - Name: {item.Item.CurrentLocaleName}");
                item.Reduce();
                await Coroutine.Wait(20000, () => Core.Memory.Read <uint>(Offsets.Conditions + Offsets.DesynthLock) != 0);

                await Coroutine.Wait(20000, () => Core.Memory.Read <uint>(Offsets.Conditions + Offsets.DesynthLock) == 0);
            }

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

            if (windowByName != null)
            {
                windowByName.SendAction(1, 3uL, 4294967295uL);
            }

            return(true);
        }