Jump to content

Interacting (clicking) with widget w/o any interactActions


Recommended Posts

Posted

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)

Posted

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.

Posted

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);
Posted

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

Posted

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

 

Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...