Athylus Posted April 5, 2018 Share Posted April 5, 2018 In the process of making a quest bot. Using multiple classes to keep control of my code. Now I am making a method to grab an item in one of my classes, but I cannot call getCamera().toEntity(e);. I am guessing because I am not extending Script, since I have all the imports. If I am correct you are only allowed to extend Script in your main class. Is there a work around? All the imports are used listed on this page: https://osbot.org/api/org/osbot/rs07/api/Camera.html Quote Link to comment Share on other sites More sharing options...
Blurper Posted April 5, 2018 Share Posted April 5, 2018 I haven't done much with the OsBot API, but I would probably pass an instance of the main class to any other classes you use during initialization 2 Quote Link to comment Share on other sites More sharing options...
Apaec Posted April 5, 2018 Share Posted April 5, 2018 As Blurper said, either pass a reference of script, or methodprovider (keep in mind script extends methodprovider) 2 Quote Link to comment Share on other sites More sharing options...
Chris Posted April 5, 2018 Share Posted April 5, 2018 pass Bot inside the classes constructor use bot.getMethods().getCamera()... Quote Link to comment Share on other sites More sharing options...
Athylus Posted April 5, 2018 Author Share Posted April 5, 2018 Great, it's working! I actually passed my own main class as Script type. Thanks. 1 Quote Link to comment Share on other sites More sharing options...
Alek Posted April 6, 2018 Share Posted April 6, 2018 Ugh the context is bot Quote Link to comment Share on other sites More sharing options...