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.

Detect ground items by name

Featured Replies

I'm looking to detect "pickaxe head"

I've done this.

String pickhead; -- under class

 

pickhead = "Pickaxe Head"; -- in "onLoop"
 

if (client.getGroundItemDeques().equals(pickhead)) {
log("i have detected a pickaxe head on the ground.");  -- in "onLoop"
}
 

If i am doing this wrong, please let me know. :)


 

Use this:

	public GroundItem getGroundItem(String name) {
		for(GroundItem item : client.getCurrentRegion().getItems()) {
			if(item != null) {
				if(item.getName().equalsIgnoreCase(name)) {
					return item;
				}
			}
		}
		return null;
	}

Edited by Soldtodie

 

Use this:

	public GroundItem getGroundItem(String name) {
		for(GroundItem item : client.getCurrentRegion().getItems()) {
			if(item != null) {
				if(item.getName().equalsIgnoreCase(name)) {
					return item;
				}
			}
		}
		return null;
	}

hmmm, thanks for clarifying. I sort of understand this, Here's what i got:

 

	public GroundItem getGroundItem(String name) {
		
		pickhead = "Pickaxe head";
		for(GroundItem item : client.getCurrentRegion().getItems()) {
			if(item != null) {
				if(item.getName().equalsIgnoreCase(pickhead)) {
					return item;
				}
			}
		}
		return null;
	}

-- Does it matter where i put that? I have it above "onLoop()"


and this at the top under script {

String pickhead;

Edited by Bitter

i just use

GroundItem hooters = closestGroundItemForName("Hooters");
if(hooters != null) {
if(hooters.isVisible()) {
hooters.interact("Squeeze");
} else {
client.moveCameraToEntity(hooters);
}

Edited by daviyow

 

i just use

GroundItem hooters = closestGroundItemForName("Hooters");
if(hooters != null) {
if(hooters.isVisible()) {
hooters.interact("Squeeze");
} else {
client.moveCameraToEntity(hooters);
}

To pick up the item, would i use this?:

hooters.interact("Take");

And yes, i know to change hooters to my variables and things. Just unsure if what you have here will work for picking up a ground item and using it on the (equipped) pickaxe handle.

Edited by Bitter

yeah take will work you need a different method for equipping tho

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.