duthibaut 0 Posted June 8, 2019 Share Posted June 8, 2019 Hello guys, Some of u know how to check if the bot is attacked by a mob in C#? Thanks ? Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/ Share on other sites More sharing options...
duthibaut 0 Posted June 8, 2019 Author Share Posted June 8, 2019 I try something like : public void SkipNodesIfFight() { robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if (state is wManager.Wow.Bot.States.IsAttacked) { _isFight = true; wManager.Wow.Helpers.Chat.SendChatMessageWhisper("IsFight","namespeudo"); Thread.Sleep(10000); Initialize(); } else { _isFight = false; wManager.Wow.Helpers.Chat.SendChatMessageWhisper("NotISFight","namespeudo"); Thread.Sleep(10000); } Thread.Sleep(10000); }; } But never say "IsFight" when a mob attack me ? Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/#findComment-54385 Share on other sites More sharing options...
TheSmokie 242 Posted June 8, 2019 Share Posted June 8, 2019 3 hours ago, duthibaut said: I try something like : public void SkipNodesIfFight() { robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if (state is wManager.Wow.Bot.States.IsAttacked) { _isFight = true; wManager.Wow.Helpers.Chat.SendChatMessageWhisper("IsFight","namespeudo"); Thread.Sleep(10000); Initialize(); } else { _isFight = false; wManager.Wow.Helpers.Chat.SendChatMessageWhisper("NotISFight","namespeudo"); Thread.Sleep(10000); } Thread.Sleep(10000); }; } But never say "IsFight" when a mob attack me ? for this code to work you'd need to make it run inside Initialize(); Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/#findComment-54388 Share on other sites More sharing options...
zzzar 13 Posted June 8, 2019 Share Posted June 8, 2019 May be wManager.Wow.ObjectManager.ObjectManager.GetUnitAttackPlayer().Count < = 0 works for you? Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/#findComment-54389 Share on other sites More sharing options...
duthibaut 0 Posted June 8, 2019 Author Share Posted June 8, 2019 I try this Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/#findComment-54391 Share on other sites More sharing options...
duthibaut 0 Posted June 8, 2019 Author Share Posted June 8, 2019 wManager.Wow.ObjectManager.ObjectManager.GetUnitAttackPlayer().Count < = 0 working fine ? thanks ! Link to comment https://wrobot.eu/forums/topic/11370-check-isattack/#findComment-54392 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