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
  • Try asking for help in the chatbox
  • sleepUntil not working


    TTB1
     Share

    Recommended Posts

    I have the line

    sleepUntil(() -> !getInventory().isEmpty(), 3600);

    But I get an error saying Syntax error on token(s), misplaced construct(s)

    Also, completely unrelated, is there a way to toggle quick prayers? Any help is appreciated.

    Link to comment
    Share on other sites

    That sleepUntil should work, it looks correct to me and my IDE doesn't flag anything up. Have you definitely added the client.jar?

    You can toggle quick prayers using:

    getPrayer().toggleQuickPrayer(boolean true/false);

     

    Link to comment
    Share on other sites

    8 hours ago, StonedFarmer said:

    That sleepUntil should work, it looks correct to me and my IDE doesn't flag anything up. Have you definitely added the client.jar?

    You can toggle quick prayers using:

    getPrayer().toggleQuickPrayer(boolean true/false);

     

    is there also a way to check if quick prayers are toggled?

    Link to comment
    Share on other sites

    1 minute ago, TTB1 said:

    is there also a way to check if quick prayers are toggled?

    Yep, you can use getPrayer().isQuickPrayerActive(), which will return true/false

    Link to comment
    Share on other sites

    1 minute ago, StonedFarmer said:

    Yep, you can use getPrayer().isQuickPrayerActive(), which will return true/false

    how would i use that in this situation?

    if (Competitive != null && getPrayer().isQuickPrayerActive())
                return State.NOTSTARTED;
            return State.STARTED;

    I want it to be so that it returns the state notstarted when it's false and started when its true

    Link to comment
    Share on other sites

    1 minute ago, TTB1 said:

    how would i use that in this situation?

    if (Competitive != null && getPrayer().isQuickPrayerActive())
                return State.NOTSTARTED;
            return State.STARTED;

    I want it to be so that it returns the state notstarted when it's false and started when its true

    You would do something like:

    if(Competitive != null) {
    	if(getPrayer().isQuickPrayerActive()){
    		return State.STARTED;
    	} else {
    		return State.NOTSTARTED;
    	 }
    }

     

     

    Link to comment
    Share on other sites

    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
     Share

    ×
    ×
    • 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.