Zappster Posted December 23, 2017 Posted December 23, 2017 (edited) I've got this thing and it's bugging me like crazy. In RS in the top left part of the screen, there's text. It shows you what you have your mosue over. Either Walk here, Eat <item>, attack <player/npc> etc. I need to get that text. I thought it was a widget so I tried to pull it with; private final MethodProvider M; public WidgetViewer(MethodProvider m){ M = m; } public void getAction(){ RS2Widget w =M.getWidgets().getWidgetContainingText("Walk here"); if(w != null){ M..log("Root id: "+w.getRootId()); }else{ M.log("Widget null"); } } But this always returns Null. I can't seem to locate the widget IDs using the debug tools either. So my next option was to pull the canvis, get the component and read the text inside of it; M.getBot().getCanvas().getComponentAt(13,13).getName(); returns "Canvas0". When I pull the component's boundry with: Canvas c = M.getBot().getCanvas(); Component component = c.getComponentAt(13,13); Bounds b = component.getBounds(); int x = b.getMixX; int y = b.getMaxY; M.log("X: "+x+" Y: "+y); I get: x: 0 y: 513, so it's pulling the main screen window minus the minimap/inventory and chatbox. Is there any way to read the contents of that string? Edited December 23, 2017 by Zappster
Alek Posted December 23, 2017 Posted December 23, 2017 What the actual f***. Menu.getTooltip() or Menu.getMenu()[0] 3
Zappster Posted December 23, 2017 Author Posted December 23, 2017 4 minutes ago, Alek said: What the actual f***. Menu.getTooltip() or Menu.getMenu()[0] Thank you so much! Menu.getMenu().get(0); is what did it for me. 1