Jump to content

"Make X" Option...


Recommended Posts

Posted

My first time playing with this API. I wanted to figure out how to properly tell the bot to Make X when making arrow shafts.... This is what I got so far..

 

 

public void MakeShaft() throws InterruptedException {
if(this.inventory.contains(Logs)
&& this.inventory.isFull());
Item Knifes = inventory.getItem(Knife);
Item Log = inventory.getItem(Logs);
Knifes.interact("Use");
Log.interact("Use");
interfaces.interactWithChild(305, 2, "Make 1");
while(myPlayer().isAnimating()){
sleep(1000);
}
 
}
Posted (edited)

The interface takes a second or 2 to appear after using a knife on a log; You don't seem to be waiting for that.

This means that the interaction will likely fail. Perhaps insert a conditionalsleep after using the knife on the log

		new ConditionalSleep(3000) {

			@Override
			public boolean condition() throws InterruptedException {
				return interfaces.getChild(305, 2) != null;
			}
			
		}.sleep();
Edited by FrostBug
Posted

 

The interface takes a second or 2 to appear after using a knife on a log; You don't seem to be waiting for that.

This means that the interaction will likely fail. Perhaps insert a conditionalsleep after using the knife on the log

		new ConditionalSleep(3000) {

			@Override
			public boolean condition() throws InterruptedException {
				return interfaces.getChild(305, 2) != null;
			}
			
		}.sleep();

 

Don't just check null, check isvisible as well

Posted

 

The interface takes a second or 2 to appear after using a knife on a log; You don't seem to be waiting for that.

This means that the interaction will likely fail. Perhaps insert a conditionalsleep after using the knife on the log

		new ConditionalSleep(3000) {

			@Override
			public boolean condition() throws InterruptedException {
				return interfaces.getChild(305, 2) != null;
			}
			
		}.sleep();

 

It still shows up in time, but how do I make the script select "Make X" rather then one, due to it having to RIGHT Click first then select that. 

Posted (edited)

You can interact with the interface like so: 

interfaces.get(PARENT).getChild(CHILD).interact("Make-X");

Fill in the relevant fields of course happy.png

 

Does not work, the script just hovers over it. If I made it "Make 1" it would work. 

 

Fixed ** Thanks 

Edited by Kozs
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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