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
  • Widget interaction


    PurpleChalk

    Recommended Posts

    private boolean cookAll() {
    return getWidgets().getWidgetContainingText("Raw shrimps").interact("Cook All");
    }

    private boolean howManyToCook() {
    return getWidgets().getWidgetContainingText("How many would you like to cook?") != null;
    }

    I have these two lines of code from a previous botting client.

    I've managed to achieve the first method of code using: 

     

    private boolean cookAll() {

    return getWidgets().getWidgetChild(162,30).interact("Cook All");
    }

     

    Second method:
    private boolean howManyToCook() {
    return getWidgets().getWidgetChildrenContainingText("How many would you like to cook?") != null;
    }

    Some reason doesn't work?

    Link to comment
    Share on other sites

    5YSkWzc.png

     

    example usage

    I'm not the greatest coder, without comments this doesn't really mean much to me I'm afraid, is there no way to get widgets by text displayed on this bot? I've scoured the API.

    Link to comment
    Share on other sites

    Its because the widget you are fetching is not correct. The widgets to cook all dont have text IIRC. You are better off getting the IDs.

    Link to comment
    Share on other sites

    Its because the widget you are fetching is not correct. The widgets to cook all dont have text IIRC. You are better off getting the IDs.

    The interact with cook all works fine.

     

    What I'm trying is, IF the screen where you can select cook all exists(showing), then proceed to cook all, 

    Link to comment
    Share on other sites

    The interact with cook all works fine.

     

    What I'm trying is, IF the screen where you can select cook all exists(showing), then proceed to cook all, 

     

    Oh. Its because the widget doesnt have to be null to not be there. I found it can still be visible whilst being null. Maybe try #isVisible.

    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.