Skip 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 help

Featured Replies

Hi everybody,

 

I need some help, I'm trying to make a monkfighter that will auto heal itself on the monk itself,

now i already have this bit of code: 

private void heal() throws InterruptedException {
	  NPC Monk = (NPC)this.npcs.closest(new String[] { "Monk" });
		if(Monk != null && !myPlayer().isUnderAttack() && !Monk.isUnderAttack()) {
			Monk.interact(new String[] { "Talk-to" });
			this.status = "healing at Monk";
		    getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
		    getInterfaces().get(219).getChild(1).interact(new String[] { "can" });
		    sleep(random(200,300));
		    getInterfaces().get(217).getChild(2).interact(new String[] { "continue" });
		    sleep(random(200,300));
		    getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
		    sleep(random(1000, 1500));
		}
	}

but in the loop when its opening the interfaces and starting to interact at "can", the onloop method refers back to this method so it will all start over again, meaning it will never go further than this line:

getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
 

so how do i do this?

thanks in advance,

 

Jelleplomp

  • Developer

You are getting an NPE error (nullpointer Exception)

 

If (231,2) doesn't get found it will return null.

So you do null.interact("Continue"); (and you can't really interact with something that doesn't exist right?)

 

You should stop using interfaces since the are deprecated.

Use RS2Widget instead.

 

You basicly to this:

RS2Widget chat1 = widgets.get(231,2)
if(chat1 != null && chat1.isVisible())
   chat1.interact("Continue");

Why are you using: (Did you decompile code? Decompilers generate this kind of code)

.interact(new String[] { "Continue" });

You can just do:

.interact("Continue");

Goodluck!

Khaleesi

Edited by Khaleesi

Umm, this should work; // Didn't test

if (!myPlayer().isInteracting(monk))) { // NOT INTERACTING
     if (monk != null) { // IF EXISTS
         if (monk.isVisible()) { // IS VISIBLE
             if (!dialogues.inDialogue()) { // NOT IN DIALOGUE
        monk.interact("Talk-to"); // INTERACTS
        log("Talking to monk"); // LOG
        sleep(random(500, 900)); // SLEEPS

}
}
} else if (dialogues.inDialogue()) { // IF IN DIALOGUE
               dialogues.clickContinue(); // CLICKS ON THE CONTINUE
               sleep(random(600, 1000)); //  SLEEPS
               dialogues.selectOption("Ok"); // GIVE THIS AN OPTION
               sleep(random(2500, 3500)); // SLEEPS
             }
} 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.