Jump to content

Recommended Posts

Hi,

So I'm currently working on a 'tag and bag' plugin (an adaptation of Matenia's 'PartyHelperPlugin' which I will be releasing with source code when I'm finished -- credits to Matenia for base code & advice on how to get started ?). The way this plugin functions is very similar to Matenia's plugin, however the leader does not invite the followers, they never join a party together, and consequently, to the best of my knowledge there is no way to use Lua SendAddonMessage, so that functionality is not being used. (EDIT: After doing some research I believe I can use SendAddonMessage thru the whisper channel, so that's a plus ?)

I have everything working aside from a NullReferenceException that occurs when the leader is not targeting anything - but I think I can figure that one out on my own.

The only issue I have is the follower bots hesitating to attack the tagged mobs & not using their FightClass rotation as a result. What happens is, the followers will sort of wig out and go from attacking to following constantly, in a back & forth kind of way. They target, maybe auto-attack the mobs for a second, then go back to following me, rinse & repeat. I'm currently just using Fight.StartFight(guid), however is it possible to make the followers (or any character in general) ignore the fact that it's attacking a tagged mob and proceed anyways without interruption? The API is very hard to understand as there is no clear explanation on what most methods/functions do, since I am only relying on a decompiler to access them.

 

TL;DR is there a way in C# to force a bot to attack a tagged mob?

 

Thanks,

R

Link to comment
https://wrobot.eu/forums/topic/10424-force-bot-to-attack-tagged-mobs/
Share on other sites

Because you must do several states of the bots ( follow state , attack state etc ) when the bot recognize a state it will only do the part which is proper for current moment. Imagine you wanna sit, stand, and run in the same time in real life. The bot is doing exactly that ?

23 hours ago, Marsbar said:

The bot attacks tagged mobs by default unless you have a plugin enabled that stops that (HMP for example)

Hmm, well I haven't had anything but my Plugin enabled and yet they both still do it. When running wrotation, if the follower attacks first, the follower will kill the mob and use its FightClass, but the leader won't. Vice versa, the same happens but this time the follower won't attack.

 

23 hours ago, Mykoplazma said:

Because you must do several states of the bots ( follow state , attack state etc ) when the bot recognize a state it will only do the part which is proper for current moment. Imagine you wanna sit, stand, and run in the same time in real life. The bot is doing exactly that ?

I have to look into this more, I admittedly don't fully understand this system yet but based on Matenia's code it shouldn't be any different than it was, I haven't changed anything about the states yet.

Wrobot has an option like "can attack units already in combat" that might play into it. There's also a plugin for attacking tabbed targets of a main character. You might be able to look at the source or decompile it. Also, StartFight has a bunch of arguments 

Edited by Matenia
49 minutes ago, Matenia said:

Wrobot has an option like "can attack units already in combat" that might play into it. There's also a plugin for attacking tabbed targets of a main character. You might be able to look at the source or decompile it. Also, StartFight has a bunch of arguments 

Yea, I checked the "can attack units in combat" setting and they were turned off on both; I thought I finally figured it out but it's no different. I also decompiled that plugin you were talking about (it's called 'PartyTagger') and attempted to apply what he did to my code, no difference. Finally, I tried just using that plugin on my follower but even still it does not work. It's strange, it may be a bug. I'll keep researching and try to find a way to make this work. @Droidz do you know of a way to do this?

public static ulong StartFight(ulong guid, bool skipIfPlyerAttackedButNotByTheTarget = true, bool managerMovement = true, bool stopIfPlayerTargetChange = false, bool rotationBot = false)

 

Maybe some of these parameters are responsible. 

I also saw that wManagerSetting.CurrentSetting.DetectEvadingMob is considered.

9 hours ago, Matenia said:

public static ulong StartFight(ulong guid, bool skipIfPlyerAttackedButNotByTheTarget = true, bool managerMovement = true, bool stopIfPlayerTargetChange = false, bool rotationBot = false)

 

Maybe some of these parameters are responsible. 

I also saw that wManagerSetting.CurrentSetting.DetectEvadingMob is considered.

I've been messing around with these but I haven't seen anything work yet, part of what the PartyTagger plugin did was specify all of these to 'true' except 'stopIfPlayerTargetChange' which is left false. DetectEvadingMob is also false (have tested 'true' just for shits and giggles but that doesn't fix it).

screenshot.png.7bb54deeea971e78c5f3c31226673b9b.png

On a side note, this is what gets logged when the follower tries to attack. Implicit but could be useful.

3 hours ago, Droidz said:

Hello, sometime option "max unit near" can force bot to avoid mobs

I thought of that too, however the mobs I'm attacking are neutral (not hostile) and this doesn't change anything so I don't think that setting is playing into it ?.

 

EDIT: Aha! I finally figured it out. It was in the FightClass:

fightclass.thumb.png.bf73ef1331d717539a2e35b686cb49cc.png

I had been using the default FightClasses 'Rogue.cs' and 'Warrior.cs' and I can't believe it hadn't crossed my mind to be in there until now. For future reference, if anyone else has this issue and can't figure out wtf it might be, check your FightClass and make sure there isn't any code in there that checks whether it's tapped or not. Search for "Tapped" or "Tagged' (I know for a fact that there's a C# bool in WoWUnit that is able to check if a target is tapped too, so make sure that isn't in there either.) All I did to make it work was comment this portion out:

fightclass2.thumb.png.d2ab32cdd785f2162d2161b6a83dbcc6.png

It now works without interruption. Time to remove all of that crap code and condition checking I put all over FightAssist. Thanks for your help everyone, I'm sure this issue is more than well enough documented now ?

Edited by RADON
resolved issue

Since I have this and the NullReferenceException fixed, if anyone cares I will be releasing this w/ source shortly, once I figure out a workaround for SendAddonMessage (WHISPER and CHANNEL types were added after classic so I can't use it). Running it on one of my alts and it's working near perfectly.

2 hours ago, Matenia said:

Either use SendChatMessage with whisper or make all bots join a new invisible channel then use SendChatMessage for that

Got it, just finished implementing SendChatMessage with whisper for now, everything seems to work. I'll upload when I get home from work tomorrow. (~12hrs)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...