Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Detecting mining


    testymain

    Recommended Posts

    Posted

    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?

    Posted

    yeah, but the player can do other animations that arent mining, i need to check mining specifically

    Posted
    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.

    Posted

    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

    Posted
    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

    Posted

    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.

    • 1 year later...
    Posted

    GameObject rock = GameObjects.closest(11161); 11161 is an ID for copper.

     

    if(rock.interact("Mine")){

    sleepUntil(() -> !rock.exists(), Calculations.random(30000, 40000));

    }

    Posted

    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

    Posted

    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
     

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.