Jump to content

Best way to select item?


Dab in a Lab

Recommended Posts

Currently I just have the mouse move to these coordinates over the item when trying to buy an item at the GE, but I don't know how to get it to click it

https://gyazo.com/a28e5606ee3fc24e5870809fe88ce616

I've tried getMouse().click(MouseDestination  destination) and define a destination for the mouse, but it wouldn't accept my statement. I also tried setting up a ClickMouseEvent, but it also didn't accept my statement for that. 

For defining the MouseDestination and ClickMouseEvent I tried defining them as:

MouseDestination mouse_dest = getMouse().move(x:75 , y:385);         I saw MouseDestination has a .getArea() but I didn't know how to set that up.

or

ClickMouseEvent mouse_click =  " " 

Edited by Dab in a Lab
Link to comment
Share on other sites

https://osbot.org/api/org/osbot/rs07/api/ui/RS2Widget.html

there's a widget debugger that helps you find out more info about that little "iron ore item"

Settings -> Options -> Debug tab -> Toggle on Widgets -> Open Widget Debugger

now hover over the iron ore and you'll see several IDs pop up. type the root/child+/child++ in the debugger, hit query, and you'll see more data about that widget.

(make sure you hover and choose the right IDs)

 

after you find the right widget, you can just .interact() or w/e

 

later on you can search/filter widgets based on other values. seems ids change often

  • Like 1
Link to comment
Share on other sites

52 minutes ago, HeyImJamie said:

Wut the Feck you find MouseDestination and ClickMouseEvent but not Widgets?

 

44 minutes ago, Stimpack said:

https://osbot.org/api/org/osbot/rs07/api/ui/RS2Widget.html

there's a widget debugger that helps you find out more info about that little "iron ore item"

Settings -> Options -> Debug tab -> Toggle on Widgets -> Open Widget Debugger

now hover over the iron ore and you'll see several IDs pop up. type the root/child+/child++ in the debugger, hit query, and you'll see more data about that widget.

(make sure you hover and choose the right IDs)

 

after you find the right widget, you can just .interact() or w/e

 

later on you can search/filter widgets based on other values. seems ids change often

When I tried to do the widget debugger earlier it told me the action options were null. Is that just because there is no "action" other than clicking it? I didn't think to try it, so instead I tried finding a way using some kind of mouse event

Link to comment
Share on other sites

1 hour ago, Dab in a Lab said:

 

When I tried to do the widget debugger earlier it told me the action options were null. Is that just because there is no "action" other than clicking it? I didn't think to try it, so instead I tried finding a way using some kind of mouse event

Yeah you just use .interact() with a widget you don't need to specify the action 

Link to comment
Share on other sites

12 hours ago, Dab in a Lab said:

Currently I just have the mouse move to these coordinates over the item when trying to buy an item at the GE, but I don't know how to get it to click it

https://gyazo.com/a28e5606ee3fc24e5870809fe88ce616

I've tried getMouse().click(MouseDestination  destination) and define a destination for the mouse, but it wouldn't accept my statement. I also tried setting up a ClickMouseEvent, but it also didn't accept my statement for that. 

For defining the MouseDestination and ClickMouseEvent I tried defining them as:

MouseDestination mouse_dest = getMouse().move(x:75 , y:385);         I saw MouseDestination has a .getArea() but I didn't know how to set that up.

or

ClickMouseEvent mouse_click =  " " 

image.png.851e769dd9e4d96cb17dbd86dac0e3d4.png

Why would you think this returns a MouseDestination :think:

  • Boge 1
Link to comment
Share on other sites

As a general rule of thumb, i'd avoid controlling the mouse directly (either moving it or clicking), unless there really isn't an alternative. The reason for this is there are a bunch of checks and precautions that need to be considered before doing such an action, which the API does for you when you use built in methods.

I'm sure you can find some form of higher level API functionality to solve this problem for you, most likely via the Widget API.

Best

--Apa

  • Like 2
Link to comment
Share on other sites

6 hours ago, ItPoke said:

If you are trying to interact with the GE why not just use the build in GE API? :)

 

4 hours ago, Canidae said:

What is the reason you're not using the built-in buy method?

 

The built in method that interacts with everything for you doesn't seem to allow a +5 or 10% raise in the item price, so I'm building my own and have it interact with everything.

 

3 hours ago, thedevilhacker said:

Maybe the built in method is too slow for his needs? Personally i think osbots dialogue handler is really slow and cuts into my p/h for my moneymaking method. So i had my private scripter write their own method to make it faster :)

The dialogue can be a bit unresponsive and be delayed to show up, but I put in a check for it, so it doesn't have any issues

Link to comment
Share on other sites

32 minutes ago, Dab in a Lab said:

 

The built in method that interacts with everything for you doesn't seem to allow a +5 or 10% raise in the item price, so I'm building my own and have it interact with everything.

 

The dialogue can be a bit unresponsive and be delayed to show up, but I put in a check for it, so it doesn't have any issues

You could grab the price from OSBuddy's API. I think there's a snippet from that somewhere. You could just increase the price by 1.05 or 1.10, this makes it way too difficult.

Link to comment
Share on other sites

25 minutes ago, Canidae said:

You could grab the price from OSBuddy's API. I think there's a snippet from that somewhere. You could just increase the price by 1.05 or 1.10, this makes it way too difficult.

I got some help trying to use osbuddys price api, but I’m not experienced enough right now. It just looked like a cluster fuck of info 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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