How would I store that? By using the position of the rock?
I'm currently using closest object that matches my rock ID.
private RS2Object getMiningRocks(){
RS2Object miningSpot = getObjects().closest(ORE_IDS);
if (miningSpot != null){
if(miningSpot.hasAction("Mine")){
return miningSpot;
}
}
return null;
}
if (miningSpot.isVisible() && miningSpot.interact("Mine")) {
status = "Clicking Rock";
new ConditionalSleep(5000) {
@Override
public boolean condition() {
return myPlayer().isAnimating() || !miningSpot.exists();
}
}.sleep();
}
With this code, if someone mines the rock before me, the mining spot will still exist if there is another rock close there for not breaking the sleep.
I've been using your guide, its very helpful
Thanks I'll take a look into this, I'm sure there is an easy way of achieving what I need to, but I'm learning everything again as it's been a while.