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.

Interacting (clicking) with widget w/o any interactActions

Featured Replies

I can only hover() this widget, but how could I click it?

 

s1LPBfc.png

 

What I've tried so far:

		Mouse mouse = new Mouse();
		mouse.click(mouse.getPosition().x, mouse.getPosition().y, false);
ava.lang.NullPointerException
	at org.osbot.rs07.script.MethodProvider.execute(kc:642)
	at org.osbot.rs07.api.Mouse.click(no:157)

  • Author

It doesn't work without the first line though.

 

edit: not like it works with it

Edited by todamach

You should have access to the mouse api in your script, so you can use mouse.click(false) directly. You can not create a new mouse since that mouse doesn't have access to the bot instance and can therefore not inject mouse events.

  • Author

Yeah, that was a silly mistake. Thank you very much for responding.

 

It's a separate class with a constructor 

	public MinMaxPrice(Script sI) {
		this.sI = sI;
	}

So I have to do it like this:

sI.mouse.click(sI.mouse.getPosition().x, sI.mouse.getPosition().y, false);

If you want to buy something at GE take a look at the GrandExchange class in the OSBot API.

Edited by Rudie

  • Author

If you want to buy something at GE take a look at the GrandExchange class in the OSBot API.

 

Oh, I did. There's nothing in there for selecting an item from the widget that I've mentioned higher. Also, api for button to confirm offer (sell or buy) doesn't work too. setQuantity and getQuantity isn't working either. I made custom methods for all of that. Still, GE API is pretty decent. Can't complain.

Oh, I did. There's nothing in there for selecting an item from the widget that I've mentioned higher. Also, api for button to confirm offer (sell or buy) doesn't work too. setQuantity and getQuantity isn't working either. I made custom methods for all of that. Still, GE API is pretty decent. Can't complain.

So, you just want to click where the mouse is hovering? That would be very simple:

mouse.click(false);
  • Author

Yeah, I, kind of, figured it out at the start. Just made a silly mistake implementing it. 

RS2Widget widget = widgets.get(parentId, childId);

if(widget != null) {

        widget.interact();

}

 

or

 

if(widget != null) {

        mouse.click(new RectangleDestination(bot, widget.getRectangle());

}

RS2Widget widget = widgets.get(parentId, childId);

if(widget != null) {

        widget.interact();

}

 

or

 

if(widget != null) {

        mouse.click(new RectangleDestination(bot, widget.getRectangle());

}

 

 

Going off this, he would have to check the mini widget for every item that pops up, which might be a pain in the ass to store as it could change depending on how many items are filtered out using the search bar.

 

E.g.

User searches Feather

Results: [Feather]   [blue Feather]   [Red Feather]

Blue feathers widget might be 399, 11 for example, but if the user searches Blue Feather

The result would just be: [blue Feather] and the widget could change to 399, 10

Going off this, he would have to check the mini widget for every item that pops up, which might be a pain in the ass to store as it could change depending on how many items are filtered out using the search bar.

 

E.g.

User searches Feather

Results: [Feather]   [blue Feather]   [Red Feather]

Blue feathers widget might be 399, 11 for example, but if the user searches Blue Feather

The result would just be: [blue Feather] and the widget could change to 399, 10

 

It assumes that 'widget' is the correct widget (the correct item in the list).

I'm not going to get into how you'll get that widget. You can use parentId, childId & gchildId; or you could use something like widgets.containingText

 

How to interact with the widget is not changed by this

 

It assumes that 'widget' is the correct widget (the correct item in the list).

I'm not going to get into how you'll get that widget. You can use parentId, childId & gchildId; or you could use something like widgets.containingText

 

How to interact with the widget is not changed by this

 

 

Ahh yes, forgot about containingText.

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.