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.

Interface based condition not working? halp pl0x

Featured Replies

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2457,3105,0));
				sleep(random(2000,2200));
			} else if (balloonGuy != null && !client.getInterface(469).isVisible()) { 
				if(balloonGuy.isVisible()) {
					balloonGuy.interact("Fly");
					sleep(random(2000,2200));
				}
			} else if (client.getInterface(469).isVisible()) {     // this seems to be doing nothing, where did I do a mistake?
				client.getInterface(469).getChild(26).interact();
				sleep(random(8000,9000));
			}

So I walk up to the guy, interact with him - the interface opens up. Then it waits a little while, closes the interface and interacts with the guy again - like it ignores the last "else if" completely.

 

Also if anyone knows of some rectangle area interaction thread where it was discussed - a link would be appreciated as I remember seeing it somwhere and even following it, but somehow the list of threads I follow is being reset like quite often :/

It's probably throwing an exception since you're invoking #isVisible() on a null instance. Create an RS2Interface object like so:

final RS2Interface parent = client.getInterface(469);

and do a null check on it before doing any type of interaction/method.

Edited by Swizzbeat

  • Author

Declared

final RS2Interface parent = client.getInterface(469);

at the beginning of my onLoop(). Then changed the code in the body to this:

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2457, 3105, 0));
				sleep(random(2000, 2200));
			} else if (balloonGuy != null) {
				if (balloonGuy.isVisible()) {
					balloonGuy.interact("Fly");
					sleep(random(2000, 2200));
				} else {
					client.moveCameraToEntity(balloonGuy);
				}
			} else if (parent != null) { // change here
				if (client.getInterface(469).isVisible()) {
					client.getInterface(469).getChild(25).interact();
					sleep(random(8000, 9000));
				}
			}

And it still does the same thing...

  • Author

Thanks Swizz...

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2456 +random(0,2), 3104 +random(0,2), 0));
				sleep(random(2000, 2200));
			} else if (balloonGuy != null && !new ColorPicker(bot).isColorAt(275, 175, new Color(168, 144, 97))) {
				if (balloonGuy.isVisible()) {
					if(!player.isMoving()) {
						balloonGuy.interact("Fly");
						sleep(random(2000, 2200));
					}
				} else {
					client.moveCameraToEntity(balloonGuy);
				}
			} else if (new ColorPicker(bot).isColorAt(275, 175, new Color(168, 144, 97))) { //gotta love color picker
					client.moveMouseTo(new RectangleDestination(365, 40,
							70, 15), false, true, false);
					sleep(random(8000,9000));
			}

Edited by blabla123

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.