Jump to content

Typing into a dialogue


Recommended Posts

Posted

Trying to type in the amount of things to make when you interact with an item "Make X".

So far I have this, but I don't think it is the best way to do it.

                widgets.interact(gui.getWidget()[0], gui.getWidget()[1], "Make X");
		cSleep(3000, widgets.isVisible(548, 120));
		sleep(random(150, 250));
		keyboard.typeString("99", true);

Still manages to type 99 into the chat sometimes

 

Also, while Im here I may as well ask

Is there something in the api to "Use" an item on another item

e.g. a Knife on logs.

Right now im doing something like this

	Item item = inventory.getItem("Knife");
		item.interact("Use");
		inventory.getItem(gui.getLogType()).hover();
		mouse.click(false);
Posted

 

Trying to type in the amount of things to make when you interact with an item "Make X".

So far I have this, but I don't think it is the best way to do it.

                widgets.interact(gui.getWidget()[0], gui.getWidget()[1], "Make X");
		cSleep(3000, widgets.isVisible(548, 120));
		sleep(random(150, 250));
		keyboard.typeString("99", true);

Still manages to type 99 into the chat sometimes

 

Also, while Im here I may as well ask

Is there something in the api to "Use" an item on another item

e.g. a Knife on logs.

Right now im doing something like this

	Item item = inventory.getItem("Knife");
		item.interact("Use");
		inventory.getItem(gui.getLogType()).hover();
		mouse.click(false);

 

Use this:

if (script.colorPicker.isColorAt(505, 390, new Color(174, 160, 131))) {
   script.keyboard.typeString("" + 99);
}

Checks if you are able to input text, Uses a color to determine if scrollbar is gone.

 

For the "Use" thing:

This is what i use:

public static void useItemOnItem(String name1, String name2, Script script) {
   if (script.widgets.getInventory().getSelectedItemName() != null && script.widgets.getInventory().getSelectedItemName().equals(name1)) {
   Item item = script.widgets.getInventory().getItem(name2);
      if (item != null)
	 item.interact("Use");
   } else {
      Item item = script.widgets.getInventory().getItem(name1);
         if (item != null)
            item.interact("Use");
   }
}

Hope this helped! :)

 

Khaleesi

  • Like 1

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...