Marsbar 228 Posted May 11, 2018 Share Posted May 11, 2018 In a plugin I'm writing I create an instance of a class. I do not want to dispose it when the bot is stopped (which is fine and working) however I don't want to create another instance of it if it already exists as there would then be 2 of them (as I'm not disposing the original). I can't track it in a variable within my plugin because once the bot is restarted a new instance of the plugin is spawned and would not have those variables. Is there something I can set in a wrobot variable to track whether my plugin has launched and thus I don't need to track it in my plugin? Link to comment https://wrobot.eu/forums/topic/9377-plugin-only-create-instance-of-class-if-it-doesnt-already-exist/ Share on other sites More sharing options...
Marsbar 228 Posted May 11, 2018 Author Share Posted May 11, 2018 I may use the plugin settings and pulse them to let them know the instance is still alive - I'll update if that worked for me. Thanks @Enraged Link to comment https://wrobot.eu/forums/topic/9377-plugin-only-create-instance-of-class-if-it-doesnt-already-exist/#findComment-43493 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