Bloodybeast 0 Posted May 7, 2022 Share Posted May 7, 2022 Hi, right now i have a piece of code which targets the closest mob to me but then sometimes they move or even run away when low hp and my bot just targets a new mobs which isn't the behavior i would like it to have. I really want to be able to lock onto the target and chase it to death. Right now i have this code but it doesn't lock sadly, i'm trying to figure out how to do it for 2 days but couldn't find any smart way to do it... var focusUnit = ObjectManager.GetNearestWoWUnit(focusMobsList); if (focusUnit.IsValid && ObjectManager.Target.Guid != focusUnit.Guid) { Logging.WriteDebug(string.Format("[PriorityTarget] Focus Unit - {0} (distance: {1}).", focusUnit.Name, focusUnit.GetDistance)); if (ObjectManager.Target.IsValid) Lua.LuaDoString("ClearTarget();"); cancelable.Cancel = true; var m = Fight.StartFight(focusUnit.Guid, false); } I can't find a smart way to modify my condition so it would only go inside if the previous target is dead... If someone have an idea or a hint, i'm welcoming any ideas...! Thanks a lot Link to comment https://wrobot.eu/forums/topic/14302-how-to-lock-onto-a-target-when-mobs-are-running-away/ Share on other sites More sharing options...
Droidz 2738 Posted May 7, 2022 Share Posted May 7, 2022 Hello, you can try (it's not recommended to use this code, it can add bugs) : wManager.Events.FightEvents.OnFightEnd += delegate(Int128 guid) { var o = ObjectManager.GetObjectByGuid(guid); if (o != null && o.IsValid && o.Type == WoWObjectType.Unit && // o.Entry == 1234 && // By Entry ID ????? new WoWUnit(o.GetBaseAddress).IsAlive) { Fight.StartFight(guid, false); } }; Link to comment https://wrobot.eu/forums/topic/14302-how-to-lock-onto-a-target-when-mobs-are-running-away/#findComment-65508 Share on other sites More sharing options...
Bloodybeast 0 Posted May 7, 2022 Author Share Posted May 7, 2022 Oh i have to look at that, i'm gonna try and i'll update once i tested !! Thanks a lot man ! Link to comment https://wrobot.eu/forums/topic/14302-how-to-lock-onto-a-target-when-mobs-are-running-away/#findComment-65512 Share on other sites More sharing options...
Bloodybeast 0 Posted May 8, 2022 Author Share Posted May 8, 2022 I think it is working however, it sometimes Blacklist some mobs from the pack during 60sec i have no idea why, i'll try to look around what's the reason for the bot to blacklist a mob which is right next to meand shooting me. Link to comment https://wrobot.eu/forums/topic/14302-how-to-lock-onto-a-target-when-mobs-are-running-away/#findComment-65525 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now