• Visit Rebornbuddy
  • [Release] RebornBuddy64 Version 1.0.232 - DirectX11 / x64 bit compatible

    Discussion in 'Rebornbuddy Forum' started by mastahg, Feb 29, 2016.

    1. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      To include something like this in the main bot I would need patterns for all the different offsets, and if possible the indexes for the element accessors for the windows. Deepdungeon has an example of what I am talking about. There are plugins for ida to generate them, and I think ghidra has them the ability to create them built in.

      You can add your own agent to the active agent list by finding its id via AgentModule.FindAgentIdByVtable then calling AgentModule.TryAddAgent.


      I am also considering a small change to how RaptureAtkUnitManager.GetWindowByName works. Currently it returns immediately the moment the window is added to the active list. I've noticed when doing dailies sometimes the game will crash and it seems to be a rare race condition because of how fast rb interacts with windows. So my current plan is to delay adding windows until a few frames have passed. I'd prefer if I could locate a common variable that indicates if a window is finished initialization but i haven't found anything simple like that yet.
       
    2. nt153133

      nt153133 New Member

      Joined:
      Nov 11, 2017
      Messages:
      23
      Likes Received:
      3
      Trophy Points:
      3
      FYI: The update that came out before broke sidestep.

      [07:08:16.787 N] Compiler Error: \Plugins\SideStep\SidestepPlugin.cs(212,60) : error CS0103: The name 'OmenOverrideManager' does not exist in the current context
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Pushing a new build now. I haven't finalized the OOM yet and is still in a work in progress.
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Version 326

      Code:
      AvoidanceManager:
      Weight running out to prefer being closer to the caster to remain in melee range
      Don't progress avoid paths if we won't get any closer then we are now
      
      SideStep:
      Cleanup code
      Add support for cross shaped omens
      
      QuestDevTools:
      Remove alphabetical sorting on the quest list
      Add FlyTo
      Add GetTo
      
       
      hkme likes this.
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Version 327
      Code:
      
      Weight the EXP buffing items heavier.
      
      Sidestep:
      Loosen the filters on what mobs to exclude
      
      
       
    6. nt153133

      nt153133 New Member

      Joined:
      Nov 11, 2017
      Messages:
      23
      Likes Received:
      3
      Trophy Points:
      3
      I'll post this as on official bug but i've yet to come across a solution. In the 6 trust dungeons (all of which are also MSQ duties in ShB) only 2 of them have the correct InstanceContentDirector structure to return the ActiveObjectives. It returns all other InstanceContentDirector info fine but the objectives that are suppose to be at +0x12E8 points to 0 and count is 0. I can't find a 12 byte structure array that the others use. Dohn Mheg and The Grand Cosmos are the only trusts that return the normal 6 active objectives and their statuses. I've checked for days using CE and I can't find a corresponding pointer get them, the 4 dungeons Holminster Switch, The Qitana Ravel, Malikah's Well, Amaurot all don't list the objectives but in game they have the same 6 basic objectives the other 2 have...get to zone, clear zone x3. I find it odd that 4 duties wouldn't use the same struct but they don't even call the same functions that the others do when updating objectives. I try to only point out issues i can find a solution to but this one has me stumped.
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Breakpoint on access the one that it works, note the functions that get called. Go into the dungeon it doesn't work in, see if the breakpoint gets triggered. Try using ghidra
       
    8. nt153133

      nt153133 New Member

      Joined:
      Nov 11, 2017
      Messages:
      23
      Likes Received:
      3
      Trophy Points:
      3
      I've done that, the instructions that happen every time the objectives are updated trigger for all the duties but those 4. Even going up a level to the calling function it doesn't break on them either. It's like they use another function or a vtable call but i can't narrow down a pointer position to check. I don't quite understand the check that is made to see if the objective is complete so I can't check for that but I can load the structs and I can't find a corresponding static address for the objects or the count.
      Amaurot
      Amaurot.png
      The grand cosmos
      the grand cosmos.png
       
    9. Hellbeast

      Hellbeast Member

      Joined:
      Mar 17, 2015
      Messages:
      37
      Likes Received:
      0
      Trophy Points:
      6
      Hello, everyone this still don't work?
      <GatheringSkillOrder>
      <GatheringSkill SpellName="The Twelve's Bounty" TimesToCast="1" />
      </GatheringSkillOrder>
       
    10. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Thanks for reminding me. I'll try and get a build out shortly.
       
    11. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Version 329

      Code:
      
      ActionManager:
      
      CanCast will no longer do a range/los check when a unit other then the player is passed for self cast spell. This matches the ingame behavior more closely and will allow cleaner kupo routines to be written.
      
      Updated the list of gathering spells for gathertag
      
      
       
    12. Hellbeast

      Hellbeast Member

      Joined:
      Mar 17, 2015
      Messages:
      37
      Likes Received:
      0
      Trophy Points:
      6
      possible only for me but <GatheringSkill SpellName="The Twelve's Bounty" TimesToCast="1" /> still won't work for fire shards gathering
      Strnage but SpellName="The Twelve's Bounty" don't work and SpellName="Solid Reason" works fine

      Also now there is an option in gathereing window (Enable quick gathering) is any possibility to use that opnion using bot?
       
      Last edited: Nov 11, 2019
    13. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63

      There is actually a typo in the game data.

      [​IMG]

      it uses a lower case t for "the", im going to add a hardcode override as I think many people would get caught by that.

      As for the auto gather, no. It shouldn't be any faster then what the bot will do on its own.
       
    14. Hellbeast

      Hellbeast Member

      Joined:
      Mar 17, 2015
      Messages:
      37
      Likes Received:
      0
      Trophy Points:
      6
      Big, thx and waitng for new hardcode version of that spell version
       
    15. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      It's building now. Should be ready in a few minutes.
       
    16. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Version 331

      Code:
      GatheringTag has updated skill list it can use
      
      
      GetTo:
      Add a small fix so the ostall imperative aetheryte will be used
      
      
       
    17. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      394
      Likes Received:
      15
      Trophy Points:
      18
      Just going to sneak in a quick, "any news on the loot window"?

      Thanks for all the work! Running smooth as can be expected.
       
    18. Hellbeast

      Hellbeast Member

      Joined:
      Mar 17, 2015
      Messages:
      37
      Likes Received:
      0
      Trophy Points:
      6
      Thx, it works now perfectly.
       
    19. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      394
      Likes Received:
      15
      Trophy Points:
      18
      Also, this is a really silly request, but, have you, or do you, done any packet editing?

      I ask because a tool I use: https://github.com/goaaats/FFXIVQuickLauncher just added an update that allows for changing the background music by passing in an int to the "Zone Packet". I assume you can read it the same place, or close, to where you pull Zone info out (WorldManager), but I could also just be completely mistaken. Anywho, the ability to set up a plugin to do this would be a fun little side project for me, and I wanted to see about adding in an API for it to RB.

      Code below:

      Code:
      private void OnBgmSetCommand(string command, string arguments)
              {
                  this.Framework.Network.InjectBgmTest(int.Parse(arguments));
              }
      Code:
                  this.CommandManager.AddHandler("/xlbgmset", new CommandInfo(new CommandInfo.HandlerDelegate(this.OnBgmSetCommand))
                  {
                      HelpMessage = "Set the Game background music. Usage: /bgmset <BGM ID>"
                  });
      Code:
      using Dalamud;
      using Dalamud.Game;
      using Dalamud.Game.Internal;
      using Dalamud.Hooking;
      using Serilog;
      using System;
      using System.Collections.Generic;
      using System.Runtime.CompilerServices;
      using System.Runtime.InteropServices;
      
      namespace Dalamud.Game.Internal.Network
      {
          public sealed class GameNetwork : IDisposable
          {
              private readonly Hook<GameNetwork.ProcessZonePacketDelegate> processZonePacketHook;
      
              private IntPtr baseAddress;
      
              public GameNetwork.OnZonePacketDelegate OnZonePacket;
      
              private readonly Dalamud dalamud;
      
              private readonly Queue<byte[]> zoneInjectQueue = new Queue<byte[]>();
      
              private GameNetworkAddressResolver Address
              {
                  get;
              }
      
              public GameNetwork(Dalamud dalamud, SigScanner scanner)
              {
                  this.dalamud = dalamud;
                  this.Address = new GameNetworkAddressResolver();
                  this.Address.Setup(scanner);
                  Log.Verbose<IntPtr>("ProcessZonePacket address {ProcessZonePacket}", this.Address.ProcessZonePacket);
                  this.processZonePacketHook = new Hook<GameNetwork.ProcessZonePacketDelegate>(this.Address.ProcessZonePacket, new GameNetwork.ProcessZonePacketDelegate(this.ProcessZonePacketDetour), this);
              }
      
              public void Dispose()
              {
                  this.processZonePacketHook.Dispose();
              }
      
              public void Enable()
              {
                  this.processZonePacketHook.Enable();
              }
      
              private void InjectActorControl(short cat, int param1)
              {
                  byte[] numArray = new byte[] { 20, 0, 100, 1, 0, 0, 14, 0, 23, 124, 197, 93, 0, 0, 0, 0, 5, 0, 72, 178, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 127, 0, 0 };
                  BitConverter.GetBytes(cat).CopyTo(numArray, 16);
                  BitConverter.GetBytes((uint)param1).CopyTo(numArray, 20);
                  this.InjectZoneProtoPacket(numArray);
              }
      
              public void InjectBgmTest(int key)
              {
                  this.InjectActorControl(161, key);
              }
      
              private void InjectZoneProtoPacket(byte[] data)
              {
                  this.zoneInjectQueue.Enqueue(data);
              }
      
              private void ProcessZonePacketDetour(IntPtr a, IntPtr b, IntPtr dataPtr)
              {
                  string str;
                  this.baseAddress = a;
                  GameNetwork.OnZonePacketDelegate onZonePacket = this.OnZonePacket;
                  if (onZonePacket != null)
                  {
                      onZonePacket(dataPtr);
                  }
                  else
                  {
                  }
                  try
                  {
                      this.processZonePacketHook.Original(a, b, dataPtr);
                  }
                  catch (Exception exception2)
                  {
                      Exception exception = exception2;
                      try
                      {
                          byte[] numArray = new byte[32];
                          Marshal.Copy(dataPtr, numArray, 0, 32);
                          str = BitConverter.ToString(numArray);
                      }
                      catch (Exception exception1)
                      {
                          str = "failed";
                      }
                      Log.Error(exception, string.Concat("Exception on ProcessZonePacket hook. Header: ", str));
                      this.processZonePacketHook.Original(a, b, dataPtr);
                  }
              }
      
              /// <summary>
              ///     Process a chat queue.
              /// </summary>
              public void UpdateQueue(Framework framework)
              {
                  while (this.zoneInjectQueue.Count > 0)
                  {
                      byte[] numArray = this.zoneInjectQueue.Dequeue();
                      IntPtr intPtr = Marshal.AllocHGlobal((int)numArray.Length);
                      Marshal.Copy(numArray, 0, intPtr, (int)numArray.Length);
                      if (this.baseAddress != IntPtr.Zero)
                      {
                          this.processZonePacketHook.Original(this.baseAddress, IntPtr.Zero, intPtr);
                      }
                      Marshal.FreeHGlobal(intPtr);
                  }
              }
      
              public delegate void OnZonePacketDelegate(IntPtr dataPtr);
      
              [UnmanagedFunctionPointer(CallingConvention.ThisCall)]
              private delegate void ProcessZonePacketDelegate(IntPtr a, IntPtr b, IntPtr dataPtr);
          }
      }
      Thank you!
       
    20. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,229
      Likes Received:
      212
      Trophy Points:
      63
      Loot window is on my to do list. RB doesn't have any features for packets at all.
       

    Share This Page