Jump to content

Using item on item help! :)


Recommended Posts

Posted (edited)

So I have a personal script where I use one item on another and then interact with the widget to "Make All". So far, the script works, but my only problem is that the player will "Use" multiple times before actually interacting with the widget, and then after using the widget "Make All" he'll also select the item in the inventory again randomly until it's time to bank.

 

This doesn't affect the script itself but I feel like its very clearly bot behavior and would like to fix it.

 

Here's my code for that part (I've changed variable names to anonymize it).

 

Thanks in advance for any help!

case MAKE:
                sleep(500);

                if ((getInventory().contains("ITEM1")) && (getInventory().contains("ITEM2")) && !myPlayer().isAnimating()) {
                    inventory.interact("Use", "ITEM1");
                    inventory.interact("Use", "ITEM2");
                    sleep(500);

                    if (getWidgets().isVisible(309, 4)) {
                        getWidgets().interact(309, 4, "Make All");
                        new ConditionalSleep(5000) {
                            @Override
                            public boolean condition() throws InterruptedException {
                                return myPlayer().isAnimating();
                            }
                        }.sleep();
                    }
                }
                break;
Edited by imancity
Posted


if (getInventory().contains("ITEM1") && getInventory().contains("ITEM")) {

if (!getWidgets().isVisible(309, 4)) {

if (getInventory().interact("Use", "ITEM1")) {

if (getInventory().interact("Use", "ITEM2")) {

new org.osbot.rs07.utility.ConditionalSleep(5000) {

@Override

public boolean condition() throws InterruptedException {

return getWidgets().isVisible(309, 4);

}

}.sleep();

}

}

} else {

if (getWidgets().interact(309, 4, "Make All")) {

new ConditionalSleep(100_000) {

@Override

public boolean condition() throws InterruptedException {

return !getInventory().contains("ITEM1") || getDialogues().isPendingContinuation();

}

}.sleep();

}

}

}

  • Like 1
Posted
		if (getInventory().contains("ITEM1") && getInventory().contains("ITEM")) {
			if (!getWidgets().isVisible(309, 4)) {
				if (getInventory().interact("Use", "ITEM1")) {
					if (getInventory().interact("Use", "ITEM2")) {
						new org.osbot.rs07.utility.ConditionalSleep(5000) {
							@Override
							public boolean condition() throws InterruptedException {
								return getWidgets().isVisible(309, 4);
							}
						}.sleep();
					}
				}
			} else {
				if (getWidgets().interact(309, 4, "Make All")) {
					new ConditionalSleep(100_000) {
						@Override
						public boolean condition() throws InterruptedException {
							return !getInventory().contains("ITEM1") || getDialogues().isPendingContinuation();
						}
					}.sleep();
				}
			}
		}

 

Perfect!!! :D Thanks a ton man. (I'm sure you know what those 'items' are supposed to be too :P)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...