Skip to content

Commit

Permalink
AutoHook 3.0.0.6 [PUSH]
Browse files Browse the repository at this point in the history
Woe, Cordials Be Upon Ye #124
  • Loading branch information
InitialDet committed Oct 18, 2023
1 parent 1e92857 commit f6a39fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion AutoHook/AutoHook.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>Det</Authors>
<Version>3.0.0.5</Version>
<Version>3.0.0.6</Version>
<Description>Auto hooks for you</Description>
<PackageProjectUrl>https://github.com/InitialDet/AutoHook</PackageProjectUrl>
<Configurations>Release;Debug</Configurations>
Expand Down
3 changes: 1 addition & 2 deletions AutoHook/Classes/AutoCasts/AutoCordial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public override bool CastCondition()

foreach (var (id, recovery) in cordialList)
{

if (!PlayerResources.HaveCordialInInventory(id, out bool isHq))
continue;

Expand All @@ -49,7 +48,7 @@ public override bool CastCondition()
Id = id;

var notOvercaped = PlayerResources.GetCurrentGp() + cordialRecovery < PlayerResources.GetMaxGp();
return notOvercaped && PlayerResources.IsPotOffCooldown();
return notOvercaped;
}

return false;
Expand Down
3 changes: 2 additions & 1 deletion AutoHook/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ private void Debug()
ImGui.PopID();
}

private static void TestButtons()
private static unsafe void TestButtons()
{
if (ImGui.Button(@"Check"))
{
Service.PrintChat("-----------------");
Service.PrintChat("Cordial Available: " + PlayerResources.ActionTypeAvailable(IDs.Item.HiCordial, ActionType.Item));
Service.PrintChat("Cast Available: " + PlayerResources.ActionTypeAvailable(IDs.Actions.Cast));
Service.PrintChat("Quant. Available: " + InventoryManager.Instance()->GetInventoryItemCount(IDs.Item.HiCordial));

}
}
Expand Down
15 changes: 12 additions & 3 deletions AutoHook/Utils/PlayerResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using AutoHook.Classes;
using AutoHook.Data;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Lumina.Excel.GeneratedSheets;
using LuminaAction = Lumina.Excel.GeneratedSheets.Action;
using Task = System.Threading.Tasks.Task;
Expand Down Expand Up @@ -139,14 +140,22 @@ public static unsafe uint ActionStatus(uint id, ActionType actionType = ActionTy
=> _actionManager->GetActionStatus(actionType, id);

public static unsafe bool CastAction(uint id, ActionType actionType = ActionType.Action)
=> _actionManager->UseAction(actionType, id);
{
if (_actionManager == null)
_actionManager = ActionManager.Instance();

return _actionManager->UseAction(actionType, id);
}


public static unsafe int GetRecastGroups(uint id, ActionType actionType = ActionType.Action)
=> _actionManager->GetRecastGroup((int)actionType, id);

public static unsafe void UseItems(uint id)
=> _actionManager->UseAction(ActionType.Item, id, a4: 65535);

{
if (InventoryManager.Instance()->GetInventoryItemCount(id) > 0)
AgentInventoryContext.Instance()->UseItem(id);
}

// RecastGroup 68 = Cordial pots
public static unsafe bool IsPotOffCooldown()
Expand Down

0 comments on commit f6a39fb

Please sign in to comment.