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.

Interact with interface.

Featured Replies

my first snippet biggrin.png

 

i was messing around trying to write a method to interact with an interface, i came up with this. It seems to work good smile.png

 

updated, Thanks Swizzbeat & Pseudo for the updated methods ! smile.png

public boolean interactWithInterface(int parent, int child, String action) throws InterruptedException {
        RS2InterfaceChild ic = this.client.getInterface(parent).getChild(child);
        return ic != null && ic.isVisible() && ic.interact(action);
    }

the way you use it:

interactWithInterface(parentId, ChildId, Action);

example of use:

interactWithInterface(304, 3, "Make X");

this would click the make x option on the fletching interface.

 

Hope it comes in handy smile.png

Edited by Shnocky

	RS2InterfaceChild Next = null;

make that next and not Next

I'm not sure why your settings up a child variable? Why not just do (as well as naming your variables with the correct conventions):

private boolean interactWithInterface(int parent, int child, String interaction) throws InterruptedException {
	RS2Interface interface = client.getInterface(parent);
	if (interface != null && interface.isVisible()) {
		interface.getChild(child).interact(interaction);
		return true;
	}
	return false;
}

isVisible() already checks for child elements being drawn, so there's no reason to make am RS2InterfaceChild variable. A regular RS2Interface works fine.

Edited by Swizzbeat

  • Author

I'm not sure why your settings up a child variable? Why not just do (as well as naming your variables with the correct conventions):

private boolean interactWithInterface(int parent, int child, String interaction) throws InterruptedException {
	RS2Interface interface = client.getInterface(parent);
	if (interface != null && interface.isVisible()) {
		interface.getChild(child).interact(interaction);
		return true;
	}
	return false;
}

isVisible() already checks for child elements being drawn, so there's no reason to make am RS2InterfaceChild variable. A regular RS2Interface works fine.

thanks, i didn't realize that :o ill update it!

 

make that next and not Next

 

Yeah forgot that :P

public boolean interactWithInterface(int parent, int child, String action) throws InterruptedException {
        RS2InterfaceChild ic = this.client.getInterface(parent).getChild(child);
        return ic != null && ic.isVisible() && ic.interact(action);
    }

^ Should work, I haven't tested it. Also please don't take offence at me posting this, people will be grateful for your contribution, just trying to outline how things can be done simpler/in less code with the same outcome. Good work, keep at it.

Edited by Pseudo

  • Author
public boolean interactWithInterface(int parent, int child, String action) throws InterruptedException {
        RS2InterfaceChild ic = this.client.getInterface(parent).getChild(child);
        return ic != null && ic.isVisible() && ic.interact(action);
    }

^ Should work, I haven't tested it. Also please don't take offence at me posting this, people will be grateful for your contribution, just trying to outline how things can be done simpler/in less code with the same outcome. Good work, keep at it.

 

hmm, when i get a chance ill test this. And no i don't take any offence to that. just trying to give back to the community thats helped me so much :p and theres always room for improvements on code :)

Hi guys, this is really useful thanks, but am I able to use this function for click in the chat window? i.e. "Click here to Continue" and selecting options in the menu? if so how do I set it? I can only get it to click on talk-to on the game screen.

 

also i'm struggling to see what the parent and child ids are? looked in the api but it aint helping

Edited by blood1000

Client settings, go in to Advanced and check 'Interfaces' Then hover over the interface you want to interact with. The color of the box will co-respond to two numbers that show up on the side of your screen, they are parent, child. In order.

Client settings, go in to Advanced and check 'Interfaces' Then hover over the interface you want to interact with. The color of the box will co-respond to two numbers that show up on the side of your screen, they are parent, child. In order.

Thank you so much :D 

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.