Dmitrii 0 Posted May 23, 2023 Share Posted May 23, 2023 hi, I'm trying to make a plugin to fix a nasty bug I've encountered on a warmane (3.3.5a) server. it happens that the character periodically freezes and if he continues to move, then he is constantly teleported back until he stops for a few seconds. I face this problem without using a bot and on this server. I found a plugin on the forum (https://wrobot.eu/forums/topic/12149-how-to-disable-anti-stuck/?do=findComment&comment=58260&_rid=97009). another error is processed there and the bot stops, how can I change "stop" to "pause" and add a timer of 5-10 seconds, after which the bot will unpause and continue working? I will be grateful if you help me with advice attaching the plugin code from the topic on the forum: using System.ComponentModel; using wManager.Plugin; public class Main : IPlugin { private bool _isLaunched; public void Initialize() { robotManager.Events.LoggingEvents.OnAddLog += delegate(robotManager.Helpful.Logging.Log log) { if (log != null) { if (log.Text.Contains("[MovementManager] Think we are stuck")) robotManager.Products.Products.ProductStop(); } }; } public void Dispose() { _isLaunched = false; } public void Settings() { } } Link to comment https://wrobot.eu/forums/topic/15191-pauseunpause-when-an-error-is-encountered-in-the-waypoint-timed-out-log/ Share on other sites More sharing options...
Droidz 2738 Posted May 24, 2023 Share Posted May 24, 2023 Hello, you can should look like that : using System.Threading; using wManager.Plugin; public class Main : IPlugin { private bool _isLaunched; public void Initialize() { _isLaunched = true; robotManager.Events.LoggingEvents.OnAddLog += delegate(robotManager.Helpful.Logging.Log log) { if (log != null) { if (log.Text.Contains("[MovementManager] Think we are stuck")) { robotManager.Products.Products.InPause = true; // new thread to unpause after 5 seconds new Thread(t => { Thread.Sleep(5000); if (_isLaunched) robotManager.Products.Products.InPause = false; }).Start(); } } }; } public void Dispose() { _isLaunched = false; } public void Settings() { } } Dmitrii 1 Link to comment https://wrobot.eu/forums/topic/15191-pauseunpause-when-an-error-is-encountered-in-the-waypoint-timed-out-log/#findComment-68259 Share on other sites More sharing options...
Dmitrii 0 Posted May 24, 2023 Author Share Posted May 24, 2023 thanks a lot, it worked using System.Threading; using wManager.Plugin; public class Main : IPlugin { private bool _isLaunched; public void Initialize() { _isLaunched = true; robotManager.Events.LoggingEvents.OnAddLog += delegate(robotManager.Helpful.Logging.Log log) { if (log != null) { if (log.Text.Contains("[MovementManager] Waypoint timed out")) { robotManager.Products.Products.InPause = true; // new thread to unpause after 5 seconds new Thread(t => { Thread.Sleep(5000); if (_isLaunched) robotManager.Products.Products.InPause = false; }).Start(); } } }; } public void Dispose() { _isLaunched = false; } public void Settings() { } } Link to comment https://wrobot.eu/forums/topic/15191-pauseunpause-when-an-error-is-encountered-in-the-waypoint-timed-out-log/#findComment-68264 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