testymain 0 Share Posted November 29, 2018 I had a method that checked if player is mining, it basically checked if player is animating 625, it worked great but then i saw someone else had mining animation 627 and that method obviously returned false. So i thought it would be male/female animation, edited my method and i thought it was done. Then i changed pickaxes and animation was 624 so it is probably depending on axe and not male/female(havent tested). So the actual question is how to check if player is mining? Do i have to test every animation? How many animation are there and what are their value? Is there any better method how to check if player is mining? How would you do it? Link to comment Share on other sites More sharing options...
Manly 879 Share Posted November 29, 2018 https://dreambot.org/javadocs/org/dreambot/api/wrappers/interactive/Character.html#isAnimating-- Link to comment Share on other sites More sharing options...
testymain 0 Author Share Posted November 29, 2018 yeah, but the player can do other animations that arent mining, i need to check mining specifically Link to comment Share on other sites More sharing options...
Manly 879 Share Posted November 29, 2018 41 minutes ago, testymain said: yeah, but the player can do other animations that arent mining, i need to check mining specifically Your player is not going to do a random animation when he is mining. Link to comment Share on other sites More sharing options...
testymain 0 Author Share Posted November 29, 2018 who is talking about my player? I am talking about every player. I am checking if rock is being mined by someone else, thats why i need this Link to comment Share on other sites More sharing options...
Manly 879 Share Posted November 29, 2018 1 hour ago, testymain said: who is talking about my player? I am talking about every player. I am checking if rock is being mined by someone else, thats why i need this Not sure why you would need to check other player animations when mining but ok. You can check if their animation is != -1 Link to comment Share on other sites More sharing options...
testymain 0 Author Share Posted November 29, 2018 to check if closest rock is being mined else pick next closest and check that too etc. why would you tried to mine a rock that is being mined? doing animation is != -1 isn't optimal as they can do other animations that arent mininig animations. If there arent any other methods i guess ill just have to find out all mining animation values and check them all. Link to comment Share on other sites More sharing options...
una_maquina 35 Share Posted November 16, 2020 GameObject rock = GameObjects.closest(11161); 11161 is an ID for copper. if(rock.interact("Mine")){ sleepUntil(() -> !rock.exists(), Calculations.random(30000, 40000)); } Link to comment Share on other sites More sharing options...
TheCloakdOne 389 Share Posted November 16, 2020 Either gather all mining animations yourself or use isAnimating. Its unlikely that a player would be sitting in the mining area fletching so you can assume anyone within a 1x1 of the rock who is animating is most likely mining that rock (if they are 3 ticking you dont want to attempt to mine the rock anyway) There is no global `isMining` animation Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted November 16, 2020 Checking for animation is not reliable. If you lag then your animation can stop for a few milliseconds and your script will think it's not mining. Also, there's a chance that in between animations your character will not be animating thus also returning false to isAnimating(). You should only use isAnimating() to check if your character is mining, not to check if it isn't mining. Ideally you want to be saving the tile of the rock you interact with. So do something like: Interact with the rock, if successful save the rock tile. Then check if your character is animating. If it is then you are mining and you are good. Otherwise, get the tile in front of your character and check if it is the rock tile you saved and it isn't mined yet. Might also be a good idea to add a timeout Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.