FearMe Posted January 26, 2014 Share Posted January 26, 2014 What I did was check for the closest NPC by name, and if the rock you're currently mined changed to an NPC(it changes to an NPC when it's smoking, at least it's like this way with Ents), switch to another rock(can use closestObject... because it doesn't return the smoking rock/ent). Link to comment Share on other sites More sharing options...
LifezHatred Posted January 26, 2014 Share Posted January 26, 2014 (edited) 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 January 26, 2014 by LifezHatred Link to comment Share on other sites More sharing options...
deathbydoob Posted January 26, 2014 Author Share Posted January 26, 2014 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 More sharing options...
LifezHatred Posted January 26, 2014 Share Posted January 26, 2014 (edited) 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 January 26, 2014 by LifezHatred Link to comment Share on other sites More sharing options...
Parameter Posted January 26, 2014 Share Posted January 26, 2014 I'd say the best way to do this is to check if the object you interacted with at first still exists Link to comment Share on other sites More sharing options...
LifezHatred Posted January 26, 2014 Share Posted January 26, 2014 I'd say the best way to do this is to check if the object you interacted with at first still exists Was relayed multiple times and is within the code i posted, just hate to see someone copying what everyone else already stated Link to comment Share on other sites More sharing options...
Parameter Posted January 26, 2014 Share Posted January 26, 2014 Was relayed multiple times and is within the code i posted, just hate to see someone copying what everyone else already stated Oh, that's an attempt at what I posted? Oh my lord. Link to comment Share on other sites More sharing options...
LifezHatred Posted January 26, 2014 Share Posted January 26, 2014 Oh, that's an attempt at what I posted? Oh my lord. i know i about shit myself once i read something i read 20 times over, Really really really disturbing. Link to comment Share on other sites More sharing options...
Parameter Posted January 26, 2014 Share Posted January 26, 2014 i know i about shit myself once i read something i read 20 times over, Really really really disturbing. You don't even comprehend what I'm saying Link to comment Share on other sites More sharing options...
lingoling Posted January 26, 2014 Share Posted January 26, 2014 Well I will test all of these out and see what happens Link to comment Share on other sites More sharing options...
lingoling Posted January 31, 2014 Share Posted January 31, 2014 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 More sharing options...
lolmanden Posted February 1, 2014 Share Posted February 1, 2014 Ty for the contribution. Link to comment Share on other sites More sharing options...