private IEnumerator MoveToNextScene()
    {
        //CarryData.Instance.leftFoodAmount = foodAmount;
        yield return(new WaitForSeconds(3.0f));

        RoutineManager.MoveScene();
    }
Example #2
0
    IEnumerator Flow()
    {
        over.SetActive(false);
        yield return(new WaitForSeconds(2f));

        over.SetActive(true);
        float currentLerpTime = 0f;
        var   startScale      = new Vector3(4f, 4f, 4f);
        var   endScale        = Vector3.one;

        while (currentLerpTime <= 0.5f)
        {
            var perc = currentLerpTime / 0.5f;
            perc = perc * perc * (perc * (6f * perc - 15f) + 10f);
            over.GetComponent <RectTransform>().localScale = Vector3.Lerp(startScale, endScale, perc);
            currentLerpTime += 0.01f;
            yield return(new WaitForSeconds(0.01f)); //Smoothness
        }
        currentLerpTime = 0f;
        StartCoroutine(Blink());

        for (int i = 0; i < endString.Length; i++)
        {
            text.text += endString[i];
            yield return(new WaitForSeconds(0.02f));
        }


        yield return(new WaitUntil(() => Input.anyKeyDown));

        RoutineManager.MoveScene(0);
    }
Example #3
0
 public void Restore()
 {
     foreach (var capabilityState in _capabilityStates)
     {
         RoutineManager.SetCapabilityState(capabilityState.Key, capabilityState.Value);
     }
 }
Example #4
0
        private static bool CheckBeforeExecuteJumps()
        {
            if (!DragoonSettings.Instance.UseJumps)
            {
                return(false);
            }

            if (DragoonSettings.Instance.SafeJumpLogic)
            {
                if (!Core.Me.CurrentTarget.InView())
                {
                    return(false);
                }
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            if (DragoonRoutine.JumpsList.Contains(Casting.LastSpell))
            {
                return(false);
            }

            return(true);
        }
Example #5
0
        public static async Task <bool> Displacement()
        {
            if (!RedMageSettings.Instance.Displacement)
            {
                return(false);
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            if (!RedMageSettings.Instance.UseMelee)
            {
                return(false);
            }

            if (BlackMana > 24 && WhiteMana > 24)
            {
                return(false);
            }

            var inMeleeCombo = Casting.SpellCastHistory.Take(5).Any(s => s.Spell == Spells.Riposte ||
                                                                    s.Spell == Spells.Zwerchhau ||
                                                                    s.Spell == Spells.Redoublement);

            if (!inMeleeCombo)
            {
                return(false);
            }

            return(await Spells.Displacement.Cast(Core.Me.CurrentTarget));
        }
Example #6
0
        public static async Task <bool> CorpsACorps()
        {
            if (!RedMageSettings.Instance.CorpsACorps)
            {
                return(false);
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            if (!RedMageSettings.Instance.UseMelee)
            {
                return(false);
            }

            if (BlackMana < 80 || WhiteMana < 80)
            {
                return(false);
            }

            else
            {
                return(await Spells.CorpsACorps.Cast(Core.Me.CurrentTarget));
            }
        }
Example #7
0
 /// <summary>
 /// William Clark
 /// Created: 2021/03/11
 ///
 /// Constructs an ActiveRoutines page
 /// </summary>
 ///
 /// <remarks>
 /// </remarks>
 ///
 /// <param name="routineManager">The RoutineManager Reference</param>
 /// <param name="selectedUser">The UserAccountVM for which to view active routines</param>
 public ActiveRoutines(RoutineManager routineManager, UserAccountVM selectedUser)
 {
     _routineManager = routineManager;
     _user           = selectedUser;
     InitializeComponent();
     PopulateRoutineList();
 }
Example #8
0
        public void Should_ShowExercisesInRoutine_When_ExerciseAddedToRoutineDay()
        {
            //Arrange
            var routine = new Routine(1, "dummyRoutine");

            var exercise = new Exercise(1, "dummyExercise", 1);

            routine.ExercisesOfTheDay.Add(exercise);

            var routineServiceMock = new Mock <IService <Routine> >();

            routineServiceMock.Setup(m => m.GetAllItems()).Returns(new List <Routine>()
            {
                routine
            });

            var informationProviderMock = new Mock <InformationProvider>();

            var objectUnderTest = new RoutineManager(routineServiceMock.Object, informationProviderMock.Object);

            //Act
            objectUnderTest.ShowWholeRoutine();

            //Assert
            informationProviderMock.Verify(m => m.ShowMultipleInformation(new List <string>()
            {
                "1. dummyExercise - 0 x 0 x 0"
            }), Times.Once);
        }
Example #9
0
        public void Should_AddExerciseToRoutineDay_When_ExerciseExists()
        {
            //Arrange
            var routine = new Routine(1, "dummyRoutine");

            var exercise = new Exercise(1, "dummyExercise", 1);

            var informationProviderMock = new Mock <InformationProvider>();
            var routineServiceMock      = new Mock <IService <Routine> >();

            routineServiceMock.SetupGet(m => m.Items).Returns(new List <Routine>()
            {
                routine
            });
            routineServiceMock.Setup(m => m.GetItem(routine.Id)).Returns(routine);

            var objectUnderTest = new RoutineManager(routineServiceMock.Object, informationProviderMock.Object);

            //Act
            objectUnderTest.AddSelectedExerciseToRoutineDay(routine.Id, exercise);

            //Assert
            Assert.Equal(exercise.Id, routine.ExercisesOfTheDay[0].Id);
            Assert.Equal(exercise.Name, routine.ExercisesOfTheDay[0].Name);
        }
        public Composite CreateBasicCombat()
        {
            return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                        new Decorator(ctx => ctx != null,
                                                      new PrioritySelector(
                                                          new Decorator(ctx => !RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement), new PrioritySelector(
                                                                            CommonBehaviors.MoveToLos(ctx => ctx as GameObject),
                                                                            CommonBehaviors.MoveAndStop(ctx => (ctx as GameObject).Location, ctx => Core.Player.CombatReach + PullRange, true, "Moving to unit")
                                                                            )),
                                                          //CombatBuffs
                                                          Spell.Cast("Toad Oil", r => !Core.Me.HasAura("Toad Oil")),

                                                          //Interrupt
                                                          Spell.Cast("Flying Sardine", r => shouldFishSlap),

                                                          //Basic Combat
                                                          Spell.Cast("Triple Trident", r => Core.Me.HasAura("Tingling") && Core.Me.HasAura("Harmonized")),
                                                          Spell.Cast("Whistle", r => ActionManager.LastSpell.Name == "Tingle"),
                                                          Spell.Cast("Tingle", r => DataManager.GetSpellData(23264).Cooldown.TotalMilliseconds == 0 && Core.Me.CurrentTarget.CurrentHealthPercent > 30 && Core.Target.Distance2D(Core.Me) <= 6f),
                                                          Spell.Cast("Lucid Dreaming", r => ActionManager.HasSpell("Lucid Dreaming") && Core.Player.CurrentManaPercent < 50),
                                                          Spell.Cast("Blood Drain", r => Core.Player.CurrentManaPercent < 20),
                                                          Spell.Cast("Off-guard", r => Core.Me.CurrentTarget.CurrentHealthPercent < 50),
                                                          Spell.Cast("Bad Breath", r => ActionManager.LastSpell.Name != "Bad Breath" && Core.Me.IsFacing(Core.Target) && Core.Target.Distance2D(Core.Me) <= 8f && !Core.Target.HasAura("Poison") && Core.Me.CurrentTarget.CurrentHealthPercent > 40),
                                                          Spell.Cast("Plaincracker", r => GameObjectManager.NumberOfAttackers >= 2 && Core.Target.Distance2D(Core.Me) <= 4f),
                                                          Spell.Cast("Whistle", r => !Core.Me.HasAura("Boost") && !Core.Me.HasAura("Harmonized") && !Core.Target.HasAura("Off-guard") && ActionManager.HasSpell("Abyssal Transfixion")),
                                                          Spell.Cast("Abyssal Transfixion", r => true),
                                                          Spell.Cast("1000 Needles", r => Core.Me.CurrentTarget.CurrentHealthPercent > 75 && ActionManager.LastSpell.Name != "1000 Needles"),
                                                          Spell.Cast("Water Cannon", r => true)
                                                          ))));
        }
    private IEnumerator PressAnyKey()
    {
        StartCoroutine("Blink");
        yield return(new WaitUntil(() => Input.anyKeyDown));

        RoutineManager.MoveScene();
    }
Example #12
0
    IEnumerator PressAnyKeyFunc()
    {
        yield return(new WaitUntil(() => Input.anyKeyDown)); //코루틴은 부른 곳에서 끝난다. 불린 곳이 종료되어도 부른 Monobehavior가 안끝나면 안끝난다고 한다.

        RoutineManager.MoveScene();
        print("Moving to Next Scene...");
    }
 public override void OnFinished()
 {
     TreeHooks.Instance.RemoveHook("Combat_Main", CreateBehavior_MainCombat());
     RoutineManager.SetCapabilityState(CapabilityFlags.PetSummoning, _summonPetOriginalState);
     TreeRoot.GoalText   = string.Empty;
     TreeRoot.StatusText = string.Empty;
     base.OnFinished();
 }
Example #14
0
    IEnumerator FinishDay()
    {
        yield return(new WaitUntil(() => Input.anyKeyDown));

        DataManager.SaveAllData();
        CalendarManager.NextDay();
        RoutineManager.MoveScene(1);
    }
Example #15
0
 public MainForm()
 {
     InitializeComponent();
     UserNameLabel.Text = UserManager.WhoIsCurrentLoged;
     CheckControls();
     RoutineManager.ResetPaths();
     CentralPanel.Controls["defaultControl"].BringToFront();
 }
Example #16
0
 private void OnMouseDown()
 {
     //if (drawer1.isDrawerOpened) ; //휴가증, 초코파이 등 사용
     if (drawer2.isDrawerOpened)
     {
         RoutineManager.MoveScene();
     }
 }
Example #17
0
        private static void RecompilePlugins()
        {
            if (BotMain.IsRunning)
            {
                BotMain.Stop(false, "Recompiling Plugin!");
                while (BotMain.BotThread.IsAlive)
                {
                    Thread.Sleep(0);
                }
            }

            var EnabledPlugins = PluginManager.GetEnabledPlugins().ToArray();

            foreach (var p in PluginManager.Plugins)
            {
                p.Enabled = false;
            }

            PluginManager.ShutdownAllPlugins();

            Logger.DBLog.DebugFormat("Disposing All Routines");
            foreach (var r in RoutineManager.Routines)
            {
                r.Dispose();
            }



            string sDemonBuddyPath    = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string sTrinityPluginPath = FolderPaths.PluginPath;

            CodeCompiler FunkyCode = new CodeCompiler(sTrinityPluginPath);

            //FunkyCode.ParseFilesForCompilerOptions();
            Logger.DBLog.DebugFormat("Recompiling Funky Bot");
            FunkyCode.Compile();
            Logger.DBLog.DebugFormat(FunkyCode.CompiledToLocation);

            Logger.DBLog.DebugFormat("Clearing all treehooks");
            TreeHooks.Instance.ClearAll();

            Logger.DBLog.DebugFormat("Disposing of current bot");
            BotMain.CurrentBot.Dispose();

            Logger.DBLog.DebugFormat("Removing old Assemblies");
            CodeCompiler.DeleteOldAssemblies();

            BrainBehavior.CreateBrain();

            Logger.DBLog.DebugFormat("Reloading Plugins");
            PluginManager.ReloadAllPlugins(sDemonBuddyPath + @"\Plugins\");

            Logger.DBLog.DebugFormat("Enabling Plugins");
            PluginManager.SetEnabledPlugins(EnabledPlugins);

            Logger.DBLog.DebugFormat("Reloading Routines");
            RoutineManager.Reload();
        }
Example #18
0
        /// <summary>
        /// Installs the latest version of the Trinity routine
        /// </summary>
        private static void InstallTrinityRoutine()
        {
            FileManager.CleanupOldRoutines();

            Logger.LogNormal("Combat routine is not installed or is not latest version, installing! {0}", FileManager.GetFileHeader(FileManager.CombatRoutineSourcePath));
            FileManager.CopyFile(FileManager.CombatRoutineSourcePath, FileManager.CombatRoutineDestinationPath);

            RoutineManager.Reload();
        }
Example #19
0
 private void LaunchRoutineSelect(object sender, RoutedEventArgs e)
 {
     RoutineManager.PreferedRoutine = "";
     RoutineManager.PickRoutine();
     System.Threading.Tasks.Task.Factory.StartNew(async() =>
     {
         await TreeRoot.StopGently(" " + "Preparing to switch Combat Routine.");
         BotManager.SetCurrent(BotManager.Bots.FirstOrDefault(r => r.Name == bot));
         TreeRoot.Start();
     });
 }
Example #20
0
        public override void OnPulse()
        {
            if (_pulseTimer.IsFinished && _inPvpArea != WorldManager.InPvP)
            {
                _inPvpArea = WorldManager.InPvP;
                _pulseTimer.Reset();

                RoutineManager.PreferedRoutine = "";
                RoutineManager.PickRoutine();
            }
        }
 public Composite CreateBasicPull()
 {
     return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                 new Decorator(ctx => ctx != null, new PrioritySelector(
                                                   new Decorator(ctx => !RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement), new PrioritySelector(
                                                                     CommonBehaviors.MoveToLos(ctx => ctx as GameObject),
                                                                     CommonBehaviors.MoveAndStop(ctx => (ctx as GameObject).Location, ctx => Core.Player.CombatReach + PullRange + (ctx as GameObject).CombatReach, true, "Moving to unit")
                                                                     )),
                                                   Spell.PullCast(r => "Sticky Tongue", r => ActionManager.LastSpell.Name != "Sticky Tongue" && Core.Target.Distance2D(Core.Me) >= 5f),
                                                   Spell.PullCast(r => "Water Cannon", r => ActionManager.LastSpell.Name != "Water Cannon" && !ActionManager.HasSpell("Sticky Tongue"))
                                                   ))));
 }
Example #22
0
    IEnumerator Flow()
    {
        yield return(new WaitForSeconds(1f));

        for (int i = 0; i < speechBubbles.Length; i++)
        {
            speechBubbles[i].SetActive(true);
            yield return(new WaitWhile(() => !speechBubbles[i].GetComponent <SpeechBubble>().isBubbleDone));
        }
        yield return(new WaitUntil(() => Input.anyKeyDown));

        RoutineManager.MoveScene();
    }
Example #23
0
        public static async Task <bool> Jump()
        {
            if (!DragoonSettings.Instance.Jump)
            {
                return(false);
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            return(await Spells.Jump.Cast(Core.Me.CurrentTarget));
        }
Example #24
0
        private void Delete()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = RoutineManager.routineDirectoryPath;
            openFileDialog.Title            = "Select routine";

            DialogResult dialogResult = openFileDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                RoutineManager.routineFilePath = openFileDialog.FileName;
                RoutineManager.DeleteRoutine();
            }
        }
Example #25
0
            public RoutineManagerSubMemento()
            {
                // We explicitly enumerate the CapabilityFlags...
                // This eliminates the possiblity of wrongly snagging "composite flags" (like .All).
                for (var i = 0; i < 32; i++)
                {
                    var capabilityFlag = (CapabilityFlags)(1u << i);
                    if (!Enum.IsDefined(typeof(CapabilityFlags), capabilityFlag))
                    {
                        continue;
                    }

                    _capabilityStates.Add(capabilityFlag, RoutineManager.GetCapabilityState(capabilityFlag));
                }
            }
Example #26
0
        private async Task CastPomanderAbility(SpellData spell)
        {
            if (!RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement | CapabilityFlags.Facing))
            {
                if (!ActionManager.CanCast(spell, Poi.Current.BattleCharacter) || Poi.Current.BattleCharacter.Distance2D() > (float)spell.Range + Poi.Current.BattleCharacter.CombatReach)
                {
                    await CommonTasks.MoveAndStop(new MoveToParameters(Core.Target.Location, $"Moving to {Poi.Current.Name} to cast {spell.Name}"),
                                                  (float)spell.Range + Poi.Current.BattleCharacter.CombatReach, true);
                }

                Poi.Current.BattleCharacter.Face2D();
            }

            ActionManager.DoAction(spell, Poi.Current.BattleCharacter);
            await Coroutine.Yield();
        }
Example #27
0
        public static async Task <bool> MirageDive()
        {
            if (!DragoonSettings.Instance.MirageDive)
            {
                return(false);
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            if (!Core.Me.HasAura(Auras.DiveReady))
            {
                return(false);
            }

            // Neko: 2 things that can help. Don't mirage dive unless in Blood of the Dragon, also, don't mirage dive if at 2 eyes.

            if (ActionResourceManager.Dragoon.DragonGaze == 2)
            {
                return(false);
            }

            if (Spells.VorpalThrust.Cooldown.TotalMilliseconds < 750)
            {
                return(false);
            }

            if (await Spells.MirageDive.Cast(Core.Me.CurrentTarget))
            {
                Utilities.Routines.Dragoon.MirageDives++;

                if (DragoonSettings.Instance.Geirskogul)
                {
                    if (Spells.Geirskogul.Cooldown.TotalMilliseconds < 1000)
                    {
                        await Coroutine.Wait(3000, () => ActionManager.CanCast(Spells.Geirskogul.Id, Core.Me.CurrentTarget));

                        return(await Spells.Geirskogul.Cast(Core.Me.CurrentTarget));
                    }
                }
            }

            return(false);
        }
Example #28
0
        public void Stop()
        {
            _taskManager.Stop();
            PluginManager.Stop();
            RoutineManager.Stop();
            PlayerMoverManager.Stop();

            // When the bot is stopped, we want to remove the process hook manager.
            LokiPoe.ProcessHookManager.Disable();

            // Cleanup the coroutine.
            if (_coroutine != null)
            {
                _coroutine.Dispose();
                _coroutine = null;
            }
        }
Example #29
0
        public void Start()
        {
            ItemEvaluator.Instance   = DefaultItemEvaluator.Instance;
            Explorer.CurrentDelegate = user => CombatAreaCache.Current.Explorer.BasicExplorer;

            ComplexExplorer.ResetSettingsProviders();
            ComplexExplorer.AddSettingsProvider("MapBot", MapBotExploration, ProviderPriority.Low);

            // Cache all bound keys.
            LokiPoe.Input.Binding.Update();

            // Reset the default MsBetweenTicks on start.
            Log.Debug($"[Start] MsBetweenTicks: {BotManager.MsBetweenTicks}.");
            Log.Debug($"[Start] NetworkingMode: {LokiPoe.ConfigManager.NetworkingMode}.");
            Log.Debug($"[Start] KeyPickup: {LokiPoe.ConfigManager.KeyPickup}.");
            Log.Debug($"[Start] IsAutoEquipEnabled: {LokiPoe.ConfigManager.IsAutoEquipEnabled}.");

            // Since this bot will be performing client actions, we need to enable the process hook manager.
            LokiPoe.ProcessHookManager.Enable();

            _coroutine = null;

            ExilePather.Reload();

            _taskManager.Reset();

            AddTasks();

            Events.Start();
            PluginManager.Start();
            RoutineManager.Start();
            PlayerMoverManager.Start();
            _taskManager.Start();

            foreach (var plugin in PluginManager.EnabledPlugins)
            {
                Log.Debug($"[Start] The plugin {plugin.Name} is enabled.");
            }

            if (ExilePather.BlockTrialOfAscendancy == FeatureEnum.Unset)
            {
                //no need for this, map trials are in separate areas
                ExilePather.BlockTrialOfAscendancy = FeatureEnum.Disabled;
            }
        }
Example #30
0
        public static async Task <bool> Execute()
        {
            if (!DragoonSettings.Instance.UseJumps)
            {
                return(false);
            }

            if (DragoonSettings.Instance.SafeJumpLogic)
            {
                if (!Core.Me.CurrentTarget.InView())
                {
                    return(false);
                }
            }

            if (RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement))
            {
                return(false);
            }

            if (Utilities.Routines.Dragoon.Jumps.Contains(Casting.LastSpell))
            {
                return(false);
            }

            if (Core.Me.ClassLevel >= 54 && Combat.CombatTime.Elapsed.Seconds < 20 && ActionResourceManager.Dragoon.Timer.Seconds == 0)
            {
                return(false);
            }

            if (await Jump())
            {
                return(true);
            }
            if (await Stardiver())
            {
                return(true);
            }
            if (await SpineshatterDive())
            {
                return(true);
            }
            return(await DragonfireDive());
        }