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.

Getting the ID's of nearby objects.

Featured Replies

I want the script to detect Tin and Copper rocks. I would do it easily by name, but the name and interaction options stay the same when it is already mined. I noticed that the object ID changes when it is mined, so i thought it would be easier to tell the script to mine only certain ID's (of rocks that are not mined.)

I had : 

 

final String TIN_ID = "Tin";

 

Would i change it to:

 

final int TIN_ID = "1234, 1234, 1234, 1234";?

or

final int TIN_ID[] = "1234, 1234, 1234, 1234";?

 

Do i need an array for this? Or am i entirely wrong?
Also, if i need to use an array, how would i set that up?

 

final int array TIN_ID = "1234, 1234, 1234, 1234,"

 

 

 

 

Sorry for all of the questions. I'm looking to help the community out by starting small and learning as effectively as i can.

Thanks

final int[] TIN_IDS = {1234, 1234, 1234, 1234};

Edited by KMJT

final int[] TIN_IDS = {1234, 1234, 1234, 1234};

 

Perfect, Thank you!

 

Another question, If the ID changes from those to something else, (assuming the ID's for a steaming rock are different than the un-mined rocks), then how do i make the script stop mining the rock?


RS2Object rock = closestObjectForName("rock");

if(rock != null) {

if(rock.interact("mine") {

RS2Object temp = closestObjectForName("rock");

//basically scans if the closest object is the same object you interacted with

while(rock == temp && rock.exists()) {

sleep(500);

}

}

Something like that i believe
RS2Object rock = closestObjectForName("rock");
   if(rock != null) {
      if(rock.interact("mine") {
         RS2Object temp = closestObjectForName("rock");
         //basically scans if the closest object is the same object you interacted with
      while(rock == temp && rock.exists()) {   
         sleep(500);
       } 
}
Something like that i believe

 

 

Sweet! Thanks

Rock ID's change, you're going to have to update this every week.

 

What other ways can i do it? If i do it by name, i won't be able to differ the mined from the un-mined rocks.

I don't mind updating it weekly if i have to.

What other ways can i do it? If i do it by name, i won't be able to differ the mined from the un-mined rocks.

I don't mind updating it weekly if i have to.

If you know the exact location of the rocks you're mining, you can just grab the rocks on those specific locations and store the ID.

 

The rocks of course will have to be full of ore so it doesn't grab the ID of the mined rock.

Edited by Swizzbeat

Guest
This topic is now closed to further replies.

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.