Jump to content

Help Please


Recommended Posts

Posted (edited)

The tutorial you're using is outdated.

 

Now you can just use:

getInventory()

with the methods:

 

http://osbot.org/api/org/osbot/rs07/api/Inventory.html#deselectItem--

Ok I am only worrying about making my first regular tree chopper. My only concern is with the onLoop

Can you give me an example of typing the getInventory() for this project? What do I do with the methods listing you just gave me? Are they supposed to automatically fill out? I feel that I capable of filling out areas if you give me examples like this: getinventory(Place tree here).

Edited by Goku1
Posted

Ok I am only worrying about making my first regular tree chopper. My only concern is with the onLoop

Can you give me an example of typing the getInventory() for this project? What do I do with the methods listing you just gave me? Are they supposed to automatically fill out? I feel that I capable of filling out areas if you give me examples like this: getinventory(Place tree here).

 

not sure what you mean...

 

So getInventory() is used for inventory interactions . for example:

getInventory().getAmount("Yew log");

will return the number of items with the name 'yew log' in your inventory.

getInventory().dropAll()

will drop all the items in your inventory

 

etc...

 

as for interacting with trees, do it the same as I've done for the tea thiever, just change the names to the trees :)

 

feel free to pm me if you have any further questions :D

 

apa

Posted

not sure what you mean...

 

So getInventory() is used for inventory interactions . for example:

getInventory().getAmount("Yew log");

will return the number of items with the name 'yew log' in your inventory.

getInventory().dropAll()

will drop all the items in your inventory

 

etc...

 

as for interacting with trees, do it the same as I've done for the tea thiever, just change the names to the trees smile.png

 

feel free to pm me if you have any further questions biggrin.png

 

apa

I tried to pm you but OSBot takes me to an offline page.

I posted under the onLoop section this:

 

public int onLoop(){
 
        getInventory().getAmount("logs");
 
        getInventory().dropAll("logs");
 
       return random(200,300); 
}
 
How does the onLoop section look to you?
 
I have your thiever script example, would I post the tree interaction under the onStart or the onLoop section?
Posted

 

I tried to pm you but OSBot takes me to an offline page.

I posted under the onLoop section this:

 

public int onLoop(){
 
        getInventory().getAmount("logs");
 
        getInventory().dropAll("logs");
 
       return random(200,300); 
}
 
How does the onLoop section look to you?
 
I have your thiever script example, would I post the tree interaction under the onStart or the onLoop section?

 

 

getInventory().getAmount("Logs"); does nothing on it's own, it just returns the number of logs in your invo. So for example

int numberOfLogs = getInventory().getAmount("Logs"); //counts the number of logs in ur inventory and stores it in the 'numberOfLogs' variable
log("Number of logs: " + numberOfLogs); //prints the number of logs in the console.

So what your code would do as it stands would just empty your inventory. Take a look back at my tutorial and look at the framework I used with the state system and so on and try and figure out how the code flows. That should then help you understand how to write your woodcutter :)

 

apa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...