vlatte Posted July 29, 2022 Share Posted July 29, 2022 I've been writing a script recently and would like to modularize my code into different classes to do a collection of things. Is there an annotation to add to submodules to allow access to the main methods (myPlayer(), getBank(), etc.)? Right now, I'm just making methods small in my main script, but it is driving me crazy not to have it logically separated. Quote Link to comment Share on other sites More sharing options...
abc3 Posted July 29, 2022 Share Posted July 29, 2022 I use task based framework It's really simple so once you get it working you can easily extend it to make task runners and orchestrators for complex scripts 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted July 29, 2022 Share Posted July 29, 2022 (edited) 53 minutes ago, vlatte said: I've been writing a script recently and would like to modularize my code into different classes to do a collection of things. Is there an annotation to add to submodules to allow access to the main methods (myPlayer(), getBank(), etc.)? Right now, I'm just making methods small in my main script, but it is driving me crazy not to have it logically separated. You can pass on the Methodprovider or Script class Since the main class extends those you can pass them on by using "this" Example: new PriceChecker(this).start(); Edited July 29, 2022 by Khaleesi 1 Quote Link to comment Share on other sites More sharing options...
vlatte Posted July 29, 2022 Author Share Posted July 29, 2022 Lovely! That's exactly what I was looking for. 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted July 30, 2022 Share Posted July 30, 2022 14 hours ago, vlatte said: Lovely! That's exactly what I was looking for. Glad I could help Quote Link to comment Share on other sites More sharing options...