Jump to content

Powerchopper (How do i make it drop logs)


atoo

Recommended Posts

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

 

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