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

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!

Bot wont attack when grouped

bowie

Member
Joined
Mar 10, 2013
Messages
35
I notice that the bot wont attack when a groupmember pulls a mob using the rotation bot (Combatbot). It works fine if solo. Anyone got a fix for this?
 
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.
 
Add this to Targeting.cs in the Default Combat routine

Code:
if (a.TaggedBy != null && (a.TaggedBy.ActorType == ActorType.Player && a.TaggedBy.IsInGroup))
return true;

Should fix your issue.
 
Add this to Targeting.cs in the Default Combat routine

Code:
if (a.TaggedBy != null && (a.TaggedBy.ActorType == ActorType.Player && a.TaggedBy.IsInGroup))
return true;

Should fix your issue.

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.

Any help is appreciated, cheers.
 
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.

Any help is appreciated, cheers.

That sounds about right, just make sure it's before the 'return false;' line. :)
 
That sounds about right, just make sure it's before the 'return false;' line. :)

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;
}

if (a.TaggedBy != null && (a.TaggedBy.ActorType == ActorType.Player && a.TaggedBy.IsInGroup))
{
return true;
}

// 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 (a.TaggedBy != null && (a.TaggedBy.ActorType == ActorType.Player && a.TaggedBy.IsInGroup))
{
return true;
}


// 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.

Not entirely sure why the FPS would drop unless the attributes are really sluggish, further testing required!

Check the above quote for a relocation of the inserted line that'll be more stable... maybe. ;)
 
Not entirely sure why the FPS would drop unless the attributes are really sluggish, further testing required!

Check the above quote for a relocation of the inserted line that'll be more stable... maybe. ;)

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 .....
 
Last edited:
Back
Top