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!

Initialize() RB 32/64

newb23

Community Developer
Joined
Nov 26, 2014
Messages
397
Good afternoon!

I wanted to verify that I understood what was happening in the Initialize() portion of routines specifically.

When I load up RB32, the initial routine that I choose fires Initialize() and all other code called within the Initialize() method and ONLY for that selected, active routine - no others.

When I load up RB64, the initial routine that I choose doesn't appear to fire Initialize() at all, until I change routines for the first time. After that first routine change, it loads Initialize() and all associate code for ONLY the selected routine, but only after changing routines at least once. It will then however fire Initialize() for each routine you change to, every time you change to that routine.

I assume the RB32 behavior is correct and RB64 will need to be corrected, but wanted to verify.

Thank you!
 
Good afternoon!

I wanted to verify that I understood what was happening in the Initialize() portion of routines specifically.

When I load up RB32, the initial routine that I choose fires Initialize() and all other code called within the Initialize() method and ONLY for that selected, active routine - no others.

When I load up RB64, the initial routine that I choose doesn't appear to fire Initialize() at all, until I change routines for the first time. After that first routine change, it loads Initialize() and all associate code for ONLY the selected routine, but only after changing routines at least once. It will then however fire Initialize() for each routine you change to, every time you change to that routine.

I assume the RB32 behavior is correct and RB64 will need to be corrected, but wanted to verify.

Thank you!

I'm unable to replicate any issues on x64.

I installed this dummy routine
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using ff14bot.AClasses;
using ff14bot.Enums;
using ff14bot.Forms.RoutineSelector;
using ff14bot.Helpers;
using ff14bot.Interfaces;
using ff14bot.Settings;
using Clio.Utilities;
using ff14bot.Behavior;
using TreeSharp;
using ff14bot;
namespace ff14bot
{

    public class DerpTest : CombatRoutine
    {
        public override ClassJobType[] Class
        {
            get
            {
                return new ClassJobType[] { Core.Player.CurrentJob };
            }
        }

        public override string Name
        {
            get
            {
                return "DerpTest";
            }
        }

        public DerpTest()
        {
        }

        public override float PullRange
        {
            get { return 0; }
        }

        public override void Initialize()
        {
			Logging.Write("Hello");
        }
    }
}

And selected kupo at startup, and as expected the kupo initalizer is called.

[18:34:36.195 N] [Kupo] Starting Kupo [Dragoon]

Since there is actually X copies of kupo running, id expect to see many versions announcing their initalization
 
I am still seeing the same behavior when loading up my routine. Attached is my Main class for the routine, and a log showing me loading up RB 64, selecting my routine, not having Init fire, changing to a DoH class, switching back, THEN having Initialize fire.

[07:42:14.319 N] [Kefka] Initializing

The Initialize Method itself:
Code:
        public void Initialize()
        {
            Logger.KefkaLog(@"Initializing");


            TreeRoot.OnStart += OnBotStart;
            TreeRoot.OnStop += OnBotStop;
            GameEvents.OnClassChanged += OnClassChanged;


            var _class = RoutineManager.CurrentClass;
            InterruptManager.ResetInterrupts();
            TankBusterManager.ResetTankBusters();
            OpenerManager.ResetOpeners();
            HotkeyManager.UnregisterAllHotkeys();
        }
 

Attachments

I am still seeing the same behavior when loading up my routine. Attached is my Main class for the routine, and a log showing me loading up RB 64, selecting my routine, not having Init fire, changing to a DoH class, switching back, THEN having Initialize fire.



The Initialize Method itself:
Code:
        public void Initialize()
        {
            Logger.KefkaLog(@"Initializing");


            TreeRoot.OnStart += OnBotStart;
            TreeRoot.OnStop += OnBotStop;
            GameEvents.OnClassChanged += OnClassChanged;


            var _class = RoutineManager.CurrentClass;
            InterruptManager.ResetInterrupts();
            TankBusterManager.ResetTankBusters();
            OpenerManager.ResetOpeners();
            HotkeyManager.UnregisterAllHotkeys();
        }

Your not inheriting CombatRoutine so the bot doesn't see your routine.

Edit or maybe i misunderstand what your trying todo, but regardless you've got a bunch of stuff installed, and the only way .Initialize ever gets called is when routinemanager.current is switched. Since i verified that its working properly on my end, you should try a clean install and add things one at a time to figure out whats broken. But thats all im going comment in this thread as no support for third party precompiled works.
 
AH, I see. Ha! I'll keep playing around with it. Thank you!
 
I wanted to throw a reply in here after finally figuring out what the issue was, in case it leads to further help later down the road for someone.

IF the routine selection window is not fired at the beginning of the bot starting up, IE: You only have ONE routine that supports the class you're currently running, and it defaults in to whatever routine, Initialize() for that routine will not fire.

the only way .Initialize ever gets called is when routinemanager.current is switched
^ I assume is the reason for this. ^


IF you literally have to choose your routine in the routine select window during inital startup, it will fire Initialize().

Thank you Mastahg for your insight into WHEN initialize is fired, set me one the right track! Glad it had nothing to do with third party, whew!
 
Last edited:
I wanted to throw a reply in here after finally figuring out what the issue was, in case it leads to further help later down the road for someone.

IF the routine selection window is not fired at the beginning of the bot starting up, IE: You only have ONE routine that supports the class you're currently running, and it defaults in to whatever routine, Initialize() for that routine will not fire.

This is incorrect, the initial state is that no routine is selected, so when the default gets set it gets called. You can see this is the case if you do a clean install and look at kupo.cs
 
I did verify that ONLY having Kupo initializes like you said that it would, so, I don't know what's up specifically, or why mine works as Kupo does in 32, but not 64. *shrug*

Changing nothing except adding another routine that supports the initial class upon startup, and thus having to choose between the two, has been working in every instance since I added another routine in there, then choosing mine.

Regardless, I have found a solution through your guidance, even if it wasn't quite the path you expected me to find, so, thank you. :P
 
Back
Top