What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

ChainIt - Allows you to do chain quest without running back!

So a ny update on this how do we "hard code" it to make it move upwards? I'd love to be able to queue it up.

Warning, you have to find a way to blacklist the non fate mob yourself or else it will work or not I don't know.
The code below is experimental. It works but there might be some bugs.
Code:
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Media;
using Buddy.Coroutines;
using Clio.Utilities;
using ff14bot;
using ff14bot.AClasses;
using ff14bot.Behavior;
using ff14bot.BotBases;
using ff14bot.Helpers;
using ff14bot.Managers;
using ff14bot.Navigation;
using TreeSharp;

namespace ChainIt
{
    public class ChainIt : BotPlugin
    {
        public override string Author { get { return "Heinzskies"; } }
        public override Version Version { get { return new Version(0, 0, 1); } }
        public override string Name { get { return "ChainIt"; } }
        public override string Description { get { return "Allow you to do chain quest without going back."; } }

        public override bool WantButton
        {
            get { return false; }
        }

        public new bool Equals(BotPlugin other)
        {
            throw new NotImplementedException();
        }

        bool _lastFateChainActive = false;
        FateIdleAction _userAction = FateIdleAction.Nothing;
        private Composite _action;

        public override void OnPulse()
        {

            uint[] fatesChain = { 643, 644, 645, 646 };

            foreach (var fateChain in from fateChain in fatesChain let fateSearch = FateManager.ActiveFates.Count(fate => fate.Id == fateChain) where fateSearch != 0 select fateChain)
            {
                ActiveChain();
                if (fatesChain.Last() == fateChain)
                {
                    _lastFateChainActive = true;
                }
                    
                FatebotSettings.Instance.ThisFateOnly = FateManager.GetFateById(fateChain).Name;
            }


            if (FateManager.ActiveFates.Count(fate => fate.Id == fatesChain.Last()) == 0 && _lastFateChainActive)
            {
                _lastFateChainActive = false;
                FatebotSettings.Instance.ThisFateOnly = "";
                FatebotSettings.Instance.IdleAction = _userAction;
            }
        }

        private void ActiveChain()
        {
            if (FatebotSettings.Instance.IdleAction != FateIdleAction.Nothing)
            {
                _userAction = FatebotSettings.Instance.IdleAction;
            }
            FatebotSettings.Instance.IdleAction = FateIdleAction.Nothing;
        }

        public override void OnInitialize()
        {
            _action = new Decorator(r => 
            Core.Player.Location.Distance(new Vector3("252.831238, 25, 4.66978")) > 15 &&
            (
            FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Plea" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Bait" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The End" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Switch"
            )
            , new ActionRunCoroutine(p => DoIt()));
        }

        public override void OnShutdown()
        {
            TreeRoot.OnStart -= OnBotStart;
            TreeRoot.OnStop -= OnBotStop;
            TreeHooks.Instance.OnHooksCleared -= OnOnHooksCleared;

            RemoveHooks();
        }

        private void AddHooks()
        {
            TreeHooks.Instance.InsertHook("TreeStart", 0, _action);
        }

        private void RemoveHooks()
        {
            TreeHooks.Instance.RemoveHook("TreeStart", _action);
        }

        public override void OnEnabled()
        {
            TreeRoot.OnStart += OnBotStart;
            TreeRoot.OnStop += OnBotStop;
            TreeHooks.Instance.OnHooksCleared += OnOnHooksCleared;

            if (TreeRoot.IsRunning)
            {
                AddHooks();
            }

            Logging.Write(Colors.SkyBlue, "[ChainIt] v" + Version + " Enabled");
        }

        private static async Task<bool> DoIt()
        {
            Poi.Clear("Moving to fate hotspot location");
            
            Navigator.MoveTo(new Vector3("252.831238, 25, 4.66978"));
            
            return true;
        }

        public override void OnDisabled()
        {
            TreeRoot.OnStart -= OnBotStart;
            TreeRoot.OnStop -= OnBotStop;
            TreeHooks.Instance.OnHooksCleared -= OnOnHooksCleared;
            RemoveHooks();
        }

        #region Event Handlers

        private void OnBotStop(BotBase bot)
        {
            RemoveHooks();
        }

        private void OnBotStart(BotBase bot)
        {
            AddHooks();
        }

        private void OnOnHooksCleared(object sender, EventArgs e)
        {
            AddHooks();
        }

        #endregion
    }
}
 
Warning, you have to find a way to blacklist the non fate mob yourself or else it will work or not I don't know.
The code below is experimental. It works but there might be some bugs.
Code:
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Media;
using Buddy.Coroutines;
using Clio.Utilities;
using ff14bot;
using ff14bot.AClasses;
using ff14bot.Behavior;
using ff14bot.BotBases;
using ff14bot.Helpers;
using ff14bot.Managers;
using ff14bot.Navigation;
using TreeSharp;

namespace ChainIt
{
    public class ChainIt : BotPlugin
    {
        public override string Author { get { return "Heinzskies"; } }
        public override Version Version { get { return new Version(0, 0, 1); } }
        public override string Name { get { return "ChainIt"; } }
        public override string Description { get { return "Allow you to do chain quest without going back."; } }

        public override bool WantButton
        {
            get { return false; }
        }

        public new bool Equals(BotPlugin other)
        {
            throw new NotImplementedException();
        }

        bool _lastFateChainActive = false;
        FateIdleAction _userAction = FateIdleAction.Nothing;
        private Composite _action;

        public override void OnPulse()
        {

            uint[] fatesChain = { 643, 644, 645, 646 };

            foreach (var fateChain in from fateChain in fatesChain let fateSearch = FateManager.ActiveFates.Count(fate => fate.Id == fateChain) where fateSearch != 0 select fateChain)
            {
                ActiveChain();
                if (fatesChain.Last() == fateChain)
                {
                    _lastFateChainActive = true;
                }
                    
                FatebotSettings.Instance.ThisFateOnly = FateManager.GetFateById(fateChain).Name;
            }


            if (FateManager.ActiveFates.Count(fate => fate.Id == fatesChain.Last()) == 0 && _lastFateChainActive)
            {
                _lastFateChainActive = false;
                FatebotSettings.Instance.ThisFateOnly = "";
                FatebotSettings.Instance.IdleAction = _userAction;
            }
        }

        private void ActiveChain()
        {
            if (FatebotSettings.Instance.IdleAction != FateIdleAction.Nothing)
            {
                _userAction = FatebotSettings.Instance.IdleAction;
            }
            FatebotSettings.Instance.IdleAction = FateIdleAction.Nothing;
        }

        public override void OnInitialize()
        {
            _action = new Decorator(r => 
            Core.Player.Location.Distance(new Vector3("252.831238, 25, 4.66978")) > 15 &&
            (
            FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Plea" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Bait" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The End" ||
             FatebotSettings.Instance.ThisFateOnly == "Dark Devices - The Switch"
            )
            , new ActionRunCoroutine(p => DoIt()));
        }

        public override void OnShutdown()
        {
            TreeRoot.OnStart -= OnBotStart;
            TreeRoot.OnStop -= OnBotStop;
            TreeHooks.Instance.OnHooksCleared -= OnOnHooksCleared;

            RemoveHooks();
        }

        private void AddHooks()
        {
            TreeHooks.Instance.InsertHook("TreeStart", 0, _action);
        }

        private void RemoveHooks()
        {
            TreeHooks.Instance.RemoveHook("TreeStart", _action);
        }

        public override void OnEnabled()
        {
            TreeRoot.OnStart += OnBotStart;
            TreeRoot.OnStop += OnBotStop;
            TreeHooks.Instance.OnHooksCleared += OnOnHooksCleared;

            if (TreeRoot.IsRunning)
            {
                AddHooks();
            }

            Logging.Write(Colors.SkyBlue, "[ChainIt] v" + Version + " Enabled");
        }

        private static async Task<bool> DoIt()
        {
            Poi.Clear("Moving to fate hotspot location");
            
            Navigator.MoveTo(new Vector3("252.831238, 25, 4.66978"));
            
            return true;
        }

        public override void OnDisabled()
        {
            TreeRoot.OnStart -= OnBotStart;
            TreeRoot.OnStop -= OnBotStop;
            TreeHooks.Instance.OnHooksCleared -= OnOnHooksCleared;
            RemoveHooks();
        }

        #region Event Handlers

        private void OnBotStop(BotBase bot)
        {
            RemoveHooks();
        }

        private void OnBotStart(BotBase bot)
        {
            AddHooks();
        }

        private void OnOnHooksCleared(object sender, EventArgs e)
        {
            AddHooks();
        }

        #endregion
    }
}

worked beautifully, is there anyway to make this code have both the dark devices and the svara fate chain in piece of code? ^^
 
worked beautifully, is there anyway to make this code have both the dark devices and the svara fate chain in piece of code? ^^

You can actually have it wait at as many fates as you would like; just add them all to the line he mentioned separated by a comma:
uint[] fatesChain = { 643, 644, 645, 646, [id of fate5], [id of fate6], [id of fate7], [id of fate8] };

If you search at xivdb for fates such as http://xivdb.com/?fate/643/Dark-Devices---The-Plea, you will find the fate id in the url like so:
LWIoVyi.png
 
So how do we active this thing. I created the .cs file with the Visual Studio, and put it in the Plugins folder etc etc etc, but it isnt showing up in RB
 
So how do we active this thing. I created the .cs file with the Visual Studio, and put it in the Plugins folder etc etc etc, but it isnt showing up in RB
Did you put it in its own folder? Did you restart RB after you added the file?
 
what you mean by show up in RB? cause you wont notice UI or anything just it do the requirement
^ If this is the case, it won't show up in the Plugins list, but should still be functional.
 
First thing we need to do when plugins don't show up in the UI is get a full log. It is likely you are getting a compilation error.
 
I copied and pasted that text into a Wordpad document and saved it as ChainIt.cs and placed it into a ChainIt folder within the Plugins folder - it doesn't work for me, I keep running away from the first FATE, then running back, then away, then back, etc.

What am I doing wrong? Or can someone supply a working document that I can place in the ChainIt folder?

Much appreciated
 
Back
Top