Jump to content

Powerchopper (How do i make it drop logs)


Recommended Posts

Posted (edited)

So after getting a bit help from a friend yesterday (and some guys here)

I manange to get my scripting started.

But i have no idea what to do here

if (!inventory.isFull())
return State.CHOP;
    return State.DROP;
 
It doesn't start chopping, but it drops the logs instant before the inventory is full (if i start chopping manually)

 

Edited by atoo
Posted (edited)

 

So after getting a bit help from a friend yesterday (and some guys here)

I manange to get my scripting started.

But i have no idea what to do here

if (!inventory.isFull())
return State.CHOP;
    return State.DROP;
 
It doesn't start chopping, but it drops the logs instant before the inventory is full (if i start chopping manually)

 

 

 

1. About your area, go into the client and activate entity hover-on. Move the cursor of your mouse to a tile, you will get 2 coordinates (1831, 1839) (x,y)

Do this one more time so you've got the coordinates of 2 tiles (2 corners so you have a square). if your second coordinate would be (0181, 4810) your area would then become --> AREA_TREES = new Area(1831, 1839, 0181, 4810)

 

2. About dropping the logs; take a look into the API.  http://osbot.org/api/org/osbot/rs07/api/Inventory.html

 

If you want it to perform the drop action if your inventory is full, it should be this -->

 

if (inventory.isFull()) 

 

not this --> if (!inventory.isFull())

the ! "means" "not". in this case that would be --> if inventory is not full

So what you'd have to do -->

 

if (inventory.isFull())
   inventory.dropAllExcept("Bronze Axe, Iron axe");  //etc

If you just want to drop everything in your inventory -->

 

if (inventory.isFull())
    inventory.dropAll();

      

Edited by Eagle Scripts
  • Like 2

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...