Try doing something like,
RS2Widget createRoom = getWidgets().get(422, 5, 99);
if (createRoom != null) {
if (createRoom.interact("Add room")
Sleep.sleepUntil(() -> someSortOfCheckToSeeIfTheRoomIsCreated, 1500, 250); //Or if you don't have the Sleep class for this you can do
new ConditionalSleep(1500, 250) {
public boolean condition() {
return someSortOfCheckToSeeIfTheRoomIsCreated; //could be wrong on the syntax of this but it gives you an idea!
}
}
}
Also one thing I'd advice against is using widget ids as they can often change, so using text within the interface is always better!
Using the containingText# function
https://osbot.org/api/org/osbot/rs07/api/Widgets.html