Jump to content

Using item on item help! :)


imancity

Recommended Posts

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
Link to comment
Share on other sites


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
Link to comment
Share on other sites

		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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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