i'm using the Arreat Core Profile (starting just in front of azmodan).
The bot itself uses to automatically start a new game, as soon as you leave the game. so, using that particular profile it should be possible to just leave the game when it's stuck. I changed the unstucker cs a bit. I'm at work, can't test myself. maybe someone else can? (In theory it should work with every profile where you don't start in town.
untested, use at own risk - but nothing will happen. if you get stuck, you're stuck anyway
(Edit: all credits to eax/keantab, just removed some lines of code)
The bot itself uses to automatically start a new game, as soon as you leave the game. so, using that particular profile it should be possible to just leave the game when it's stuck. I changed the unstucker cs a bit. I'm at work, can't test myself. maybe someone else can? (In theory it should work with every profile where you don't start in town.
untested, use at own risk - but nothing will happen. if you get stuck, you're stuck anyway

(Edit: all credits to eax/keantab, just removed some lines of code)
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows;
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Common.Plugins;
using Zeta.Internals;
using Zeta.Internals.Actors;
using Zeta.Internals.Service;
namespace Eax.Plugins
{
public class Unstucker : IPlugin
{
private bool IsRestarting { get; set; }
private bool IsChecking { get; set; }
private DateTime LastCheckTime { get; set; }
private DateTime LastLogTime { get; set; }
private List<Vector3> LoggedPositions { get; set; }
public string Author { get { return "eax"; } }
public string Description { get { return "Unstucks you when you're stuck."; } }
public string Name { get { return "Unstucker v" + Version.ToString(); } }
public Version Version { get { return new Version(1, 5); } }
public Window DisplayWindow { get { return null; } }
private void Log(string message)
{
Logging.Write(string.Format("[{0}] {1}", Name, message));
}
private static float GetMaxDistanceTraveled(List<Vector3> positions)
{
float max = 0F;
for (int i = 0; i < positions.Count - 1; ++i)
for (int j = 1; j < positions.Count; ++j)
max = Math.Max(max, Math.Abs(positions.Distance(positions[j])));
return max;
}
public void OnInitialize()
{
IsRestarting = false;
IsChecking = false;
LastCheckTime = DateTime.Now;
LastLogTime = DateTime.Now;
LoggedPositions = new List<Vector3>();
}
public void OnPulse()
{
// if we're not in game and not in the process of restarting, do nothing
if (!ZetaDia.IsInGame || !ZetaDia.Me.IsValid || IsRestarting)
{
LastCheckTime = DateTime.Now;
LastLogTime = DateTime.Now;
LoggedPositions.Clear();
return;
}
// if it's been 3 seconds since we've logged a position, then we log a new position
if (DateTime.Now.Subtract(LastLogTime).TotalSeconds > 3)
{
LastLogTime = DateTime.Now;
LoggedPositions.Add(ZetaDia.Actors.Me.Position);
}
// if it's been 40 seconds since we've last evaluated the logged positions, evaluate the logged positions
if (!IsChecking && (LoggedPositions.Count > 5) && (DateTime.Now.Subtract(LastCheckTime).TotalSeconds > 40))
{
// we want to prevent this section from being executed twice
IsChecking = true;
// if our person has not traveled 10 yards or whatever in the last 40 seconds, we're stuck
if (GetMaxDistanceTraveled(LoggedPositions) < 10f)
{
IsRestarting = true;
Log("Your character has not moved 10 yards for 40 seconds - leaving game.");
Thread.Sleep(2000);
ZetaDia.Service.Games.LeaveGame();
while (ZetaDia.IsInGame)
Thread.Sleep(2000);
IsRestarting = false;
}
IsChecking = false;
LastCheckTime = DateTime.Now;
LastLogTime = DateTime.Now;
LoggedPositions.Clear();
}
}
public void OnShutdown()
{
}
public void OnEnabled()
{
Log("Enabled.");
}
public void OnDisabled()
{
Log("Disabled.");
}
public bool Equals(IPlugin other)
{
return (other.Name == Name) && (other.Version == Version);
}
}
}
Last edited: