Jump to content

Avoiding Exploding rocks


Recommended Posts

Posted

Does it turn into an NPC? Or does it giveout an animation?

 

I believe it has an animation, and I've noticed that it has a verticeCount > 128 (due to the added animation), while regular rocks have a verticeCount < 128, so I tried

while (client.getMyPlayer().isAnimating()) {
	if (closestRock.getModel().getVerticeCount() > 128) {
		walkMiniMap(new Position(client.getMyPlayer().getPosition().getX() + random(-1, 1), client.getMyPlayer().getPosition().getY() + random(-1, 1), 0));
		this.MRT = random(2048, 4096);
		sleep(this.MRT);
	}
}

, but it isn't working...

your rock id changes, make a constant check on what your player is interacting with.

 

Can you point me to the method that allows me to get the object that my character is interacting with?

Posted
RS2Object rock = closestObjectForName("rock");
if(rock != null) {
if(rock.interact("mine") {
RS2Object temp = closestObjectForName("rock");

//basically scans if the closest object is the same object you interacted with
while(rock == temp && rock.exists()) {
sleep(500);
} 

}
}

Cheap method i use

Posted (edited)

As an example, when I successfully click on a tree and begin cutting, I set a global RS2Object named currentTree to the tree I just cut. Then I have it constantly check to see if the ID changes. When a tree turns into an ent my script changes to a different tree (automatic), or if there is none, walks away to stop cutting (extra method). I imagine you could do the same with exploding rock.

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

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