muffin v7.4.10

This commit is contained in:
alydev 2026-01-19 08:31:23 +10:00
parent 2df81c5d15
commit b8dd142c23
47 changed files with 3604 additions and 1058 deletions

View file

@ -9,6 +9,7 @@ using FFXIVClientStructs.FFXIV.Client.System.Input;
using FFXIVClientStructs.FFXIV.Client.UI;
using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.Common;
using Questionable.Controller.Utils;
using Questionable.Model;
using Questionable.Model.Questing;
@ -67,7 +68,7 @@ internal static class Dive
return ETaskResult.StillRunning;
}
logger.LogDebug("{Action} key {KeyCode:X2}", (result.Item1 == 256) ? "Pressing" : "Releasing", result.Item2);
NativeMethods.SendMessage((nint)Device.Instance()->hWnd, result.Item1, result.Item2, IntPtr.Zero);
WindowsKeypress.SendMessage((nint)Device.Instance()->hWnd, result.Item1, result.Item2);
if (result.Item1 == 256)
{
_pressedKeys.Add(result.Item2);
@ -86,7 +87,7 @@ internal static class Dive
foreach (nint pressedKey in _pressedKeys)
{
logger.LogDebug("Releasing stuck key {KeyCode:X2} on stop", pressedKey);
NativeMethods.SendMessage((nint)Device.Instance()->hWnd, 257u, pressedKey, IntPtr.Zero);
WindowsKeypress.SendMessage((nint)Device.Instance()->hWnd, 257u, pressedKey);
}
_pressedKeys.Clear();
_keysToPress.Clear();
@ -160,17 +161,6 @@ internal static class Dive
}
}
private static class NativeMethods
{
public const uint WM_KEYUP = 257u;
public const uint WM_KEYDOWN = 256u;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern nint SendMessage(nint hWnd, uint Msg, nint wParam, nint lParam);
}
private static List<nint>? GetKeysToPress(SeVirtualKey key, KeyModifierFlag modifier)
{
List<nint> list = new List<nint>();

View file

@ -135,25 +135,28 @@ internal static class Duty
{
throw new TaskException("Failed to get territory ID for content finder condition");
}
InventoryManager* intPtr = InventoryManager.Instance();
if (intPtr == null)
if (base.Task.DutyMode != AutoDutyIpc.DutyMode.UnsyncRegular)
{
throw new TaskException("Inventory unavailable");
}
InventoryContainer* inventoryContainer = intPtr->GetInventoryContainer(InventoryType.EquippedItems);
if (inventoryContainer == null)
{
throw new TaskException("Equipped items unavailable");
}
short num = gearStatsCalculator.CalculateAverageItemLevel(inventoryContainer);
if (contentFinderConditionData.RequiredItemLevel > num)
{
string text = $"Could not use AutoDuty to queue for {contentFinderConditionData.Name}, required item level: {contentFinderConditionData.RequiredItemLevel}, current item level: {num}.";
if (!sendNotificationExecutor.Start(new SendNotification.Task(EInteractionType.Duty, text)))
InventoryManager* intPtr = InventoryManager.Instance();
if (intPtr == null)
{
chatGui.PrintError(text, "Questionable", 576);
throw new TaskException("Inventory unavailable");
}
InventoryContainer* inventoryContainer = intPtr->GetInventoryContainer(InventoryType.EquippedItems);
if (inventoryContainer == null)
{
throw new TaskException("Equipped items unavailable");
}
short num = gearStatsCalculator.CalculateAverageItemLevel(inventoryContainer);
if (contentFinderConditionData.RequiredItemLevel > num)
{
string text = $"Could not use AutoDuty to queue for {contentFinderConditionData.Name}, required item level: {contentFinderConditionData.RequiredItemLevel}, current item level: {num}.";
if (!sendNotificationExecutor.Start(new SendNotification.Task(EInteractionType.Duty, text)))
{
chatGui.PrintError(text, "Questionable", 576);
}
return false;
}
return false;
}
autoDutyIpc.StartInstance(base.Task.ContentFinderConditionId, base.Task.DutyMode);
return true;

View file

@ -11,7 +11,6 @@ using FFXIVClientStructs.FFXIV.Client.Game.UI;
using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.Shared;
using Questionable.Controller.Utils;
using Questionable.External;
using Questionable.Functions;
using Questionable.Model;
using Questionable.Model.Questing;
@ -20,7 +19,7 @@ namespace Questionable.Controller.Steps.Interactions;
internal static class Interact
{
internal sealed class Factory(AutomatonIpc automatonIpc, Configuration configuration) : ITaskFactory
internal sealed class Factory(Configuration configuration) : ITaskFactory
{
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
{
@ -41,7 +40,7 @@ internal static class Interact
}
else if (step.InteractionType == EInteractionType.Snipe)
{
if (!automatonIpc.IsAutoSnipeEnabled)
if (!configuration.General.AutoSnipe)
{
yield break;
}
@ -73,21 +72,21 @@ internal static class Interact
SkipStepConditions stepIf = skipConditions.StepIf;
if (stepIf != null && stepIf.Never)
{
goto IL_0247;
goto IL_024f;
}
}
if (step.InteractionType != EInteractionType.PurchaseItem)
{
skipMarkerCheck = ((step.DataId == 1052475) ? 1 : 0);
goto IL_0248;
goto IL_0250;
}
}
goto IL_0247;
IL_0247:
goto IL_024f;
IL_024f:
skipMarkerCheck = 1;
goto IL_0248;
IL_0248:
yield return new Task(value, quest, interactionType2, (byte)skipMarkerCheck != 0, step.PickUpItemId, step.TaxiStandId, step.SkipConditions?.StepIf, step.CompletionQuestVariablesFlags);
goto IL_0250;
IL_0250:
yield return new Task(value, quest, interactionType2, (byte)skipMarkerCheck != 0, step.PickUpItemId ?? step.GCPurchase?.ItemId, step.TaxiStandId, step.SkipConditions?.StepIf, step.CompletionQuestVariablesFlags);
}
}