So, after working on making a mining script I stumbled upon the problem of bubbling rocks. As I couldn't find a clear description on how to solve this problem, I created a solution for myself. After testing it as part of my script, I saw it work. It works on the basis that smoking rocks have a larger height in comparison to normal rocks. Here is the code in context:
public int onLoop() throws InterruptedException {
switch (getState()) {
case MINE:
if (!myPlayer().isAnimating()) {// IF PLAYER IS NOT ANIMATING
// (MINING)
RS2Object vein = closestObject(TRIPLE_ROCK_AREA, IRON_ID);
if (vein != null)
if (TRIPLE_ROCK_AREA.contains(myPlayer())) {
if (vein.interact("Mine"))
sleep(random(600, 1850));
} else { // IF PLAYER IS ANIMATING (MINING)
if (!(vein.getModel().getHeight() < 80))
walk(TRIPLE_ROCK_AREA); //Walk away from Bubbling Rock
}
if (client.getMyPlayer().isAnimating()) {
AntiBan();
}
}
So to avoid the rock I have made the script walk to an area (defined as TRIPLE_ROCK_AREA) which ensures that it doesn't mine the rock.
if (!myPlayer().isAnimating()) {// IF PLAYER IS NOT ANIMATING (Mining) // (MINING)
RS2Object vein = closestObject(TRIPLE_ROCK_AREA, IRON_ID);
if (vein != null)
if (TRIPLE_ROCK_AREA.contains(myPlayer())) {
if (vein.interact("Mine"))
sleep(random(600, 1850));
} else { // IF PLAYER IS ANIMATING (MINING)
if (!(vein.getModel().getHeight() < 80))//Decides whether rock is Bubbling or not.
walk(TRIPLE_ROCK_AREA); //Walk away from Bubbling Rock
Let me know if you have any further questions.
*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT*EDIT SCRIPT DOESN'T WORK! We need a solution to this problem in the snippets directory. Anyone got any further ideas of how to detect for smoking rocks?