Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mining bot hoover() help

Featured Replies

Hello,

 

I'm building a miningbot who mines coal at mining guild. It works perfectly but i cant get the next rock hoover while mining the first one.

 

So i want to hoover to next rock already when mining the other. Im only able to identify rocks by:

MethodProvider method = client.getMethods();
Entity rock = method.objects.closest(rockID1, 

So how i can detect more rocks already and decide the next one and hoover the mouse already there?

 

  • Author
18 hours ago, Khaleesi said:

well you are loading the closest one, thats the one you are mining.
load all rocks and filter out what you need 😉

 

Thank you for replying.

 

I ended up using:

RS2Object[] kivi = objects.getAll().stream().filter(o -> o.getId() == 11366 || o.getId() == 11367).toArray(RS2Object[]::new);
ekakivi = kivi[1];
tokakivi = kivi[2];

 

Like this

  • Author
3 hours ago, Gunman said:

Same way you get the rock to mine, just pass the rock you're already mining and add to the filter to ignore that one.

Could you give me little snippet, i have been trying to make it work 2 days now and i just dont know...I'm making this for my purposes, not for selling

2 hours ago, sdsdsd said:

Could you give me little snippet, i have been trying to make it work 2 days now and i just dont know...I'm making this for my purposes, not for selling

Some shit like this I guess
 

    private void mineRocks() {
        final RS2Object mineRock = getRock(null);
        final RS2Object hoverRock = getRock(mineRock);
    }


    private RS2Object getRock(final RS2Object ignoreRock) {
        //Just add this condition to your filter to get the next rock basically
        // r != ignoreRock
        return getObjects().closest(r -> r.getId() == 0 && r != ignoreRock);
    }

 

On 9/9/2022 at 1:35 PM, sdsdsd said:

 

Thank you for replying.

 

I ended up using:

RS2Object[] kivi = objects.getAll().stream().filter(o -> o.getId() == 11366 || o.getId() == 11367).toArray(RS2Object[]::new);
ekakivi = kivi[1];
tokakivi = kivi[2];

 

Like this

Onbjest ids change often so you might wanna use names 😉

  • 2 weeks later...
  • Author
On 9/10/2022 at 5:48 PM, Gunman said:

Some shit like this I guess
 

    private void mineRocks() {
        final RS2Object mineRock = getRock(null);
        final RS2Object hoverRock = getRock(mineRock);
    }


    private RS2Object getRock(final RS2Object ignoreRock) {
        //Just add this condition to your filter to get the next rock basically
        // r != ignoreRock
        return getObjects().closest(r -> r.getId() == 0 && r != ignoreRock);
    }

 

Thank you very much sir!

 

I'm new to java world and trying to learn programming

  • Author
On 9/10/2022 at 5:48 PM, Gunman said:

 

Spoiler

 

 

 

Spoiler

 

 

Could you guys help me at another task. I'm trying to read chatbox when bird nest spawns to me

 

@Override
public void onMessage(Message message) throws java.lang.InterruptedException {
    String txt = message.getMessage().toLowerCase();
    if (txt.contains("nest")) {
      nest++
    }
}

 

but when i try to implement the method

onMessage();

i dont understand the (Message message) parameter.

Typeid ?, My osrs username?, the message like "nest"?

21 hours ago, sdsdsd said:

 

  Hide contents

 

 

Could you guys help me at another task. I'm trying to read chatbox when bird nest spawns to me

 

@Override
public void onMessage(Message message) throws java.lang.InterruptedException {
    String txt = message.getMessage().toLowerCase();
    if (txt.contains("nest")) {
      nest++
    }
}

 

but when i try to implement the method

onMessage();

i dont understand the (Message message) parameter.

Typeid ?, My osrs username?, the message like "nest"?

You can check the docs for detailed information about classes, here is the java docs for Message
You don't have to call onMessage() manually anywhere in the script, it will automatically be listening for new messages whenever you run the script

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.