Computor 177 Share Posted December 16, 2014 (edited) First off, a lesson in reading the API would be very effective. I understand the substrings inside the api, for example, if you click on inventory it lists this: boolean interactWithSlot(int slot, java.lang.String action) Interacts with specified slot in inventory boolean isEmpty() Checks if your Inventory is empty boolean isEmptySlot(int slot) Checks if the slot is empty boolean isFull() Checks if your Inventory is full boolean isFullSlot(int slot) Checks if the slot has an Item in it boolean isItemSelected() Checks whether an item is currently selected in your inventory Which I understand completely. What I don't understand is how do I use them.... Is it inventory.isFull(); ??? On OSBot inventory.* would work, I don't know what it is on dreambot, and I don't know if there is a way to find it on the API or not. Please let me know!! Edited December 16, 2014 by Computor Link to comment Share on other sites More sharing options...
Soldtodie 76 Share Posted December 16, 2014 getInventory() Link to comment Share on other sites More sharing options...
James 256 Share Posted December 16, 2014 (edited) It might be easier to add a dev/scripter on skype and ask them rather than making a lot of threads I would reccomend or @qbots Edited December 16, 2014 by James Link to comment Share on other sites More sharing options...
Apaec 78 Share Posted December 16, 2014 So it's different and the same to osbot. In osbot they had constructors such as getInventory(), but they also had shorthand inventory (getInventory() was better btw!). Here there's just getInventory(), much like getWidgets() or getBank() etc etc. To access a method from the API, you just need to use the correct constructor which correlates to that command, eg getInventory().isFull() or getBank().isOpen() Apaec Link to comment Share on other sites More sharing options...
hakerman72 0 Share Posted December 16, 2014 (edited) So it's different and the same to osbot. In osbot they had constructors such as getInventory(), but they also had shorthand inventory (getInventory() was better btw!). Here there's just getInventory(), much like getWidgets() or getBank() etc etc. To access a method from the API, you just need to use the correct constructor which correlates to that command, eg getInventory().isFull() or getBank().isOpen() Apaec it called a method not a constructor and how is that better? constructor is method with no return type and named same as class e.g. public class Example { public Example() { //<-- this is constructor!!!1 ..... } } Edited December 16, 2014 by hakerman72 Link to comment Share on other sites More sharing options...
Pandemic 2468 Share Posted December 16, 2014 Here you go: MethodContext Link to comment Share on other sites More sharing options...
Computor 177 Author Share Posted December 17, 2014 Thank you very much Apaec and Pandemic!! Link to comment Share on other sites More sharing options...
qbots 239 Share Posted December 17, 2014 It might be easier to add a dev/scripter on skype and ask them rather than making a lot of threads I would reccomend or @qbots I feel loved. OT: I am happy to help if you add me on Skype. PM me and I'll send you it. Nuclear Nezz 1 Link to comment Share on other sites More sharing options...
James 256 Share Posted December 17, 2014 I feel loved. OT: I am happy to help if you add me on Skype. PM me and I'll send you it. u can add my skype bby khaleesifanboy69 Link to comment Share on other sites More sharing options...
Nuclear Nezz 1993 Share Posted December 17, 2014 A quick lesson on docs:If you go to Inventory and you see all of those methods, that means those methods are in the Inventory class. You'll see some of them at the top of the page will say "extends X" or "implements Y" That means that class can access the methods of X/Y without any additional code. For instance:AbstractScript extends MethodContext And as such, AbstractScript can use all of MethodContext's methods without doing something like:MethodContext ctx = new MethodContext(); ctx.stuff(); Instead it's just stuff(); So now that you know which class has the methods you're looking for, you need to figure out how to access it. As Pandemic nicely added, the MethodContext is where most of the stuff you need is located. These would be the major areas of the API:Client, Bank, Inventory, Skills, Walking, Map, etc. To access these (this is where the extend MethodContext comes in handy) simply find the method you want in the docs (Ctrl+F Inventory and you'll find "getInventory()") Now go to your script type getInventory() you can access all of Inventory's methods from here. getInventory().stuff(); I actually forgot what I was doing half way through writing this, so pls forgive if I stopped making sense/switched what I was talking about. Computor 1 Link to comment Share on other sites More sharing options...
Recommended Posts