Jump to content

How do I use an object at a certain location?


mitsuki

Recommended Posts

I'm trying to mine a rock at a specific location, but can't seem to work out how to do it?

I assumed it would be something along of lines of

getObjects().closest("Rock") at location (1334, 1553);

But I can't work out how to add a location to the object. Do I need to make my own method or something to check the location?

like:
 

public boolean rockLocation() {

     if (getObjects().closest("Rock").exists && Location == (1334, 1553)) {

          return true;

     }

}

 

I just don't know how to check the location. Cheers guys

Link to comment
Share on other sites

13 minutes ago, mitsuki said:

Thank you dude, any chance you can explain what the code is doing so i can understand fully using comments? No worries if not man

There are a lot of ways to filter stuff, thats just a quick way to filter the closest object that meets the criteria. You could also filter for .hasAction() or pretty much anything else.

Just google "osbot filter" for more info/examples

  • Heart 1
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...