Findeh 34 Posted May 30, 2019 Share Posted May 30, 2019 Might be very stupid question, i'm kind of ill today, so it's hard to think right, sorry for that. Anyway, simple code like this is not working for me: robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if (condition) { cancelable.Cancel = true; Logging.Write("Message1"); // Do something here Logging.Write("Message2"); cancelable.Cancel = false; } }; The goal is to release spirit but then intercept the act of the corpse-run with a plugin. Problem is: I do get "Message1", so state is canceled, then bot tryes to do the job (// section), but then, for some reason, bot decides to run for a corpse. If i test it like this: cancelable.Cancel = true; Logging.Write("Waiting"); Thread.Sleep(1000*500); Logging.Write("Message2"); cancelable.Cancel = true; Then i'll get "Waiting" message. Bot will stay for 2-3 seconds but then will run for a corpse anyway. So it's not my code starting the thread again, the thread is starting by itself or (more likely) its a separate thread wich i can't cancel, for some reasone. Also it doesn't matter wich way i do this, with OnBeforeCheckIfNeedToRunState or OnRunState, result is the same. I've tryed to cnahge "condition" of my if, to be always true. It spams "Message1", constantly canceling the state, but does not stop the corpse run. I can pause the bot instead of canceling the state, It will stop the corpse run for sure, but then i will not be able to move it with methods like MovementManager (if i'm not mistaken). To sum up, is it some sort of state that i can't cancel, or am i just stupid and do it wrong? Maybe the Products.InPause is the way to do it instead, but how do i move then? Thank you in advance for any tips. Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/ Share on other sites More sharing options...
Droidz 2738 Posted June 5, 2019 Share Posted June 5, 2019 Hello, before to wait try to "MovementManager.StopMove();" Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54327 Share on other sites More sharing options...
Findeh 34 Posted June 5, 2019 Author Share Posted June 5, 2019 Thank you for reply, not sure what it will work. I'll try it today and will film a video for you how it goes. Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54328 Share on other sites More sharing options...
Findeh 34 Posted June 5, 2019 Author Share Posted June 5, 2019 5 июн 2019 17H01.log.html Here is a video and a log. I'm trying to make bot to go opposite derection from the corpse. But he does not ever reach first waypoint. Code that i was testing it with: public void Initialize() { Logging.Write("Corpse Runner is ON"); isRunning = true; robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if ((Me.HaveBuff("Ghost"))) { Logging.Write("Resurrect state is cancelled"); cancelable.Cancel = true; MovementManager.StopMove(); MovementManager.Go(OppositeDirectionSpiritPath); while (MovementManager.InMovement && Conditions.InGameAndConnected && !Conditions.IsAttackedAndCannotIgnore) { Thread.Sleep(300); }; MovementManager.StopMove(); Logging.Write("WAIT 5000ms"); Thread.Sleep(5000); } }; } Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54330 Share on other sites More sharing options...
Findeh 34 Posted June 11, 2019 Author Share Posted June 11, 2019 @Droidz, can you tell me please, is there no such event as "running to retrieve the corpse" and that's why i just can't intercept it, or am i do something wrong? If there is no such event, then how to retrive corpse with my own code? There is like 20 places atleast, where bot can't get his corpse back, rumming in to the wall or ignores elevator. can you tell me please, is there no such event such "running to retrive the corpse" and that's why i just can't intercept it, or am i do something wrong? Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54448 Share on other sites More sharing options...
Findeh 34 Posted July 2, 2019 Author Share Posted July 2, 2019 So nothing? I will try to explain. Wrobot does not resurect at some points. Bug on wrobots side that have been reported but have not been solved. Bot also don't know how to pass some elevators, caves, mountains and such. It is also a bug on wrobots side. Also have been reported, also have not been solved. I am trying to make fix both bugs with a plugin, but i can't intercept a resurect part, wich is also seems like a bug on wrobot side. What should i do? Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54823 Share on other sites More sharing options...
TheSmokie 242 Posted July 2, 2019 Share Posted July 2, 2019 You need to look for dead or run to body even and over ride it completely Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54824 Share on other sites More sharing options...
Findeh 34 Posted July 2, 2019 Author Share Posted July 2, 2019 That's what i do. But i can't stop inbuilt corpse run event. Only by pausing the bot, but if i pause it, half of functionality will not work as intended. Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54826 Share on other sites More sharing options...
Marsbar 228 Posted July 2, 2019 Share Posted July 2, 2019 Is the event you're looking for not just the state? As in the resurrect state? Try changing your condition to: if (state.GetType() == typeof(wManager.Wow.Bot.States.Resurrect)) Findeh and TheSmokie 2 Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54828 Share on other sites More sharing options...
Findeh 34 Posted July 3, 2019 Author Share Posted July 3, 2019 The problem is. Resurrect state seems to be from "Player is dead" and till you push "Release spirit". So when bot arrives at the graveyard, it is not Ressurect state anymore, and he just runs. But i will recheck that today to confirm. Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54834 Share on other sites More sharing options...
Findeh 34 Posted July 5, 2019 Author Share Posted July 5, 2019 Okay, seems like i have found one more problem. I can stop movement now, but if after i've stoped it, i'll do any Thread.Sleep then it automatically set cancelable.Cancel to false. Another words, i need to stop current even to preven bot from running. I do stop it. Then i do my own work, but if in a process i will use any Thread.Sleep (wich i will use for elevators or to check something, for example). Then it just unsubscribes from event and bot once again start to run wherever he wants. I't almost imposible to do not use thread.sleep. Or i will run in circles like a mad, instead of standing still, or i'll burn my cpu. Any ideas how to avoid that behavior? Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54850 Share on other sites More sharing options...
TheSmokie 242 Posted July 5, 2019 Share Posted July 5, 2019 You need to use the code you want inside the right after the stop and at the end use return; Link to comment https://wrobot.eu/forums/topic/11329-how-to-intercept-corpse-run/#findComment-54855 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