mr magoo Posted September 23, 2017 Share Posted September 23, 2017 (edited) I've made another class that aids me in getting some work done in my script, but I need it to sleep as it would if all my code was in the main class. Is this possible? Normally I would do import main; but it doesn't work in this case. The sleep function comes from the Script extension of main. Thank you for your time Edited September 23, 2017 by mr magoo Quote Link to comment Share on other sites More sharing options...
Chris Posted September 23, 2017 Share Posted September 23, 2017 pass script instance Quote Link to comment Share on other sites More sharing options...
dreameo Posted September 23, 2017 Share Posted September 23, 2017 You can make your own sleep method by utilizing a Timer class. Quote Link to comment Share on other sites More sharing options...
Satire Posted September 23, 2017 Share Posted September 23, 2017 Read up on constructors. You need to pass the scripts instance to every class that needs to use it. Quote Link to comment Share on other sites More sharing options...
Novak Posted September 24, 2017 Share Posted September 24, 2017 (edited) MethodProvider.sleep Edited September 24, 2017 by Novak Quote Link to comment Share on other sites More sharing options...
FrostBug Posted September 24, 2017 Share Posted September 24, 2017 1 hour ago, mr magoo said: I've made another class that aids me in getting some work done in my script, but I need it to sleep as it would if all my code was in the main class. Is this possible? Normally I would do import main; but it doesn't work in this case. The sleep function comes from the Script extension of main. Thank you for your time It's a static method. You don't need an instance Quote Link to comment Share on other sites More sharing options...