Dab in a Lab Posted May 16, 2018 Share Posted May 16, 2018 (edited) 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 May 16, 2018 by Dab in a Lab Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted May 16, 2018 Share Posted May 16, 2018 Wut the Feck you find MouseDestination and ClickMouseEvent but not Widgets? 1 1 Quote Link to comment Share on other sites More sharing options...
Stimpack Posted May 16, 2018 Share Posted May 16, 2018 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 1 Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 16, 2018 Author Share Posted May 16, 2018 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 Quote Link to comment Share on other sites More sharing options...
Tommm39 Posted May 16, 2018 Share Posted May 16, 2018 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 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 17, 2018 Share Posted May 17, 2018 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 = " " Why would you think this returns a MouseDestination 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted May 17, 2018 Share Posted May 17, 2018 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 2 Quote Link to comment Share on other sites More sharing options...
ItPoke Posted May 17, 2018 Share Posted May 17, 2018 If you are trying to interact with the GE why not just use the build in GE API? :) Quote Link to comment Share on other sites More sharing options...
Canidae Posted May 17, 2018 Share Posted May 17, 2018 What is the reason you're not using the built-in buy method? Quote Link to comment Share on other sites More sharing options...
The Devil Posted May 17, 2018 Share Posted May 17, 2018 (edited) 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 Edited May 17, 2018 by thedevilhacker Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 17, 2018 Author Share Posted May 17, 2018 8 hours ago, FrostBug said: Why would you think this returns a MouseDestination Hahahaha well its a destination and it uses the mouse, so I tried to make it a MouseDestination Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 17, 2018 Author Share Posted May 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
Canidae Posted May 17, 2018 Share Posted May 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 17, 2018 Author Share Posted May 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
Juggles Posted May 17, 2018 Share Posted May 17, 2018 Inventory.interact("use", "item"); Quote Link to comment Share on other sites More sharing options...