Skip to content

Commit

Permalink
Merge pull request #427 from ffxivcode/Interactables
Browse files Browse the repository at this point in the history
Special Interactables Implementation
  • Loading branch information
Herculezz55 authored Sep 11, 2024
2 parents 05b196b + 07d1ef3 commit 2e609c2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions AutoDuty/AutoDuty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,13 +1334,32 @@ private void CheckRetainerWindow()
AutoRetainerHelper.CloseRetainerWindows();
}

private void InteractablesCheck()
{
if (Interactables.Count == 0) return;

var list = Svc.Objects.Where(x => Interactables.Contains(x.DataId));

if (!list.Any()) return;

var index = Actions.Select((Value, Index) => (Value, Index)).Where(x => Interactables.Contains(x.Value.Argument.Any(y => y == ' ') ? uint.Parse(x.Value.Argument.Split(" ")[0]) : uint.Parse(x.Value.Argument))).First().Index;

if (index > Indexer)
{
Indexer = index;
Stage = Stage.Reading_Path;
}
}

private void PreStageChecks()
{
if (Stage == Stage.Stopped)
return;

CheckRetainerWindow();

InteractablesCheck();

if (EzThrottler.Throttle("OverrideAFK") && States.HasFlag(PluginState.Navigating) && ObjectHelper.IsValid)
_overrideAFK.ResetTimers();

Expand Down

0 comments on commit 2e609c2

Please sign in to comment.