示例#1
0
        private async Task <bool> CreateGrindArea()
        {
            if (NeoProfileManager.CurrentGrindArea == null)
            {
                if (Delay > 0)
                {
                    // start time irregularity, sleep for a second for the fatedata to populate
                    await Coroutine.Sleep(1000);

                    await WaitDelay();
                }

                Log($"Creating GrindArea for {ThisFate.Name}.");

                GetBoss();

                hotSpots.Add(new HotSpot(ThisFate.Location, ThisFate.Radius));

                FateGrindArea = new GrindArea()
                {
                    Hotspots = hotSpots.ToList(),

                    TargetMobs = GameObjectManager.GetObjectsOfType <BattleCharacter>(true, false).Where(obj => obj.FateId == ThisFate.Id).Select(r => (int)r.NpcId).Distinct().Select(x => new TargetMob()
                    {
                        Id = x
                    }).ToList(),

                    Name = ThisFate.Name.ToString()
                };

                if (ThisFate.Icon == FateIconType.Boss && HiddenBossFates.Contains(ThisFate.Id))
                {
                    Log("Fate contains a hidden Boss. Adding NpcId {1} as a TargetMob.", ThisFate.Name, BossId);

                    FateGrindArea.TargetMobs.Add(new TargetMob()
                    {
                        Id = BossId, Weight = 1
                    });
                }

                NeoProfileManager.CurrentGrindArea = FateGrindArea;

                // Debug
                foreach (var mob in FateGrindArea.TargetMobs)
                {
                    Log("Added NpcId {0} with Weight {1} to the GrindArea.", mob.Id, mob.Weight);
                }

                NeoProfileManager.CurrentProfile.KillRadius = 80f;

                NeoProfileManager.UpdateGrindArea();
            }

            return(false);
        }
示例#2
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => TreeRoot.IsRunning,
                              new Action(r =>
     {
         NeoProfileManager.Load(NewProfilePath, true);
         NeoProfileManager.UpdateCurrentProfileBehavior();
         _done = true;
     })
                              )
                ));
 }
示例#3
0
 private void CreateHotSpot()
 {
     if (Hotspots.Count == 0)
     {
         Hotspots.Add(new HotSpot(XYZ, Radius));
         Hotspots.IsCyclic = true;
         Hotspots.Index    = 0;
         NeoProfileManager.UpdateCurrentProfileBehavior();
     }
     else
     {
         return;
     }
 }
示例#4
0
文件: Trust.cs 项目: TheManta/RBtrust
        private static async Task <bool> PlayerCheck()
        {
            if (Core.Me.CurrentHealthPercent <= 0)
            {
#if RB_CN
                Logging.Write(Colors.Aquamarine, $"检测到死亡");
#else
                Logging.Write(Colors.Aquamarine, $"Player has died.");
#endif
                await Coroutine.Sleep(10000);

                NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                NeoProfileManager.UpdateCurrentProfileBehavior();
                await Coroutine.Sleep(5000);

                return(true);
            }

            return(false);
        }
示例#5
0
        private void CreateGrindArea()
        {
            if (Hotspots.Count == 0)
            {
                Hotspots.Add(new HotSpot(XYZ, Radius));
                Hotspots.IsCyclic = false;
                Hotspots.Index    = 0;
            }

            var grindArea = new GrindArea()
            {
                TargetMobs = NpcIds.Select(r => new TargetMob()
                {
                    Id = r
                }).ToList(),
                Hotspots = Hotspots.ToList(),
                Name     = QuestName
            };

            NeoProfileManager.CurrentGrindArea = grindArea;
            NeoProfileManager.UpdateGrindArea();
        }
示例#6
0
        private static async Task <bool> RunTrust()
        {
            //吃食物
            if (!Core.Player.HasAura(_buff))
            {
                await EatFood();
            }

            var mapId = WorldManager.ZoneId;

            switch (mapId)
            {
            case 837:     //71本 水滩村
                return(await HolminsterSwitch.Run());

                break;

            case 821:     //73本 多恩美格禁园
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await DohnMheg.Run());

                break;

            case 823:     //75本 奇坦那神影洞
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await TheQitanaRavel.Run());

                break;

            case 836:     //77本 马利卡大井
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await MalikahWell.Run());

                break;

            case 822:     //79本 格鲁格火山
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await MtGulg.Run());

                break;

            case 838:     //80本 亚马乌罗提
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await Amaurot.Run());

                break;

            case 884:     //80本 国际服 5.1
                if (Core.Me.CurrentHealthPercent <= 0)
                {
                    Logging.Write(Colors.Aquamarine, $"检测到死亡");
                    await Coroutine.Sleep(10000);

                    NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                    NeoProfileManager.UpdateCurrentProfileBehavior();
                    await Coroutine.Sleep(5000);

                    return(true);
                }
                return(await TheGrandCosmos.Run());

                break;

            default:
                return(false);
            }
        }
        static async void mythread()
        {
            Logging.Write(Colors.Chocolate, "[LisbethOrderTag] Thread Started");

            var profile = NeoProfileManager.CurrentProfile.Path;

            var lastBot = BotManager.Current;

            BotManager.Current.Stop();
            await TreeRoot.StopGently();

            await WaitUntil(() => !TreeRoot.IsRunning, timeout : 20000);

            if (!TreeRoot.IsRunning)
            {
                Logging.Write(Colors.Chocolate, $"[LisbethOrderTag] Bot Stopped: {lastBot.Name} {profile}");

                var BotType = AppDomain.CurrentDomain.GetAssemblies().First(i => i.FullName.Contains("Lisbeth.Reborn")).DefinedTypes.First(i => i.Name == "LisbethBot");

                var method = BotType.GetMethod("Load", BindingFlags.Static | BindingFlags.NonPublic);

                if (method != null)
                {
                    method.Invoke(null, null);
                }

                Thread.Sleep(4000);

                BotManager.SetCurrent(BotManager.Bots.First(i => i.EnglishName.Contains("Lisbeth")));
                TreeRoot.Start();
            }
            else
            {
                Logging.Write(Colors.Chocolate, "[LisbethOrderTag] Failed Stopping bot");
            }

            await WaitUntil(() => TreeRoot.IsRunning, timeout : 20000);

            if (TreeRoot.IsRunning)
            {
                Logging.Write(Colors.Chocolate, "[LisbethOrderTag] Lisbeth Started");

                await WaitWhile(() => TreeRoot.IsRunning, 500);

                if (!TreeRoot.IsRunning)
                {
                    if (lastBot != null)
                    {
                        Logging.Write(Colors.Chocolate, $"[LisbethOrderTag] Restarting {lastBot.Name}");
                        BotManager.SetCurrent(lastBot);
                        Thread.Sleep(1000);
                        loaded   = false;
                        tempbool = false;
                        BotEvents.NeoProfile.OnNewProfileLoaded += OnNewProfileLoaded;
                        TreeRoot.OnStart += OnBotStart;
                        NeoProfileManager.Load(profile, true);
                        //NeoProfileManager.UpdateCurrentProfileBehavior();
                        await WaitUntil(() => loaded, timeout : 20000);

                        loaded = false;
                        BotManager.Current.Initialize();
                        BotManager.Current.Start();
                        TreeRoot.Start();
                        await WaitUntil(() => tempbool, timeout : 20000);

                        //NeoProfileManager.Load(profile, true);
                        //await WaitUntil( () => loaded, timeout: 20000);
                        //NeoProfileManager.UpdateCurrentProfileBehavior();
                        //loaded = false;
                    }
                    else
                    {
                        Logging.Write(Colors.Chocolate, $"[LisbethOrderTag] LastBot Null: Starting Orderbot");
                        BotManager.SetCurrent(new OrderBot());;
                        BotManager.Current.Start();
                    }
                }
            }
            else
            {
                Logging.Write(Colors.Chocolate, "[LisbethOrderTag] Failed To Start Lisbeth");
            }

            Logging.Write(Colors.Chocolate, "[LisbethOrderTag] Thread Stopped");

            //_isDone = true;
        }
示例#8
0
        private async Task <bool> RunDungeonAssist()
        {
            if (!Core.Me.InCombat && ActionManager.IsSprintReady && MovementManager.IsMoving)
            {
                ActionManager.Sprint();
                await Coroutine.Wait(1000, () => !ActionManager.IsSprintReady);
            }
            if (SelectYesno.IsOpen && Core.Me.CurrentHealthPercent > 0)
            {
                Logging.Write(Colors.Aquamarine, "Clicking Yes to Teleport to Battle");
                SelectYesno.ClickYes();
            }

            if (DutyManager.InInstance)                     // && Core.Me.CurrentHealthPercent <= 0)
            {
                if (DirectorManager.ActiveDirector != null) //director isn't null
                {
                    //Checks Duty State
                    var activeAsInstance = (ff14bot.Directors.InstanceContentDirector)DirectorManager.ActiveDirector;
                    if (activeAsInstance.InstanceEnded)                             //Duty ended
                    {
                        if (Core.Me.CurrentHealthPercent <= 0)
                        {
                            await Coroutine.Sleep(500);

                            //Checks Dead State and Revives
                            await Coroutine.Wait(3000, () => ClientGameUiRevive.ReviveState == ReviveState.Dead);

                            Logging.Write(Colors.Aquamarine, "No one is in combat, releasing...");
                            await Coroutine.Sleep(500);

                            if (ReviveRaid())
                            {
                                SelectYesno.ClickYes();
                            }
                            else if (ReviveDungeon())
                            {
                                ff14bot.RemoteWindows.NotificationRevive.Click();
                            }
                            else
                            {
                                ff14bot.RemoteWindows.SelectOk.ClickOk();
                            }
                            while (CommonBehaviors.IsLoading)
                            {
                                Logging.Write(Colors.Aquamarine, "Waiting for zoning to finish...");
                                await Coroutine.Wait(-1, () => (!CommonBehaviors.IsLoading));
                            }

                            while (!Core.Me.IsAlive)
                            {
                                Logging.Write(Colors.Aquamarine, "Zoning finsihed, waiting to become alive...");
                                await Coroutine.Wait(-1, () => (Core.Me.IsAlive));
                            }
                        }

                        //Testing Necessity of this aspect with orderbot with the revive)
                        Logging.Write(Colors.Aquamarine, "Instance Complete");
                        await Coroutine.Sleep(10000);

                        Logging.Write(Colors.Aquamarine, "Leaving Duty");
                        ff14bot.Managers.DutyManager.LeaveActiveDuty();
                        Logging.Write(Colors.Aquamarine, "Waiting for Zoning");
                        await Coroutine.Wait(22000, () => CommonBehaviors.IsLoading);

                        if (CommonBehaviors.IsLoading)
                        {
                            await Coroutine.Wait(-1, () => !CommonBehaviors.IsLoading);
                        }

                        Logging.Write(Colors.Aquamarine, "Reloading Profile");
                        NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path, true);
                        NeoProfileManager.UpdateCurrentProfileBehavior();
                    }
                }
            }
            //if (!Core.Player.HasAura(_buff)) { await EatFood(); }

            switch (WorldManager.ZoneId)
            {
            case 372:                     //80本 国际服 5.1
                if (await PlayerCheck())
                {
                    return(true);
                }
                return(await SyrcusTower.Run());

            case 742:                     //80本 国际服 5.1
                if (await PlayerCheck())
                {
                    return(true);
                }
                return(await HellsLid.Run());

            case 851:                     //80本 国际服 5.1
                if (await PlayerCheck())
                {
                    return(true);
                }
                return(await EdensGateInundationLevi.Run());

            default:
                if (await PlayerCheck())
                {
                    return(true);
                }
                return(await SyrcusTower.Run());
            }
        }
示例#9
0
        private async Task <bool> HandleDeath()
        {
            var currentZone = WorldManager.CurrentZoneName;

            // Check if loading in the case of instant release like Squadron dungeons
            if (CommonBehaviors.IsLoading)
            {
                Log($"Waiting to be alive.");
                await Coroutine.Wait(-1, () => (Core.Me.IsAlive));
            }


            //Logic for Bozja and Eureka
            if (IsInBozjaOrEureka())
            {
                Log($"Handling Death For {currentZone}");
                await HandleDeathInBozjaAndEureka();
            }

            // Logic for NPC parties
            while (PartyManager.AllMembers.Any(i => i.GetType() == typeof(TrustPartyMember)))
            {
                Log($"In a NPC party. Waiting for zone.");
                await Coroutine.Wait(-1, () => (Core.Me.IsAlive));
            }

            //Logic for In Duty
            if (DutyManager.InInstance && !IsInBozjaOrEureka())
            {
                await HandleDeathInInstance();
            }

            //Logic for not in a party
            if (PartyManager.IsInParty && !IsInBozjaOrEureka() && !DutyManager.InInstance)
            {
                if (HasRezzerInParty())
                {
                    Log($"We died in {currentZone}. We have a Raiser.");
                    await WaitForLife();
                }
                else
                {
                    if (OsirisSettings.Instance.ReleaseWait)
                    {
                        Log($"We died in {currentZone}. Wait for release checked.");
                        await WaitForLife();
                    }
                    else
                    {
                        Log($"We died in {currentZone} with no Raiser in party.");
                        await Release();
                    }
                }
            }

            //Logic for everything else
            if (!PartyManager.IsInParty && !IsInBozjaOrEureka() && !DutyManager.InInstance)
            {
                if (OsirisSettings.Instance.ReleaseWait)
                {
                    await WaitForLife();
                }
                else
                {
                    await Release();
                }
            }


            Log($"We are alive, loading profile...");
            NeoProfileManager.Load(NeoProfileManager.CurrentProfile.Path);
            NeoProfileManager.UpdateCurrentProfileBehavior();
            await Coroutine.Sleep(5000);

            return(true);
        }