Zibele 18 Posted December 11, 2016 Hey guys could anyone show me an example of how to go about creating a filter & array for mining rocks,problem i am m having is when I am in the animation of mining and the rock i am mining gets mined by someone else i cant get it to switch automatically to the next available rock. This is the example of my current function that handles mining :/ public void Mine() { if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating()) { Rock = getGameObjects().closest("Rocks"); if ((Rock.exists() && Rock != null && !getLocalPlayer().isMoving() && Rock.getModelColors() != null)) { if (Rock.interact("Mine")) { sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(2500, 4500)); } MouseAnti(); } } }
triblion 56 Posted December 11, 2016 If you are open to the idea of changing it around slightly, try changing to if your interacting with the rock that might be a better option
Zibele 18 Author Posted December 12, 2016 Yeah but for that wont i need a filter and array for that to identify while im interacting, if the rock turns empty and then it can switch rocks instead of remaining in the animation of mining a empty rock?
triblion 56 Posted December 12, 2016 Still do a null check obviously, use if your interacting with the entity instead though, animation is not a strong way to check if your interacting or not
Recommended Posts
Archived
This topic is now archived and is closed to further replies.