Пример #1
0
        internal static async Task <BuyItemResult> BuyItem(uint itemId, uint itemAmount)
        {
            if (!Shop.Open)
            {
                return(BuyItemResult.ShopNotOpen);
            }

            if (!Shop.Items.Any(item => item.ItemId == itemId))
            {
                return(BuyItemResult.ItemNotFound);
            }

            if (itemAmount > 99)
            {
                return(BuyItemResult.TooManyItemsRequested);
            }

            await Coroutine.Sleep(TimeSpan.FromMilliseconds(MainSettings.Instance.ActionDelay));

            Shop.Purchase(itemId, itemAmount);
            await Coroutine.Sleep(TimeSpan.FromMilliseconds(MainSettings.Instance.ActionDelay));

            SelectYesno.ClickYes();
            await Coroutine.Sleep(TimeSpan.FromMilliseconds(MainSettings.Instance.ActionDelay));

            Shop.Close();

            return(GetItemAmount(itemId) >= itemAmount ? BuyItemResult.Success : BuyItemResult.Failure);
        }
Пример #2
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => QuestId == 65997 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 66182 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 66856 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(1);
     })
                              ),
                new Decorator(ret => QuestId == 67019 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 67238 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 68271 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 68299 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 68407 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 68487 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                base.CreateBehavior()
                ));
 }
Пример #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);

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

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

            //confirm that we want to delete this data.
            if (SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
            }
        }
Пример #4
0
        /// <inheritdoc/>
        public override async Task <bool> Run()
        {
            // Open and accept revive notification
            if (NotificationRevive.IsOpen)
            {
                Logger.LogInformation(Translations.LOG_REVIVE_OPENED);
                NotificationRevive.Click();

                await Coroutine.Wait(250, () => SelectYesno.IsOpen);

                if (SelectYesno.IsOpen)
                {
                    Logger.LogInformation(Translations.LOG_REVIVE_ACCEPTED);
                    SelectYesno.ClickYes();
                }

                return(HANDLED_EXECUTION);
            }

            // No opportunity to revive yet?
            if (Core.Player.IsDead || Core.Player.IsDying)
            {
                StatusBar.Text = Translations.STATUS_DEAD_WAITING;
                await Coroutine.Sleep(250);

                return(HANDLED_EXECUTION);
            }

            return(PASS_EXECUTION);
        }
Пример #5
0
        private async Task RunEquip()
        {
            if (_isDone)
            {
                await Coroutine.Yield();

                return;
            }

            IEnumerable <GearSet> groupedGearSets = GearsetManager
                                                    .GearSets
                                                    .Where(g => g.InUse)
                                                    .OrderByDescending(GetGearSetiLvl)
                                                    .GroupBy(g => g.Class)
                                                    .Select(g => g.FirstOrDefault());

            await Coroutine.Sleep(4000);

            foreach (var gearSet in groupedGearSets)
            {
                GearsetManager.ChangeGearset(gearSet.Index);
                if (await Coroutine.Wait(1200, () => SelectYesno.IsOpen))
                {
                    SelectYesno.ClickYes();
                    await Coroutine.Sleep(800);
                }
                await InventoryEquipBest(useRecommendEquip : UseRecommendEquip);

                await Coroutine.Sleep(400);
            }

            _isDone = true;
        }
Пример #6
0
        protected override Composite CreateBehavior()
        {
            return(new PrioritySelector(
                       new Decorator(ret => Talk.DialogOpen, new Action(ret => Talk.Next())),
                       new Decorator(ret => SelectYesno.IsOpen, new Action(ret => SelectYesno.ClickYes())),
                       CommonBehaviors.HandleLoading,
                       new Decorator(ret => QuestLogManager.InCutscene, new ActionAlwaysSucceed()),
                       new Decorator(ret => DutyManager.InInstance && Core.Player.IsVisible,
                                     new PrioritySelector(
                                         //r=> GuardianNPC,
                                         //new Decorator(ret => !initialized,new Action(ret => init())),
                                         //
                                         //new Decorator(r => NeedToMove && ((r as BattleCharacter) == null || !(r as BattleCharacter).IsValid || (r as BattleCharacter).Location.Distance2D(Core.Player.Location) <= 5), new Action(r => NeedToMove = false)),
                                         //new Decorator(r => NeedToMove, CommonBehaviors.MoveAndStop(r => (r as BattleCharacter).Location, 5f, true, "Moving back into guardian npc range")),
                                         //new Decorator(r => (r as BattleCharacter) != null && ((r as BattleCharacter).Location.DistanceSqr(Core.Player.Location) > LeashSquared), new ActionAlwaysFail()),

                                         new ActionRunCoroutine(r => DoControlLogic()),
                                         new Decorator(r => CombatTargeting.Instance.FirstUnit == null, new HookExecutor("HotspotPoi")),
                                         new HookExecutor("SetCombatPoi"),
                                         new ActionAlwaysSucceed()
                                         )
                                     ),
                       new Decorator(r => Chocobo.Summoned, new ActionRunCoroutine(r => Chocobo.DismissChocobo())),
                       CommonBehaviors.MoveAndStop(r => XYZ, InteractDistance, true),
                       CreateUseObject(),
                       new ActionAlwaysSucceed()
                       ));
        }
Пример #7
0
        public async Task <bool> PurchaseItem(uint index, uint qty, byte attempts, ushort interval = 200)
        {
            var result           = SendActionResult.None;
            var purchaseAttempts = 0;

            while (result != SendActionResult.Success && !SelectYesno.IsOpen && purchaseAttempts++ < attempts &&
                   Behaviors.ShouldContinue)
            {
                // result = PurchaseItem(index);
                result = PurchaseItem(index, qty);

                await Behaviors.Wait(interval, () => SelectYesno.IsOpen);
            }

            if (purchaseAttempts > attempts)
            {
                return(false);
            }

            // Wait an extra second in case interval is really short.
            await Coroutine.Wait(1000, () => SelectYesno.IsOpen);

            purchaseAttempts = 0;
            while (SelectYesno.IsOpen && purchaseAttempts++ < attempts && Behaviors.ShouldContinue)
            {
                SelectYesno.ClickYes();

                await Behaviors.Wait(interval, () => !SelectYesno.IsOpen);
            }

            return(!SelectYesno.IsOpen);
        }
Пример #8
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => SelectString.IsOpen,
                              new Action(r =>
     {
         if (selectStringIndex.Count > 0)
         {
             SelectString.ClickSlot((uint)selectStringIndex.Dequeue());
         }
         else
         {
             SelectString.ClickSlot(0);
         }
     })
                              ),
                base.CreateBehavior()
                ));
 }
Пример #9
0
        private static SwitchArgument <RepairState> GetRepairStep(RepairContext context)
        {
            var closeAction = new Action(r =>
            {
                Repair.Close();
                context.State = BotManager.Current.Name != "Fate Bot"
                    ? RepairState.MovingBack : RepairState.None;

                Logger.AgilMessage("Ended repair step, now on: {0}", context.State);
            });

            var close = new Decorator(req => Equipment.GetCondition() >= context.MinimumDurability && Repair.IsOpen,
                                      closeAction);

            var dismount = new Decorator(req => Core.Me.IsMounted,
                                         new Action(r => Actionmanager.Dismount()));

            var selectYes = new Decorator(req => SelectYesno.IsOpen,
                                          new Action(r => SelectYesno.ClickYes()));

            var move         = Movement.SprintMove(r => context.Location);
            var repairAll    = new RepairAll();
            var selectRepair = new SetIconString(2);
            var setTarget    = new SetTarget(() => context.NpcId);

            var interact = new Decorator(req => !Repair.IsOpen && !SelectIconString.IsOpen && !SelectYesno.IsOpen,
                                         new Interact());

            var repairStep = new PrioritySelector(move, dismount, close, selectYes, repairAll, selectRepair,
                                                  setTarget, interact, new Action(r => RunStatus.Success));

            return(new SwitchArgument <RepairState>(repairStep, RepairState.Repairing));
        }
Пример #10
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                CommonBehaviors.HandleLoading,
                new Decorator(ret => QuestId == 65888 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 65889 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67137 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 68612 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                base.CreateBehavior()
                ));
 }
Пример #11
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => !doneEmote && !string.IsNullOrWhiteSpace(Emote),
                              new Action(r =>
     {
         GameObjectManager.GetObjectByNPCId((uint)NpcId).Target();
         ChatManager.SendChat("/" + Emote);
         doneEmote = true;
     })
                              ),
                new Decorator(ret => SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot((uint)DialogOption);
     })
                              ),
                base.CreateBehavior()
                ));
 }
Пример #12
0
        public async Task <bool> AetherialFlowHandler(GameObject context)
        {
            if (ScriptHelper.InCombat())
            {
                return(false);
            }
            if (SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
                return(true);
            }
            while (!Navigator.InPosition(context.Location, Core.Me.Location, 3f) && ScriptHelper.IsTodoChecked(0))
            {
                Navigator.PlayerMover.MoveTowards(context.Location);
                MovementManager.Jump();
                return(true);
            }
            if (ScriptHelper.IsTodoChecked(0))
            {
                if (MovementManager.IsMoving)
                {
                    await CommonTasks.StopMoving();

                    return(true);
                }
            }
            return(await ScriptHelper.ObjectInteraction(context));

            return(false);
        }
Пример #13
0
        /// <summary>
        /// Repairs current gearset via self-repair.
        /// </summary>
        private async Task DoSelfRepair()
        {
            Logger.LogInformation(Translations.LOG_REPAIR_SELF);

            if (!HaveRepairMaterials(InventoryManager.EquippedItems.Where(s => s.IsFilled)))
            {
                // TODO: Buy dark matter from NPC, or fail if unable (can't travel, dungeon, low gil, etc)
            }

            if (!Repair.IsOpen)
            {
                ActionManager.ToggleRepairWindow();
                await Coroutine.Sleep(250);
            }

            // Only clicks the button, Yes/No is separate
            Repair.RepairAll();

            await Coroutine.Wait(1000, () => SelectYesno.IsOpen);

            SelectYesno.ClickYes();

            await Coroutine.Sleep(2500);

            Repair.Close();
        }
Пример #14
0
        public static async Task <bool> SelectYesNo(bool choice = true)
        {
            int ticks = 0;

            while (SelectYesno.IsOpen && ticks < 20)
            {
                if (choice)
                {
                    SelectYesno.ClickYes();
                }
                else
                {
                    SelectYesno.ClickNo();
                }
                await Coroutine.Sleep(500);

                ticks++;
            }

            if (ticks < 20)
            {
                return(true);
            }

            return(false);
        }
Пример #15
0
        public async Task <bool> Run()
        {
            if (WorldManager.ZoneId != 570)
            {
                return(false);
            }
            TreeRoot.StatusText = "Lobby Room";
            if (_target == null || !_target.IsValid)
            {
                Logger.Warn($"Unable to find Lobby Target");
                return(false);
            }
            if (!Navigator.InPosition(_target.Location, Core.Me.Location, 3))
            {
                if (!await CommonTasks.MoveAndStop(new MoveToParameters(_target.Location, "Moving to Lobby Exit"), 3))
                {
                    Logger.Warn("Failed to move toward the exit?");
                }
                return(true);
            }
            _target.Interact();
            await Coroutine.Wait(250, () => SelectYesno.IsOpen);

            SelectYesno.ClickYes();
            return(true);
        }
Пример #16
0
        public async Task <bool> Run()
        {
            if (RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult") != null)
            {
                GameStatsManager.Died();
                Logger.Warn($"We have died...");
                RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult").SendAction(1, 3, uint.MaxValue);
                await Coroutine.Sleep(250);

                return(true);
            }
            if (NotificationRevive.IsOpen)
            {
                NotificationRevive.Click();
                await Coroutine.Wait(250, () => SelectYesno.IsOpen);

                SelectYesno.ClickYes();
                return(true);
            }
            if (ClientGameUiRevive.ReviveState == ReviveState.Dead && SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
                return(true);
            }
            if (Core.Me.IsDead)
            {
                TreeRoot.StatusText = "I am dead. No window to use...";
                await Coroutine.Sleep(250);

                return(true);
            }
            return(false);
        }
Пример #17
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);
        }
Пример #18
0
        private async Task <bool> BuyItems()
        {
            var currentItems = Shop.Items;

            dialogwasopen = true;
            foreach (var itemid in ItemIds)
            {
                uint totalPurchased = 0;
                int  loop           = 1;
                var  amountwanted   = itemcountQueue.Dequeue();
                if (currentItems.Any(r => r.ItemId == itemid))
                {
                    var currentItem = currentItems.First(r => r.ItemId == itemid);

Purhcase:
                    var purchased = Shop.Purchase((uint)itemid, (uint)amountwanted);

                    await Coroutine.Wait(2000, () => SelectYesno.IsOpen);

                    if (!SelectYesno.IsOpen)
                    {
                        goto Purhcase;
                    }

                    await Coroutine.Sleep(500);

                    if (purchased != amountwanted)
                    {
                        Log("Purchasing {0} {1} from {2} for {3} gil ({4})", purchased, currentItem.product_name, vendorName, purchased * currentItem.Cost, loop);
                    }
                    else
                    {
                        Log(@"Purchasing {0} {1} from {2} for {3} gil", purchased, currentItem.product_name, vendorName, purchased * currentItem.Cost);
                    }

                    SelectYesno.ClickYes();
                    await Coroutine.Sleep(500);

                    totalPurchased += purchased;

                    if (totalPurchased < amountwanted)
                    {
                        loop++;
                        goto Purhcase;
                    }
                }
                else
                {
                    LogError(" {0} does not have itemid:{1}", vendorName, itemid);
                }
            }
            await Coroutine.Sleep(500);

            Shop.Close();
            await Coroutine.Sleep(500);

            return(true);
        }
Пример #19
0
        public async Task <bool> BuyItem(uint itemId)
        {
            if (!ShopExchangeCurrency.Open && VendorNpc == null)
            {
                await GetToVendorNpc();
            }

            if (!ShopExchangeCurrency.Open && VendorNpc.Location.Distance(Core.Me.Location) > 6f)
            {
                var _target = VendorNpc.Location;
                Navigator.PlayerMover.MoveTowards(_target);
                while (_target.Distance2D(Core.Me.Location) >= 6)
                {
                    Navigator.PlayerMover.MoveTowards(_target);
                    await Coroutine.Sleep(100);
                }

                Navigator.PlayerMover.MoveStop();
                await Coroutine.Sleep(1000);
            }

            if (!ShopExchangeCurrency.Open)
            {
                VendorNpc.Interact();
                await Coroutine.Wait(5000, () => ShopExchangeCurrency.Open || Talk.DialogOpen);
            }

            if (ShopExchangeCurrency.Open)
            {
                var items           = SpecialShopManager.Items;
                var specialShopItem = items?.Cast <SpecialShopItem?>().FirstOrDefault(i => i.HasValue && i.Value.ItemIds.Contains(itemId));

                if (!specialShopItem.HasValue)
                {
                    return(false);
                }

                var count = CanAffordScrip(specialShopItem.Value);

                if (count > 0)
                {
                    Purchase(itemId, count);
                }

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

                SelectYesno.ClickYes();

                await Coroutine.Sleep(1000);

                ShopExchangeCurrency.Close();

                return(true);
            }

            return(false);
        }
Пример #20
0
        private async Task BuyScrip(int itemId, int count, int selectString)
        {
            await Coroutine.Sleep(500);



            var unit = GameObjectManager.GetObjectsByNPCIds <Character>(npcIds).OrderBy(r => r.Distance()).FirstOrDefault();

            if (unit == null)
            {
                _isDone = true;
                return;
            }

            if (!ShopExchangeCurrency.Open && unit.Location.Distance(Core.Me.Location) > 4f)
            {
                await Navigation.OffMeshMove(unit.Location);

                await Coroutine.Sleep(500);
            }

            unit.Interact();

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

            if (SelectIconString.IsOpen)
            {
                SelectIconString.ClickSlot((uint)0);

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

                SelectString.ClickSlot((uint)selectString);

                await Coroutine.Wait(5000, () => ShopExchangeCurrency.Open);

                if (ShopExchangeCurrency.Open)
                {
                    ShopExchangeCurrency.Purchase((uint)itemId, (uint)count);

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

                    SelectYesno.ClickYes();

                    await Coroutine.Sleep(1000);

                    ShopExchangeCurrency.Close();

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

                    SelectString.ClickSlot((uint)(SelectString.LineCount - 1));

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

            _isDone = true;
        }
Пример #21
0
        public async Task <bool> BuyItem(uint itemId, int SelectStringLine = 0)
        {
            if ((!ShopExchangeCurrency.Open && VendorNpc == null) || VendorNpc.Location.Distance(Core.Me.Location) > 5f)
            {
                await Navigation.GetTo(886, new Vector3(36.33978f, -16f, 145.3877f));
            }

            if (!ShopExchangeCurrency.Open && VendorNpc.Location.Distance(Core.Me.Location) > 4f)
            {
                await Navigation.OffMeshMove(VendorNpc.Location);

                await Coroutine.Sleep(500);
            }

            if (!ShopExchangeCurrency.Open)
            {
                VendorNpc.Interact();
                await Coroutine.Wait(5000, () => ShopExchangeCurrency.Open || Talk.DialogOpen || Conversation.IsOpen);

                if (Conversation.IsOpen)
                {
                    Conversation.SelectLine((uint)SelectStringLine);
                    await Coroutine.Wait(5000, () => ShopExchangeCurrency.Open);
                }
            }

            if (ShopExchangeCurrency.Open)
            {
                var items           = SpecialShopManager.Items;
                var specialShopItem = items?.Cast <SpecialShopItem?>().FirstOrDefault(i => i.HasValue && i.Value.ItemIds.Contains(itemId));

                if (!specialShopItem.HasValue)
                {
                    return(false);
                }

                var count = CanAffordScrip(specialShopItem.Value);

                if (count > 0)
                {
                    Purchase(itemId, count);
                }

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

                SelectYesno.ClickYes();

                await Coroutine.Sleep(1000);

                ShopExchangeCurrency.Close();

                return(true);
            }

            return(false);
        }
Пример #22
0
 protected Composite Behavior()
 {
     return(new PrioritySelector(
                // can tag execute?
                new Decorator(ret => !CanRepair(),
                              new Action(r =>
     {
         _done = true;
     })
                              ),
                new Decorator(ret => CanRepair(),
                              new PrioritySelector(
                                  new Decorator(ret => CanRepair() && !Repair.IsOpen,
                                                new Action(r =>
     {
         if (Void == true)
         {
             OpenRepair();
         }
         else
         {
             ActionManager.ToggleRepairWindow();
         }
     })
                                                )
                                  )
                              ),
                // repair
                new Decorator(ret => Repair.IsOpen,
                              new PrioritySelector(
                                  new Decorator(ret => Repaired,
                                                new Action(r =>
     {
         Repair.Close();
         _done = true;
     })
                                                ),
                                  new Decorator(ret => Repair.IsOpen && !RepairAllClicked,
                                                new Action(r =>
     {
         RepairAllClicked = true;
         Repair.RepairAll();
     })
                                                ),
                                  new Decorator(ret => SelectYesno.IsOpen,
                                                new Action(r =>
     {
         SelectYesno.ClickYes();
         Repaired = true;
     })
                                                )
                                  ))
                ));
 }
 public async Task <bool> DragonkillerHandler2(GameObject context)
 {
     // if (ScriptHelper.InCombat())
     // return false;
     if (SelectYesno.IsOpen)
     {
         SelectYesno.ClickYes();
         return(true);
     }
     return(await ScriptHelper.ObjectInteraction(context));
 }
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => QuestId == 65715 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 65789 && SelectYesno.IsOpen,
                              new Action(r =>
     {
         SelectYesno.ClickYes();
     })
                              ),
                new Decorator(ret => QuestId == 66046 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67023 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67201 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67254 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67591 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                new Decorator(ret => QuestId == 67670 && SelectString.IsOpen,
                              new Action(r =>
     {
         SelectString.ClickSlot(0);
     })
                              ),
                base.CreateBehavior()
                ));
 }
Пример #25
0
        internal static async Task <bool> Main(uint aetheryteId)
        {
            Logger.SendLog("Binding to the aetheryte crystal.");
            var aetheryteObject = GetAetheryteObject(aetheryteId);

            if (aetheryteObject == null)
            {
                Logger.SendErrorLog("Could not find an aetheryte crystal.");
                return(false);
            }

            if (!WorldManager.CanFly)
            {
                var movementParams = new MoveToParameters
                {
                    Destination       = "Aetheryte crystal",
                    Location          = aetheryteObject.Location,
                    DistanceTolerance = 8f
                };

                while (aetheryteObject.Distance(Core.Player) > 8f)
                {
                    Navigator.MoveTo(movementParams);
                    await Coroutine.Yield();
                }

                Navigator.Stop();
            }
            else
            {
                while (aetheryteObject.Distance(Core.Player) > 8f)
                {
                    Core.Player.Face(aetheryteObject);
                    Navigator.PlayerMover.MoveTowards(aetheryteObject.Location);
                    await Coroutine.Yield();
                }

                Navigator.PlayerMover.MoveStop();
            }

            aetheryteObject.Interact();
            await Coroutine.Sleep(MainSettings.Instance.ActionDelay);

            SelectString.ClickLineContains("Set Home Point");
            await Coroutine.Sleep(MainSettings.Instance.ActionDelay);

            SelectYesno.ClickYes();
            await Coroutine.Sleep(MainSettings.Instance.ActionDelay);

            Logger.SendLog("Home point bound successfully.");

            return(true);
        }
Пример #26
0
 public async Task <bool> GeomanticAetheryteHandler2(GameObject context)
 {
     if (ScriptHelper.InCombat())
     {
         return(false);
     }
     if (SelectYesno.IsOpen)
     {
         SelectYesno.ClickYes();
         return(true);
     }
     return(await ScriptHelper.ObjectInteraction(context));
 }
Пример #27
0
 public async Task <bool> CoralFormationHandler(GameObject context)
 {
     if (ScriptHelper.InCombat())
     {
         return(false);
     }
     if (SelectYesno.IsOpen)
     {
         SelectYesno.ClickYes();
         return(true);
     }
     return(await ScriptHelper.ObjectInteraction(context));
 }
Пример #28
0
        private async Task <bool> CloseYesNo()
        {
            await Coroutine.Wait(1000, () => SelectYesno.IsOpen);

            if (SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
            }

            await Coroutine.Wait(1000, () => !SelectYesno.IsOpen);

            return(!SelectYesno.IsOpen);
        }
 public async Task <bool> MarkXLIIIAntiaircraftCannonHandler(GameObject context)
 {
     if (ScriptHelper.InCombat())
     {
         return(false);
     }
     if (SelectYesno.IsOpen)
     {
         SelectYesno.ClickYes();
         return(true);
     }
     return(await ScriptHelper.ObjectInteraction(context));
 }
Пример #30
0
        public async Task <bool> Run()
        {
            if (WorldManager.ZoneId != Constants.SelectedDungeon.LobbyId)
            {
                return(false);
            }

            await Coroutine.Sleep(5000);

            _target = GameObjectManager.GameObjects.Where(r => r.NpcId == EntityNames.LobbyExit).OrderBy(r => r.Distance()).FirstOrDefault();

            Navigator.Stop();
            Navigator.Clear();

            TreeRoot.StatusText = "Lobby Room";

            if (_target == null || !_target.IsValid)
            {
                Logger.Warn("Unable to find Lobby Target");
                return(false);
            }

            // move closer plz
            if (_target.Location.Distance2D(Core.Me.Location) >= 4.4)
            {
                Logger.Verbose("target range " + _target.Location.Distance2D(Core.Me.Location));

                Navigator.Stop();
                Navigator.PlayerMover.MoveStop();

                Navigator.PlayerMover.MoveTowards(_target.Location);
                while (_target.Location.Distance2D(Core.Me.Location) >= 4.4)
                {
                    Logger.Verbose("Moving towards " + _target.Location);
                    Navigator.PlayerMover.MoveTowards(_target.Location);
                    await Coroutine.Sleep(100);
                }

                //await Buddy.Coroutines.Coroutine.Sleep(1500); // (again, probably better to just wait until distance to destination is < 2.0f or something)
                Navigator.PlayerMover.MoveStop();
            }

            _target.Interact();
            await Coroutine.Wait(500, () => SelectYesno.IsOpen);

            await Coroutine.Sleep(1000);

            SelectYesno.ClickYes();
            DeepTracker.EndRun(false);
            return(true);
        }