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

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

    1. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      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.
       
    2. Hellbeast

      Hellbeast Member

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

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      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!
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Loot window is on my to do list. RB doesn't have any features for packets at all.
       
    5. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      Likes Received:
      15
      Trophy Points:
      18
      Great to hear, and I figured it was a long shot.

      I'll see about trying to find the memory location and editing thataway instead and post what I find, if I find anything.

      Thanks!
       
    6. woode323

      woode323 Member

      Joined:
      Apr 1, 2012
      Messages:
      41
      Likes Received:
      1
      Trophy Points:
      8
      FF servers are up with new patch!
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Offsets updated. I'll do a full release update after I wake up.
       
    8. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Version 332

      Code:
      
      Update for ff14 5.11
      
      Warrior routine updated
      
      Fatebot will now target forlorn maiden when nearby.
      
      
      
       
    9. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      Do you know why the nav server decides to disconnect instead of either returning a path or saying it can't navigate there? I've heard other complain about just getting nav disconnect but this was the first time i found a repeatable example. I'm working on generating Sightseeing log profiles and some if it can't get there it just throw an exception, this one it starts flying and then you get just get disconnected from nav repeatably. I had someone else run it with the same result.


      ....to infinity while the character just flys off in a straight line

      Here's one in heavensward that does the same in case you can't test in shb zone
      <TeleportTo AetheryteId="76"/>
      <FlyTo ZoneId="398" XYZ="-298.218, 406.622, 40.5729" Name="Anyx Trine" ArrivalTolerance="0.5" Land="true" AllowedVariance="0.0"/>
       

      Attached Files:

      Last edited: Nov 17, 2019
    10. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      It has todo with the bot checking if the final location is "indoors", a poorly ported over concept from honorbuddy. It's something ive been working on lately and except to have a update soon.
       
    11. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      In the next update or so do think you could add the Chocobo bags to the InventoryBagId enum? they are:
      Code:
      Saddlebag_Page1 = 4000,
      
      Saddlebag_Page2 = 4001,
      PremiumSaddlebag_Page1 = 4100,
      PremiumSaddlebag_Page2 = 4101
      I'm not sure how you want to name them, it's not important.
       
    12. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Hrm, have you tested using the premium saddlebags without having the premium service? I know not adding this to enum wouldn't prevent that, just curious.
       
    13. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      I tested them without premium service, they are just bags with a capacity of 35 with no items with an ID > 0. Seems to work the same as regular saddlebags or the retainer bags if you haven't opened a retainer since login or opened the saddle bags.
       
    14. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Version 333

      Code:
      Additions:
      Spell.Image added, returns image for a given spell.
      More paths added to GetTo
      
      Bug Fixes:
      Vector3.Raycast will now return the correct value
      Corrected issues with antistuck logic not checking the correct direction
      Fix descending while swimming
      
      
      
      
      
      
       
    15. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      Thanks for the raycast and antistuck fixes. I noticed your Repair remote window does not have an open and the agent interface toggle doesn't open it (agent 36) so in case you were interested this will toggle the window (open if it's closed and close if it's open). Everything is as generic/pattern matching as i could. Just figured i'd pass it along, I made a self repair orderbot tag with it though i can't check the patterns against the CN client.


      Code:
      GreyMagic.PatternFinder patternFinder = new GreyMagic.PatternFinder(Core.Memory);
      IntPtr ptr = patternFinder.Find("Search 48 8D 05 ? ? ? ? 48 89 03 B9 ? ? ? ? 4C 89 43 ? Add 3 TraceRelative ") ;
      int AgentId = ff14bot.Managers.AgentModule.FindAgentIdByVtable(ptr);
      IntPtr addr = patternFinder.Find("Search 48 89 5C 24 ? 57 48 83 EC ? 88 51 ? 49 8B F9");
      Core.Memory.CallInjected64<IntPtr>(addr, AgentModule.GetAgentInterfaceById(AgentId).Pointer, 6, 0, 0);
       
    16. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      ActionManager.ToggleRepairWindow()

      Probably should put a dummy function inside the window class tho.

      Thanks for the patterns tho. Agent ids can shift around every version so we use their vtables to track where they are.
       
    17. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      oh...welp it was a learning exercise i guess :)
       
    18. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8
      Ok this i know isn't a lost API. Can you fix public ff14bot.Objects.LocalPlayer Dictionary<ClassJobType, ushort> Levels? Your private ClassJobType[] in the LocalPlayer Class is missing Gunbreaker and dancer at the end... i'm not sure which comes first but the array is now 28 classes.
       
    19. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,215
      Likes Received:
      361
      Trophy Points:
      83
      Version 336
      Code:
      
      Use a custom protobuff serializer. This will prevent 3rd party addons that also use protobuff (lisbeth) from corrupting network messages.
      
      Resolves issue with orderbot randomly failing due to "Type 1 unsupported path type" errors
      
      
       
    20. nt153133

      nt153133 Member

      Joined:
      Nov 11, 2017
      Messages:
      68
      Likes Received:
      7
      Trophy Points:
      8

    Share This Page