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

    • 2 months later...
    On 11/16/2020 at 3:39 PM, Neffarion said:

    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
     

    Hey man, I am confused by your recommendation here. What is the need here to save the interacting rock tile (I assume you mean like a wrapper)?. If it is to prevent spam clicking the rock, then the isAnimating will take care of it once you start the mining animation. Also why search for the tile infront? , also this is direction sensitive, so you would need to check which direction the player is facing and do an arithematic, all of this but what is the need? 

    Isn't it better like, click on an available rock, confim your are mining, do nothing while rock exits?

    Regards,

    J

    Link to comment
    Share on other sites

    9 hours ago, jex124 said:

    Hey man, I am confused by your recommendation here. What is the need here to save the interacting rock tile (I assume you mean like a wrapper)?. If it is to prevent spam clicking the rock, then the isAnimating will take care of it once you start the mining animation. Also why search for the tile infront? , also this is direction sensitive, so you would need to check which direction the player is facing and do an arithematic, all of this but what is the need? 

    Isn't it better like, click on an available rock, confim your are mining, do nothing while rock exits?

    Regards,

    J

    You save the rock tile so you query that tile for game objects. If you save the game object and you mine the rock then when the rock loses the ore in it, it is no longer the same game object

    Link to comment
    Share on other sites

    • 4 weeks later...
    On 2/7/2021 at 5:02 AM, Neffarion said:

    You save the rock tile so you query that tile for game objects. If you save the game object and you mine the rock then when the rock loses the ore in it, it is no longer the same game object

    like this

    ironObjects = new ArrayList<GameObject>();
    ironObjects.add(GameObjects.getTopObjectOnTile(new Tile(3285, 3368, 0)));
    ironObjects.add(GameObjects.getTopObjectOnTile(new Tile(3286, 3369, 0)));
    Link to comment
    Share on other sites

    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.