Jump to content

"Make X" Option...


Kozs

Recommended Posts

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

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

 

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

Link to comment
Share on other sites

 

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. 

Link to comment
Share on other sites

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. 

 

You can interact with the interface like so: 

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

Fill in the relevant fields of course ^_^

Link to comment
Share on other sites

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

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