private int getAgent() { var patternFinder = new PatternFinder(Core.Memory); IntPtr agentVtable = patternFinder.Find("48 8D 05 ? ? ? ? 48 89 51 ? 48 89 01 48 8B F9 48 8D 05 ? ? ? ? 4C 89 79 ? Add 3 TraceRelative"); return(AgentModule.FindAgentIdByVtable(agentVtable)); }
protected override async Task <bool> RunAsync() { AtkAddonControl window = RaptureAtkUnitManager.GetWindowByName(_windowName); if (window == null) { PatternFinder patternFinder = new PatternFinder(Core.Memory); IntPtr agentVtable = patternFinder.Find(_agentOffset); int agentId = AgentModule.FindAgentIdByVtable(agentVtable); AgentModule.GetAgentInterfaceById(agentId).Toggle(); await Coroutine.Wait(5000, () => RaptureAtkUnitManager.GetWindowByName(_windowName) != null); window = RaptureAtkUnitManager.GetWindowByName(_windowName); } if (window != null) { // Choose Dungeon window.SendAction(2, 3, 15, 4, (ulong)Dungeon - 1); await Coroutine.Sleep(250); // Register for Duty window.SendAction(1, 3, 14); } return(false); }
Offsets() { using (Core.Memory.AcquireFrame()) { InitializeValue(ref AgentMvpVTable, nameof(AgentMvpVTable), "48 8D 05 ? ? ? ? 48 89 03 33 C0 48 89 43 28 89 43 30 48 8B C3 48 83 C4 ? 5B C3 CC CC CC CC CC CC 40 53 Add 3 TraceRelative"); InitializeValue(ref AgentNotificationVTable, nameof(AgentNotificationVTable), "48 8D 05 ? ? ? ? 48 8B D9 48 89 01 E8 ? ? ? ? 48 8B CB E8 ? ? ? ? 48 8B CB 48 83 C4 ? 5B E9 ? ? ? ? CC CC CC CC Add 3 TraceRelative"); InitializeValue(ref AnimationLockTimer, nameof(AnimationLockTimer), "48 8D 0D ? ? ? ? E8 ? ? ? ? 8B F8 8B CF Add 3 TraceRelative Add 8"); InitializeValue(ref MarkingFunc, nameof(MarkingFunc), "48 89 5C 24 10 48 89 6C 24 18 57 48 83 EC ? 8D 42 FF"); InitializeValue(ref MarkingParam1, nameof(MarkingParam1), "48 8D 0D ? ? ? ? E8 ? ? ? ? 84 C0 74 ? 45 32 C9 Add 3 TraceRelative"); InitializeValue(ref GroundSpeedWriteFunc, nameof(GroundSpeedWriteFunc), "F3 0F 11 73 44 0F 28 74 24 40"); InitializeValue(ref CombatReachWriteFunc, nameof(CombatReachWriteFunc), "F3 0F 10 83 C0 00 00 00 48 83 C4 ?"); InitializeValue(ref GcdWriteFunc, nameof(GcdWriteFunc), "F3 0F 11 70 0C 0F 28 74 24 20 48 83 C4 ?"); InitializeValue(ref CurrentSpellTimeFunc, nameof(CurrentSpellTimeFunc), "F3 0F 11 05 ? ? ? ? 41 F6 46 36 ? 75 ?"); InitializeValue(ref CurrentSpellTimePtr, nameof(CurrentSpellTimePtr), "F3 0F 11 05 ? ? ? ? 41 F6 46 36 ? 75 ? Add 4 TraceRelative"); InitializeValue(ref MySpellCastTimeWriteFunc, nameof(MySpellCastTimeWriteFunc), "F3 0F 11 77 38 48 8B 5C 24 40"); InitializeValue(ref Conditions, nameof(Conditions), "48 8D 0D ? ? ? ? 45 33 C0 41 8D 51 69 Add 3 TraceRelative"); InitializeValue(ref KnockbackFunc, nameof(KnockbackFunc), "E8 ? ? ? ? 48 8B 9C 24 A0 00 00 00 4C 8D 9C 24 90 00 00 00"); InitializeValue(ref LootFunc, nameof(LootFunc), "E8 ? ? ? ? EB 4A 48 8D 4F 10 Add 1 TraceRelative"); InitializeValue(ref LootsAddr, nameof(LootsAddr), "48 8D 0D ? ? ? ? E8 ? ? ? ? 89 44 24 60 Add 3 TraceRelative"); InitializeValue(ref TraderTradeStage, nameof(TraderTradeStage), "83 3D ? ? ? ? ? 7F ? Add 2 TraceRelative Add 5"); InitializeValue(ref TargetManager, nameof(TargetManager), "48 8B 05 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? FF 50 ?? 48 85 DB Add 3 TraceRelative"); InitializeValue(ref AnimationSpeedWriteFunc, nameof(AnimationSpeedWriteFunc), "F3 0F ? ? ? ? ? ? ? 80 89 D2 01 00 00"); InitializeValue(ref SkipTalk, nameof(SkipTalk), "80 B9 3A 05 00 00 ? 75 ?"); AgentNotificationId = AgentModule.FindAgentIdByVtable(AgentNotificationVTable); AgentMvpId = AgentModule.FindAgentIdByVtable(AgentMvpVTable); } }
protected async Task <bool> InitiateLeve() { // if (Core.Player.IsMounted) // { // ActionManager.Dismount(); // await Coroutine.Wait(20000, () => !Core.Player.IsMounted); // await Coroutine.Sleep(500); // } var patternFinder = new GreyMagic.PatternFinder(Core.Memory); IntPtr SearchResult = patternFinder.Find("48 8D 05 ? ? ? ? 48 89 54 24 ? 48 89 03 Add 3 TraceRelative"); int agent = AgentModule.FindAgentIdByVtable(SearchResult); AgentModule.ToggleAgentInterfaceById(agent); await Coroutine.Sleep(500); AtkAddonControl windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail"); while (windowByName == null) { await Coroutine.Sleep(500); windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail"); } if (windowByName != null) { var leves = LeveManager.Leves; if (leves.Length > 0) { foreach (ff14bot.Managers.LeveWork leve in leves) { if (leve.GlobalId == LeveId && leve.Step == 1) { ulong globalId = (ulong)leve.GlobalId; windowByName.SendAction(3, 3, 0xC, 3, globalId, 3, 2); //Set Quest await Coroutine.Sleep(200); windowByName.SendAction(2, 3, 4, 4, globalId); //Initiate if (await Coroutine.Wait(10000, () => SelectYesno.IsOpen)) { SelectYesno.ClickYes(); } await Coroutine.Sleep(2000); RaptureAtkUnitManager.GetWindowByName("GuildLeveDifficulty").SendAction(1, 3, 0); await Coroutine.Sleep(3000); break; } } } windowByName = RaptureAtkUnitManager.GetWindowByName("JournalDetail"); if (windowByName != null) { AgentModule.ToggleAgentInterfaceById(agent); } } return(_done = true); }
public ContentsInfo() : base(WindowName) { _name = WindowName; var patternFinder = new GreyMagic.PatternFinder(Core.Memory); IntPtr agentVtable = patternFinder.Find("48 8D 05 ? ? ? ? BF ? ? ? ? 48 89 03 48 8D 73 ? Add 3 TraceRelative"); _agentId = AgentModule.FindAgentIdByVtable(agentVtable); }
public override void OnInitialize() { TreeRoot.OnStart += OnBotStart; TreeRoot.OnStop += OnBotStop; Repairing = false; var patternFinder = new PatternFinder(Core.Memory); var off = patternFinder.Find("4C 8D 0D ? ? ? ? 45 33 C0 33 D2 48 8B C8 E8 ? ? ? ? Add 3 TraceRelative"); var func = patternFinder.Find("48 89 5C 24 ? 57 48 83 EC ? 88 51 ? 49 8B F9"); var vtable = patternFinder.Find("48 8D 05 ? ? ? ? 48 89 03 B9 ? ? ? ? 4C 89 43 ? Add 3 TraceRelative"); var repairAgent = AgentModule.FindAgentIdByVtable(vtable); //Core.Memory.CallInjected64<IntPtr>(func, AgentModule.GetAgentInterfaceById(AgentId).Pointer, 0, 0, off); Log($"AgentId {AgentId} Offset {off.ToInt64():X} Func {func.ToInt64():X}"); AgentId = repairAgent; _root = new Decorator(r => Repairing, RepairBehavior); //_root = new Decorator(r => Repairing, new ActionAlwaysSucceed()); }
public static async Task RepairAll() { if (InventoryManager.EquippedItems.Any(item => item.Item != null && item.Item.RepairItemId != 0 && item.Condition < 50)) { Log("Repairing items."); await StopBusy(leaveDuty : false, stopFishing : false, dismount : false); if (!Repair.IsOpen) { var repairVTable = Offsets.RepairVTable; var repairVendor = Offsets.RepairVendor; var repairWindow = Offsets.RepairWindowOpen; var repairAgent = AgentModule.FindAgentIdByVtable(repairVTable); var AgentId = repairAgent; Log($"OPEN: AgentId {AgentId} Offset {repairVendor.ToInt64():X} Func {repairWindow.ToInt64():X}"); lock (Core.Memory.Executor.AssemblyLock) { Core.Memory.CallInjected64 <IntPtr>(repairWindow, new object[4] { ff14bot.Managers.AgentModule.GetAgentInterfaceById(AgentId).Pointer, 0, 0, repairVendor }); } await Coroutine.Wait(1500, () => Repair.IsOpen); } Repair.RepairAll(); await Coroutine.Wait(1500, () => SelectYesno.IsOpen); SelectYesno.ClickYes(); Repair.Close(); } else { Log("No items to repair."); } }
internal static void Init() { if (initDone) { return; } var types = typeof(Offsets).GetFields(BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance); Parallel.ForEach(types, type => { var pf = new PatternFinder(Core.Memory); if (type.FieldType.IsClass) { var instance = Activator.CreateInstance(type.FieldType); foreach (var field in type.FieldType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) { var res = ParseField(field, pf); if (field.FieldType == typeof(IntPtr)) { field.SetValue(instance, res); } else { field.SetValue(instance, (int)res); } } //set the value type.SetValue(null, instance); } else { var res = ParseField(type, pf); if (type.FieldType == typeof(IntPtr)) { type.SetValue(null, res); } else { type.SetValue(null, (int)res); } } } ); bool retaineragent = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.AgentRetainerAskVtable), typeof(AgentRetainerVenture)); bool retainerchar = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.AgentRetainerCharacterVtable), typeof(AgentRetainerCharacter)); bool dawnAgent = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.DawnVtable), typeof(AgentDawn)); bool retainerInventory = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.AgentRetainerInventoryVtable), typeof(AgentRetainerInventory)); //60 bool MateriaMelding = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.AgentMeldVtable), typeof(AgentMeld)); //63 bool OutOnLimb = AgentModule.TryAddAgent(AgentModule.FindAgentIdByVtable(Offsets.AgentOutOnLimbVtable), typeof(AgentOutOnLimb)); //159 Log($"Added Venture Agent: {retaineragent}"); Log($"Added RetainerChar Agent: {retainerchar}"); Log($"Added Dawn(Trust) Agent: {dawnAgent}"); Log($"Added RetainerInventory Agent: {retainerInventory}"); Log($"Added MateriaMelding Agent: {MateriaMelding}"); Log($"Added OutOnLimb Agent: {OutOnLimb} {AgentModule.FindAgentIdByVtable(Offsets.AgentOutOnLimbVtable)}"); AddNamespacesToScriptManager(new[] { "LlamaLibrary", "LlamaLibrary.ScriptConditions", "LlamaLibrary.ScriptConditions.Helpers" });// ScriptManager.Init(typeof(ScriptConditions.Helpers)); initDone = true; }