Guest Apogee Posted April 12, 2014 Share Posted April 12, 2014 I know of several ways to do this, but what would be the best/easiest? I want the script to detect the steaming rock and instantly stop mining. I also want the script to get the pickaxe head if it falls off.Open to any ideas and will appreciate any input. Thank you. Link to comment Share on other sites More sharing options...
Tsopic Posted April 12, 2014 Share Posted April 12, 2014 For smoking rocks you can use model height detection or gather all smoking rock id-s and then detect if u are interacting with one, and for pickaxe head check for grounditems. Link to comment Share on other sites More sharing options...
Guest Apogee Posted April 12, 2014 Share Posted April 12, 2014 For smoking rocks you can use model height detection or gather all smoking rock id-s and then detect if u are interacting with one, and for pickaxe head check for grounditems. I got the pickaxe head working i think, i just can't get the smoking rocks to work. :\ Any tips? Link to comment Share on other sites More sharing options...
Declarative Posted April 12, 2014 Share Posted April 12, 2014 I got the pickaxe head working i think, i just can't get the smoking rocks to work. :\ Any tips? He gave you a tip... Height, smoking rock height is over 100 I think.. Link to comment Share on other sites More sharing options...
thelegacy0 Posted April 12, 2014 Share Posted April 12, 2014 (edited) There's a tutorial on it http://osbot.org/forum/topic/44536-smoking-rock-detection/?hl=smoking+rock Edit: tutorial is for while you're selecting what to mine. Might wanna change that/add that for when you're already mining. Edited April 12, 2014 by thelegacy0 Link to comment Share on other sites More sharing options...
Guest Apogee Posted April 13, 2014 Share Posted April 13, 2014 (edited) He gave you a tip... Height, smoking rock height is over 100 I think.. I'll switch that up. Thanks. EDIT: Still no. There's a tutorial on it http://osbot.org/forum/topic/44536-smoking-rock-detection/?hl=smoking+rock Edit: tutorial is for while you're selecting what to mine. Might wanna change that/add that for when you're already mining. That tutorial, as stated in the replies is incorrect due to the rock changes AFTER you (interact-- with it. I personally do not know how to detect a change. I'm new to this API. Here's what i currently have: It's just not working. I'm so confused on this. Entity rock = closestObject(ROCK_IDS); RS2Object rock1 = closestObject(ROCK_IDS); RS2Object curVein = null; if (rock1.isVisible()) if (!ply.isMoving()) { if ((rock1.getModel().getHeight() < 80)) if (!checkVein(curVein) || !myPlayer().isAnimating()) { if (!ply.isAnimating()) if (rock1 != null) { rock.interact("Mine"); curVein = rock1; status = "Mining.."; sleep(random(1250, 2000)); } else if (myPlayer().isAnimating()) { walk(WAIT_AREA); log("Success! Smoking rock avoided."); status = "Waiting on smoking rock to leave.."; sleep(random(5000, 7000)); } } Edited April 13, 2014 by Bitter Link to comment Share on other sites More sharing options...
thelegacy0 Posted April 13, 2014 Share Posted April 13, 2014 (edited) if(client.getMyPlayer().isAnimating()) { if(smokingRock()) { //avoid that rock } } ^ In your loop public boolean smokingRock() { RS2Object rock1 = closestObject(15); if(rock1.getModel().getHeight() > 75) { //I THINK they start at 77... Change to 80 if you want if(client.getMyPlayer().isFacing((Character<?>) rock1)) { return true; } } return false; } P.S. in your code you'd want to check for the rock while animating... You have to rewrite your if statements, so that it's if(not animating) click rock, else if(is animating) check for smoking rock. Know what I mean? Edit: if a cast doesn't work, you could try the interactWith boolean. Ents are easier cause they're npcs Edited April 13, 2014 by thelegacy0 Link to comment Share on other sites More sharing options...