Jump to content

Help Please


Goku1

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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