Thanks gunman, this is what it logs :
[INFO][Bot #1][04/22 11:00:45 PM]: RootId: 15
[INFO][Bot #1][04/22 11:00:45 PM]: ChildId: 8
[INFO][Bot #1][04/22 11:00:45 PM]: GrandChildId: -1
So i guess i should include -1?
Also i got it to run by using .isvisible instead of nullchecking, i got a null exception error but it ran still, but id rather do it properly.
This is my code now :
RS2Widget depositLootingBag = getWidgets().get(15, 2, 0);
RS2Widget bagEmpty = getWidgets().getWidgetContainingText("The bag is empty.");
RS2Widget depositLootButton = getWidgets().get(15, 8 , -1);
RS2Widget dismiss = getWidgets().getWidgetContainingAction("Dismiss");
if (getBank().isOpen()) {
Item lootingBag = getInventory().getItem("Looting bag");
if (depositLootingBag != null) {
log("Lets deposit looting bag items.");
lootingBag.interact("View");
Util.Sleep.sleepUntil(() -> depositLootButton !=null, 10000);
if (depositLootButton !=null) {
log("Item in bag to deposit.");
depositLootButton.interact("Deposit loot");
Util.Sleep.sleepUntil(() -> bagEmpty !=null, 5000);
if (bagEmpty !=null) {
log("Clicking dismiss.");
dismiss.interact("Dismiss");
}
}
return 100;
}
}