stussyboi187 Posted November 12, 2017 Share Posted November 12, 2017 (edited) Hello, I just started scripting and taking baby steps to making a bot. However I dont know why I cannot instantiate type Character according to the OSBOT API. I know that its an abstract class so how would i go about using it syntax wise... also tried extending it in the class. Im trying to do character.isAnimation() method. https://gyazo.com/3a7863f01f4a2a57caaf752444cb50b5 https://gyazo.com/843accad8fd0e2265226ffece7105e5c Much help would be appreciated! Edited November 12, 2017 by stussyboi187 Quote Link to comment Share on other sites More sharing options...
Apaec Posted November 12, 2017 Share Posted November 12, 2017 (edited) As you said it is an abstract class; thus you can't instantiate it. You will need to extend it and provide a body to the abstract methods if you wish to use it. That being said, I can't see why you would need to do this, especially since you're new to scripting! If you're looking to check if your player is animating, perhaps try something along these lines in your class which extends Script: boolean animating = myPlayer().isAnimating(); .. or if you want the animation id: int animationId = myPlayer().getAnimation(); Note that an id of (-1) is no animation. GL! Apa Edit: Spelling Edited November 12, 2017 by Apaec Quote Link to comment Share on other sites More sharing options...
stussyboi187 Posted November 12, 2017 Author Share Posted November 12, 2017 Hello @Apaec thank you for the response. I will try it out and let you know how it goes. There is many classes in the api lol... any good way to sift through all the classes? Quote Link to comment Share on other sites More sharing options...
stussyboi187 Posted November 12, 2017 Author Share Posted November 12, 2017 22 minutes ago, Apaec said: As you said it is an abstract class; thus you can't instantiate it. You will need to extend it and provide a body to the abstract methods if you wish to use it. That being said, I can't see why you would need to do this, especially since you're new to scripting! If you're looking to check if your player is animating, perhaps try something along these lines in your class which extends Script: boolean animating = myPlayer().isAnimating(); .. or if you want the animation id: int animationId = myPlayer().getAnimation(); Note that an id of (-1) is no animation. GL! Apa Edit: Spelling Hello @Apaec thank you for the response. I will try it out and let you know how it goes. There is many classes in the api lol... any good way to sift through all the classes? Quote Link to comment Share on other sites More sharing options...
Apaec Posted November 12, 2017 Share Posted November 12, 2017 1 hour ago, stussyboi187 said: Hello @Apaec thank you for the response. I will try it out and let you know how it goes. There is many classes in the api lol... any good way to sift through all the classes? I mean it really depends on what you're looking for! Navigating javadocs takes a bit of practice - if you're looking for a specific method, you can have a look in index view, but mostly class tree view is the easiest to digest. If you're unsure about anything, don't hesitate to let me know! The more scripts you write, the more fluent you will become with both Java and the API. Apa 1 Quote Link to comment Share on other sites More sharing options...
stussyboi187 Posted November 12, 2017 Author Share Posted November 12, 2017 1 hour ago, Apaec said: I mean it really depends on what you're looking for! Navigating javadocs takes a bit of practice - if you're looking for a specific method, you can have a look in index view, but mostly class tree view is the easiest to digest. If you're unsure about anything, don't hesitate to let me know! The more scripts you write, the more fluent you will become with both Java and the API. Apa Hey thanks for the support. Hopefully one day I can become like you. I will try out the tree method to search for things. Quote Link to comment Share on other sites More sharing options...