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

    Recommended Posts

    Posted

    hellow every body

    my SleepUntil condition didn't work with me > this is my code can any one try it .

    in the mother load mining area.

    nodefilter = g-> g!=null && g.exists() && Mining_area.contains(g) && g.getName().equals("Ore vein");
    
    currentNode = GameObjects.closest(nodefilter);
    if (currentNode.interactForceLeft("Mine")) {
      
          Sleep.sleepUntil(()-> !currentNode.exists() || Inventory.isFull(), 25000);//didn't work here and sleep for 25 s every time.
    
    }

    what's about you ?

    Are this happen with any one of you ?

    @Pandemic

    Posted

    Try logging the output of those two statements to see their values, you may realise the predicate is never true.

    if (currentNode.interactForceLeft("Mine")) {
      
          Sleep.sleepUntil(()-> {
            Logger.log("currentNode.exists(): " + currentNode.exists());
            Logger.log("Inventory.isFull(): " + Inventory.isFull());
            return !currentNode.exists() || Inventory.isFull()
          }, 25000);
    }

     

    Posted

    GameObject.closest() can return null, so make sure You check if it's null, then if exists

    i.e

    Sleep.sleepUntil(() -> currentNode == null || !currentNode.exists() || Inventory.isFull(), 25000)

    Posted
    On 2/3/2023 at 8:13 AM, abouhanafy87 said:

    hellow every body

    my SleepUntil condition didn't work with me > this is my code can any one try it .

    in the mother load mining area.

    nodefilter = g-> g!=null && g.exists() && Mining_area.contains(g) && g.getName().equals("Ore vein");
    
    currentNode = GameObjects.closest(nodefilter);
    if (currentNode.interactForceLeft("Mine")) {
      
          Sleep.sleepUntil(()-> !currentNode.exists() || Inventory.isFull(), 25000);//didn't work here and sleep for 25 s every time.
    
    }

    what's about you ?

    Are this happen with any one of you ?

    @Pandemic

    the node probably never stops existing, maybe its actions change and you can tell from that

    Posted (edited)

    On a sidenote, never use fixed sleeping times.

    image.png.4ca397f7aed8dff030dfc08ca28426d2.png

    Change that 25000 into Calculations.random(25000,35000)

    Edited by una_maquina
    Posted
    On 2/4/2023 at 8:43 AM, prechcik said:

    GameObject.closest() can return null, so make sure You check if it's null, then if exists

    i.e

    Sleep.sleepUntil(() -> currentNode == null || !currentNode.exists() || Inventory.isFull(), 25000)

    nodefilter check this .

    nodefilter = g-> g!=null && g.exists() && Mining_area.contains(g) && g.getName().equals("Ore vein");

    Posted
    On 2/3/2023 at 9:06 PM, hashbang said:

    Try logging the output of those two statements to see their values, you may realise the predicate is never true.

    if (currentNode.interactForceLeft("Mine")) {
      
          Sleep.sleepUntil(()-> {
            Logger.log("currentNode.exists(): " + currentNode.exists());
            Logger.log("Inventory.isFull(): " + Inventory.isFull());
            return !currentNode.exists() || Inventory.isFull()
          }, 25000);
    }

     

    i try this and the result :

    currentNode.exists(): false

    Inventory.isFull(): false

    and still sleep to 25 s.

    i try to check it by name

    if (currentNode.interactForceLeft("Mine")) {

    Sleep.sleepUntil(()-> {

    Logger.log("currentNode.isOrevein: " + currentNode.getName.equal("Ore vein"));

    Logger.log("Inventory.isFull(): " + Inventory.isFull());

    return !currentNode.exists() || Inventory.isFull();

    }, 25000); }

    the result :

    currentNode.isOrevein:true   // when the currentNode name is " Depleted vein"

    Inventory.isFull(): false

    Posted

    I would recommend either to check the veins by their ids as they change, or look for another way of waiting until certain condition finished. 

    As to the mining, is there anything stopping you from executing the left click only if Player is not animating? Afaik mining animation doesnt flicker so You could sleep while animating - that would prevent it from clicking again when already mining.

    Your name comparison is kind of weird, you said you used currentNode.getName() .equals("Ore vein") and then when the vein had name Depleted vein it still returned true, that would point out that you are comparing the wrong object. 

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.