Jump to content

Smoking rock detection


deathbydoob

Recommended Posts

ehh very inefficient method of detecting it

Simple

    public RS2Object currentlyMining = null;
    public int objectId = -1; //Rock id here
 
    public RS2Object getNextRock() {
        return closestObject(objectId);
    }
 
    public void execute() {
        if(currentlyMining == null) {
            currentlyMining = getNextRock();
        }
        if(!currentlyMining.exists()) {
            if(myPlayer().isAnimating()) {
                 //click position or run (smoking rock appeared)
            }
            currentlyMining = getNextRock();
        }
        if(currentlyMining.exists() && !myPlayer().isAnimating()) {
            //mine rock and sleep method here
        }
    }

Something along those lines, if the object you were mining no longer exists and you are stilling performing the mining action the smoking rocks appeared

NOTE: wrote code in reply box so it might need some modifications/alterations to work

Edited by LifezHatred
Link to comment
Share on other sites

ehh very inefficient method of detecting it

Simple

    public RS2Object currentlyMining = null;
    public int objectId = -1; //Rock id here
 
    public RS2Object getNextRock() {
        return closestObject(objectId);
    }
 
    public void execute() {
        if(currentlyMining == null) {
            currentlyMining = getNextRock();
        }
        if(!currentlyMining.exists()) {
            if(myPlayer().isAnimating()) {
                 //click position or run (smoking rock appeared)
            }
            currentlyMining = getNextRock();
        }
        if(currentlyMining.exists() && !myPlayer().isAnimating()) {
            //mine rock and sleep method here
        }
    }

Something along those lines, if the object you were mining no longer exists and you are stilling performing the mining action the smoking rocks appeared

NOTE: wrote code in reply box so it might need some modifications/alterations to work

 

I was thinking about the original code I posted earlier, and i believe the only issue was that if there was no other rocks ready to mine the player would continue to mine the smoking rock. I have edited the original code posted to reflect what im using and will update everyone once I get some more testing done on it.

Link to comment
Share on other sites

I was thinking about the original code I posted earlier, and i believe the only issue was that if there was no other rocks ready to mine the player would continue to mine the smoking rock. I have edited the original code posted to reflect what im using and will update everyone once I get some more testing done on it.

not to be mean but after looking at the modification of the code it doesn't seem you know what it does (at least not in its entirety).

Edited by LifezHatred
Link to comment
Share on other sites

I have this code, but it doesn't seem to work. The other methods on here only work randomly. IDK >>

RS2Object rock = closestObject(GEM_ID);

	        if(rock.exists() && !myPlayer().isAnimating()) {
	        	if (rock != null) {
	        		if (rock.interact("Mine"))
	        			curRock = rock;
	        			sleep(random(1000, 1500));
	        	}
	        }		
	        if(!curRock.exists()) {
	            if(myPlayer().isAnimating()) {
	            	traversePath(avoid, true);
					sleep(random(1500, 2500));
	            }
	        }			
			
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...