-
-
Notifications
You must be signed in to change notification settings - Fork 16
Offset Manager
LlamaLibrary.Memory.OffsetManager has some new functions
The main two being
SetOffsetClasses()
and
SetOffsetClassesAndAgents()
These functions when called from your own botbase or plugin will look for Offset classes that are in your namespace. They can be within other classes or their own class, main point is they need to be named Offsets and static. Example:
using System;
using LlamaLibrary.Memory.Attributes;
namespace LlamaBotBases.Tester
{
public static class Offsets
{
[Offset("Search 48 89 5C 24 ? 48 89 6C 24 ? 56 48 83 EC ? 8B DA 41 0F B7 E8")]
public static IntPtr ItemDiscardFunc;
[Offset("Search 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 8B FA 33 DB")]
public static IntPtr ItemLowerQualityFunc;
}
}
SetOffsetClasses() will use LL's offset manager to search those patterns and set the respective values. It uses the root namespace of the class that calls the functions so in this case it will search all of the namespace 'LlamaBotBases' including sub-namespaces.
SetOffsetClassesAndAgents() Does the same thing but it also registers any Agents within those namespaces that implement LL's IAgent interface. For a simple example see 'RemoteAgents/AgentRetainerInventory.cs'
So if your botbase/plugin only has offsets then use SetOffsetClasses() if there's also agents use SetOffsetClassesAndAgents().
Also remember to call
OffsetManager.Init();
as well in the constructor. This will trigger LL's own offset search, 99% it will have done nothing because LlamaUtilities should have already called it but there's always someone who will not have that installed and there's protections in place so it won't re-search the LL offsets if another botbase calls Init()