//naut's code. I did it about the same time.
// referenced 7 August 2015 https://www.thebuddyforum.com/exilebuddy-forum/community-developer-forum/182083-stuckdetection-2-0-a.html
//if (isStuck)
//{
//...
else if (StuckDetectionSettings.Instance.StuckDetectionMethod ==
StuckDetectionMethods.TpToTownAndRestart)
{
var tttrerr = BasicGrindBotSettings.Instance.NeedsTownRun = 2;
if (!LokiPoe.Me.IsDead && !LokiPoe.Me.IsInTown)
{
Log.ErrorFormat("[StuckDetection] TpToTownAndRestart returned {0}.", tttrerr);
if (AreaStateCache.Current.Explorer != null)
{
Log.InfoFormat("[StuckDetection] Now resetting the explorer.");
AreaStateCache.Current.Explorer.Reset();
}
}
else if (LokiPoe.Me.IsDead)
{
Log.ErrorFormat("[StuckDetection] LogoutToCharacterSelection returned {0}.", LokiPoe.EscapeState.LogoutToTitleScreen());
}
}