So I made a script that would make gold bracelets. It was working fine on OSBot 2.4.133 but now it won't work anymore on the new update. I'm not sure why, because it's using widgets to make it and those numbers are still the same.
Anyone has an idea why this would happen?
this is the code (Thanks Explv Tutorials)
private void make() {
if (!smeltingRoom.contains(myPosition())) {
getWalking().webWalk(smeltingRoom);
} else if (isMakeScreenVisible() || isEnterAmountPromptVisible()) {
if (makeXGold()) {
Sleep.sleepUntil(this::isEnterAmountPromptVisible, 3000);
}
if (enterRandomAmount()) {
Sleep.sleepUntil(() -> !canSmeltGoldBars() || getDialogues().isPendingContinuation(), 100_000);
}
} else if (useGold() & useFurnace()) {
Sleep.sleepUntil(this::isMakeScreenVisible, 5000);
}
}
private boolean canSmeltGoldBars() {
return getInventory().contains("Gold bar");
}
private boolean useFurnace() {
return getObjects().closest("Furnace").interact("Use");
}
private boolean useGold() {
return getInventory().interact("Use","Gold bar");
}
private boolean isMakeScreenVisible() {
return getWidgets().getWidgetContainingText("What would you like to make?") != null;
}
private boolean makeXGold() {
return getWidgets().get(446,47).interact("Make-X");
}
// Using a custom filter here instead of getWidgetContainingText() because it ignores widgets with root id 162
private boolean isEnterAmountPromptVisible(){
RS2Widget amountWidget = getWidgets().singleFilter(getWidgets().getAll(), widget -> widget.getMessage().contains("Enter amount"));
return amountWidget != null && amountWidget.isVisible();
}
private boolean enterRandomAmount() {
return getKeyboard().typeString("" + MethodProvider.random(28, 35));
}