Hello,
Is there a way that I can add a check to see if the bot is in the "ToTown" state?
I am tinkering with a bot pausing that I like as I find the functionality in advanced settings to be unreliable, which is a different issue. Even with 500 yards and 0 seconds run time it does not pause
I would like to create a stopbot function that respects players vicinity and pauses straight away, however does not break the "totown" functionality
I am using the below (from the StopBot.cs) to identify when a player is near, and adding a check for an extended pause duration
The problem is that once the bot is on the way to town and encounters its first player, it goes into pause. Which would be fine since it will suppress after a duration. However, the bot upon supressing the pause has forgotten it was on the way to town and goes back to the grinding spot
Is there a way that I can add a check to see if the bot was in the "ToTown" state, so that it does not force the bot to pause, but allows it to run
Thanks!
foreach (var wowPlayer in ObjectManager.GetObjectWoWPlayer() )
{
if (wowPlayer.Name != null && wowPlayer.GetDistance<60 && !ObjectManager.Target.IsAlive)
{
playerPresent = 1;
Logging.Write("Other Player in range detected: "+wowPlayer.Name+" "+wowPlayer.GetDistance.ToString());
//Lua.LuaDoString("Dismount();");
//Thread.Sleep(10);
//Products.InPause = true;
}
}
if (playerPresent == 0)
{
Products.InPause = false;
Thread.Sleep(10);
} else {
Logging.Write("Currently been waiting for: "+timeinpause);
timeinpause = timeinpause +1;
Thread.Sleep(1000);
}
if (timeinpause > 10) {
Products.InPause = false;
Logging.Write("I probably got stuck on my way to town, surpressing for 40 sec");
timeinpause = 0;
Thread.Sleep(40000);
}