Skip to content

additional checks for AR #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions AutoDuty/Helpers/AutoRetainerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ internal override void Start()

internal override void Stop()
{
Plugin.Chat.ExecuteCommand("/autoretainer d");
this._autoRetainerStarted = false;
this._autoRetainerStopped = false;
GotoInnHelper.ForceStop();

base.Stop();
Expand All @@ -41,7 +43,8 @@ internal override void Stop()
AutoRetainer_IPCSubscriber.AbortAllTasks();
}

private bool _autoRetainerStarted = false;
private bool _autoRetainerStarted = false;
private bool _autoRetainerStopped = false;
private IGameObject? SummoningBellGameObject => Svc.Objects.FirstOrDefault(x => x.DataId == SummoningBellHelper.SummoningBellDataIds((uint)Plugin.Configuration.PreferredSummoningBellEnum));

protected override unsafe void HelperStopUpdate(IFramework framework)
Expand All @@ -61,17 +64,31 @@ protected override unsafe void HelperUpdate(IFramework framework)

if (!PlayerHelper.IsValid) return;

if (this._autoRetainerStopped)
{
if (AutoRetainer_IPCSubscriber.IsBusy())
{
this._autoRetainerStopped = false;
}
else
{
this.Stop();
return;
}
}

if (!this._autoRetainerStarted && AutoRetainer_IPCSubscriber.IsBusy())
{
DebugLog("AutoRetainer has Started");
this._autoRetainerStarted = true;
UpdateBaseThrottle = 1000;
return;
}
else if (this._autoRetainerStarted && !AutoRetainer_IPCSubscriber.IsBusy())
{
DebugLog("AutoRetainer is Complete");
this.Stop();
return;
this._autoRetainerStopped = true;
EzThrottler.Throttle(this.Name, 2000, true);
}

if (this.SummoningBellGameObject != null && !SummoningBellHelper.HousingZones.Contains(Player.Territory) && ObjectHelper.GetDistanceToPlayer(this.SummoningBellGameObject) > 4)
Expand Down