Jump to content

Recommended Posts

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
https://wrobot.eu/forums/topic/12943-custom-script-question/
Share on other sites


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
https://wrobot.eu/forums/topic/12943-custom-script-question/#findComment-61589
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...