Athylus Posted April 5, 2018 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
Blurper Posted April 5, 2018 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
Apaec Posted April 5, 2018 Posted April 5, 2018 As Blurper said, either pass a reference of script, or methodprovider (keep in mind script extends methodprovider) 2
Chris Posted April 5, 2018 Posted April 5, 2018 pass Bot inside the classes constructor use bot.getMethods().getCamera()...
Athylus Posted April 5, 2018 Author Posted April 5, 2018 Great, it's working! I actually passed my own main class as Script type. Thanks. 1