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.

Ring of wealth teleport

Featured Replies


private void wealth(String option) {

if (getEquipment().interact(EquipmentSlot.RING, option)) {

Position current = myPlayer().getPosition();

new ConditionalSleep(1500, 2000) {

@Override

public boolean condition() {

return !myPlayer().getPosition().equals(current);

}

}.sleep();

} else {

for (Item item : getInventory().getItems()) {

if (item != null && item.getName().contains("wealth") && item.getName().matches(".*\\d+.*")) {

item.interact("wear");

new ConditionalSleep(1500, 2000) {

@Override

public boolean condition() {

return getEquipment().isWearingItem(EquipmentSlot.RING, item.getId());

}

}.sleep();

break;

}

}

}

}

Edited by LoudPacks

private void wealth() {
		if (!getEquipment().isWearingItem(EquipmentSlot.RING, "Ring of wealth") && getEquipment().interact(EquipmentSlot.RING, "Grand exchange")) {
			Position current = myPlayer().getPosition();
			new ConditionalSleep(1500, 2000) {
				@Override
				public boolean condition() {
					return !myPlayer().getPosition().equals(current);
				}
			}.sleep();

		} else {
			for (Item item : getInventory().getItems()) {
		if (item != null && item.getName().contains("wealth") && item.getName().matches(".*\\d+.*")) {
					item.interact("wear");
					new ConditionalSleep(1500, 2000) {
						@Override
						public boolean condition() {
					return getEquipment().isWearingItem(EquipmentSlot.RING, item.getId());
						}
					}.sleep();
					break;
				}
			}
		}

	}
!getEquipment().isWearingItem(EquipmentSlot.RING, "Ring of wealth")

This ensures the script doesn't attempt to teleport with a ring that has no charges. Probably isn't necessary, however nice code man!

Edited by Gold Scripts

  • 8 months later...

		if (item.getName().matches(".*\\d+.*")) {
					

Nice one but i didnt understand what does this mean!

Could you please explain it to me ?

@@LoudPacks

 

  • Author

 


		if (item.getName().matches(".*\\d+.*")) {
					

Nice one but i didnt understand what does this mean!

Could you please explain it to me ?

@@LoudPacks

 

 

 

It's called a regular expression, REGEX for short. Once you learn the syntax you can use it to build a regular expression that can be used to match parts of text or extract certain patterns from text. In this case, ".*\\d+.*" looks for any amount of text:" .*" followed by a number or series of numbers "\\d+", followed by any amount of text ".*" so any string that contains a number in it would be a match, for example "Amulet of glory (4)", "Amulet of glory (" is matched by the first ".*" the "4" is matched by the "\\d+" and the ")" is matched by the second ".*" but would also still match if there was no text after the 4.

It's called a regular expression, REGEX for short. Once you learn the syntax you can use it to build a regular expression that can be used to match parts of text or extract certain patterns from text. In this case, ".*\\d+.*" looks for any amount of text:" .*" followed by a number or series of numbers "\\d+", followed by any amount of text ".*" so any string that contains a number in it would be a match, for example "Amulet of glory (4)", "Amulet of glory (" is matched by the first ".*" the "4" is matched by the "\\d+" and the ")" is matched by the second ".*" but would also still match if there was no text after the 4.

 

Ohh thanks bro ;)

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.