Skip to content

Commit f6a39fb

Browse files
committed
AutoHook 3.0.0.6 [PUSH]
Woe, Cordials Be Upon Ye #124
1 parent 1e92857 commit f6a39fb

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

AutoHook/AutoHook.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<Authors>Det</Authors>
5-
<Version>3.0.0.5</Version>
5+
<Version>3.0.0.6</Version>
66
<Description>Auto hooks for you</Description>
77
<PackageProjectUrl>https://github.com/InitialDet/AutoHook</PackageProjectUrl>
88
<Configurations>Release;Debug</Configurations>

AutoHook/Classes/AutoCasts/AutoCordial.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public override bool CastCondition()
3737

3838
foreach (var (id, recovery) in cordialList)
3939
{
40-
4140
if (!PlayerResources.HaveCordialInInventory(id, out bool isHq))
4241
continue;
4342

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

5150
var notOvercaped = PlayerResources.GetCurrentGp() + cordialRecovery < PlayerResources.GetMaxGp();
52-
return notOvercaped && PlayerResources.IsPotOffCooldown();
51+
return notOvercaped;
5352
}
5453

5554
return false;

AutoHook/PluginUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,14 @@ private void Debug()
130130
ImGui.PopID();
131131
}
132132

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

141142
}
142143
}

AutoHook/Utils/PlayerResources.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using AutoHook.Classes;
55
using AutoHook.Data;
66
using FFXIVClientStructs.FFXIV.Client.Game;
7+
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
78
using Lumina.Excel.GeneratedSheets;
89
using LuminaAction = Lumina.Excel.GeneratedSheets.Action;
910
using Task = System.Threading.Tasks.Task;
@@ -139,14 +140,22 @@ public static unsafe uint ActionStatus(uint id, ActionType actionType = ActionTy
139140
=> _actionManager->GetActionStatus(actionType, id);
140141

141142
public static unsafe bool CastAction(uint id, ActionType actionType = ActionType.Action)
142-
=> _actionManager->UseAction(actionType, id);
143+
{
144+
if (_actionManager == null)
145+
_actionManager = ActionManager.Instance();
146+
147+
return _actionManager->UseAction(actionType, id);
148+
}
149+
143150

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

147154
public static unsafe void UseItems(uint id)
148-
=> _actionManager->UseAction(ActionType.Item, id, a4: 65535);
149-
155+
{
156+
if (InventoryManager.Instance()->GetInventoryItemCount(id) > 0)
157+
AgentInventoryContext.Instance()->UseItem(id);
158+
}
150159

151160
// RecastGroup 68 = Cordial pots
152161
public static unsafe bool IsPotOffCooldown()

0 commit comments

Comments
 (0)