getWidgets().getWidgetContainingText("Click on the flashing backpack icon to the right hand side") != null
though this is how I use it for tutorial island
@Override
public void run() throws InterruptedException {
RS2Widget w = getWidgets().get(548, 54);
WidgetDestination m = new WidgetDestination(getBot(),w);
ClickMouseEvent g = new ClickMouseEvent(m);
if(w != null && w.isVisible())
{
execute(g);
//w.interact("Inventory");
sleep(500 + random (100, 600));
}
}
or do fix it your way
if (!getTabs().getOpen().equals(Tab.INVENTORY)) getTabs().open(Tab.INVENTORY);