What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin] Unstucker - restarts if your character gets stuck

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 :p

(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:
Hey i'm not sure theres much to do about this but when the bot is identifying more than a couple of items, it automatically reconnects.

Is there any way to prevent unstucker while identifying?
 
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 :p

(Edit: all credits to eax/keantab, just removed some lines of code)

It worked once. Left the game after bot got stuck. However, shortly after it made D3 crash and it seems to have the same problem as the original plugin.
 
Last edited:
i recommend you to use if ur not collecting blue/yellow took too much time to id and i hear something that after 3 yellow id d3 drop out db from game.....

Its useful when ur picking gold and u want to 100% afk for hours then its a great thing!! gj:)

Btw any stuff to skip looting priceless pages and priceless gems in nightmare? wasting allot of time to pick them up
 
You can edit item rules. Just delete the page rule, or comment it.
 
the plugin seems to stop the bot once i am stuck...but doesn't do anything afterwards. it just stops the bot, and stay there. not restarting..no anything. does this have a fix that i don't know about? i will appreciate answers. thanks. :)


P.S. thanks eax/keantab for the great effort.
 
Tested it with 5 stucks, all 5 times it said (don't have exact log I'm at job) Didn't move for 40seconds - Restart Bot - Stoppping bot... and that's it.
 
Seems the DemonBuddy API I used got changed, which is probably the source of all these problems. Seemed to work ok when I first made it. Looks like I'll have to update this later.
 
Seems the DemonBuddy API I used got changed, which is probably the source of all these problems. Seemed to work ok when I first made it. Looks like I'll have to update this later.

eax is there anything u can do about those diablo 3 freezes? Cuz plugin does work ok, it stops bot if not moving-->logout-->login and diablo 3 freeze and all is happening all over again :( and then when u want to start bot manually the bot freezes so u have to close diablo3 and bot and reopen them :/ that sucks
 
unofficial update to help my boy eax out - it's currently worked through 2 stucks for me on Demonbuddy 1.0.462.95. Cannot guarantee it will work through all stuck instances as I haven't seen them occur yet.

extract the following to your demonbuddy folder.

View attachment Unstucker_1_6.zip

contains:
/Profiles/1.xml
/Plugins/Unstucker/Unstucker.cs

the profile in the profiles folder is NECESSARY, you can change the content of it to be the profile you want to run but leave the file name the same or unstucker won't work. Dodgy i know but the 'LastProfile' and 'RecentProfiles' that the api exposes is funky (missing the path for the profile..) so cbf working it out.

also i recommend using a profile that is resumeFromSave="False"

cheers, and ty to the creator/s of profile: 'Act 3 - Arreat to Fields of Slaughter - Promise edit.' which i have included as 1.xml as well as eax of course

apologies in advance if it fails for you guys.
 
unofficial update to help my boy eax out - it's currently worked through 2 stucks for me on Demonbuddy 1.0.462.95. Cannot guarantee it will work through all stuck instances as I haven't seen them occur yet.

apologies in advance if it fails for you guys.

I'll try this, running only the 1.xml provided by you. I need to leave for about a day so let's hope the thing works. :) Thanks!
 
Simply remove the Bot.Stop and the Bot.Start and it works quite good again
 
In Desolate sands is a golden chest, within the end of a path which forms a circulation. The bot gets stuck here.
 
I have the plugin on and checked, but just wondering how long it takes before the unstucker
takes effect i.e how many seconds/minutes before it restarts.
Also define stuck, does it have to be trapped behind something, or if there is nothing for
the bot to attack when it gets towards the end of running Core of Arreat (towards the waypoint).
where there is no mobs for it to attack.
Thanks in advance.
 
I commented this Lines out, and now it works since ~3 hours.

//BotMain.Stop();
//Thread.Sleep(2000);

//BotMain.Start();
 
I commented this Lines out, and now it works since ~3 hours.

//BotMain.Stop();
//Thread.Sleep(2000);

//BotMain.Start();

Oh nice. I'll update the download in the original post. Thanks.
 
Back
Top