Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!
as I understand, combatbot is limited as all it does is pulse the default combat routine, which might have parameters in groups that makes it not work.
What you want is the Agility botbase, however not all classes are supported on that yet.
Hey Lukov, trying your recommendation as Agility doesn't support Espers yet. Not sure whereabouts in Targeting.cs I should be putting that code though, noob with such things.
I assume it is in:
return GameManager.Actors.Values.Where(a =>
section where there are a lot of if statements, but just not sure.
Hey Lukov, trying your recommendation as Agility doesn't support Espers yet. Not sure whereabouts in Targeting.cs I should be putting that code though, noob with such things.
I assume it is in:
return GameManager.Actors.Values.Where(a =>
section where there are a lot of if statements, but just not sure.
// Make sure the actor is backed by a valid memory address
if (!a.IsValid)
{
return false;
}
if (BlacklistCreatureIds.Contains(a.CreatureId))
return false;
// Obviously can't attack dead stuff!
if (a.IsDead)
{
return false;
}
// Ignore players if PVP isn't enabled.
if (a.ActorType == ActorType.Player && (!isLocalPvpFlagged || !((Player) a).IsPvpFlagged))
return false;
var ci = a.CreatureInfo;
if (ci != null && !ci.CanBeAttacked)
{
return false;
}
// Friendly = 2, Unknown = 3+
// Hostile = 0, Neutral = 1
// We only want to "attack" hostile or neutral actors
if (a.Disposition >= Disposition.Friendly)
{
return false;
}
// The thing isn't in combat, so ignore it.
if (!a.IsInCombat)
{
return false;
}
// If it's targeting us, we want to include it. Even if the combat checks below fail.
if (a.CurrentTargetGuid != 0 && friendlyGuids.Contains(a.CurrentTargetGuid))
{
return true;
}
// If it's tagged by us, or our group, go ahead and include it. Even if it's not our main priority.
if (a.TaggedByLocalPlayer || a.TaggedByLocalPlayerGroup)
{
return true;
}
return false;
}).ToList();
I'll give it another go, see if I just goofed up the first time.
I chucked it in there, but each pulse it seemed to drop fps for a split second until I removed it. Basically went like this in notepad++:
return GameManager.Actors.Values.Where(a =>
{
// Ignore null actors (should never happen, but sanity check)
if (a == null)
{
return false;
}
// Make sure the actor is backed by a valid memory address
if (!a.IsValid)
{
return false;
}
if (BlacklistCreatureIds.Contains(a.CreatureId))
return false;
// Obviously can't attack dead stuff!
if (a.IsDead)
{
return false;
}
// Ignore players if PVP isn't enabled.
if (a.ActorType == ActorType.Player && (!isLocalPvpFlagged || !((Player) a).IsPvpFlagged))
return false;
var ci = a.CreatureInfo;
if (ci != null && !ci.CanBeAttacked)
{
return false;
}
// Friendly = 2, Unknown = 3+
// Hostile = 0, Neutral = 1
// We only want to "attack" hostile or neutral actors
if (a.Disposition >= Disposition.Friendly)
{
return false;
}
// The thing isn't in combat, so ignore it.
if (!a.IsInCombat)
{
return false;
}
// If it's targeting us, we want to include it. Even if the combat checks below fail.
if (a.CurrentTargetGuid != 0 && friendlyGuids.Contains(a.CurrentTargetGuid))
{
return true;
}
// If it's tagged by us, or our group, go ahead and include it. Even if it's not our main priority.
if (a.TaggedByLocalPlayer || a.TaggedByLocalPlayerGroup)
{
return true;
}
return false;
}).ToList();
I'll give it another go, see if I just goofed up the first time.
I used your code and had really bad frame spikes and WB crashed twice. I wish I had save the logs before I downloaded another copy :/ Oh and the combat detection got buggy .....