Jump to content
Tom

Typing into a dialogue

Recommended Posts

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

 

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

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