Computor 179 Posted December 16, 2014 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!!
James 256 Posted December 16, 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
Apaec 79 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
hakerman72 0 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 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 ..... } }
qbots 240 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.
James 256 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
Nuclear Nezz 2094 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.