Pudge 24 Posted March 21, 2021 Share Posted March 21, 2021 Hi guys, does anyone know if there is a way to use a method like Dispose () as in the plugin, only in the quester, namely in a custom script, when the product stops, I need to reset some custom settings that I write in an xml file. In general, i just need a method that will be triggered before the Quester stops. Link to comment Share on other sites More sharing options...
Marsbar 228 Posted March 21, 2021 Share Posted March 21, 2021 You can hook onto the https://wrobot.eu/byme/doc/html/E-robotManager.Products.Products.OnChangedIsStarted.htm event and run whatever you need to in there Pudge 1 Link to comment Share on other sites More sharing options...
Pudge 24 Posted March 21, 2021 Author Share Posted March 21, 2021 public class MyCustomScript { static MyCustomScript() { robotManager.Events.ProductEvents.OnProductStopping += OnProductStopping;//subscribe } public static void OnProductStopping(string str) { //code when product stopping Logging.Write("Stopping " + str); robotManager.Events.ProductEvents.OnProductStopping -= OnProductStopping; //unsubscribe } } Link to comment 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