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
  • Selecting spell for autocasting


    jarred788

    Recommended Posts

    I'm still confused, can u gimme an example of what u mean.

            WidgetChild spell = getWidgets().getWidgetChild(593,23);
            WidgetChild spell1 = getWidgets().getWidgetChild(201,0);
            if (getTabs().open(Tab.COMBAT)) {
                sleep(2000);
                if (spell.interact("Choose spell")) {
                    spell1.interact("Wind strike");
    
                }
    
            }
    

    that is what i got.

    Link to comment
    Share on other sites


    if (getTabs().getOpen() != Tab.COMBAT)
    getTabs().open(Tab.COMBAT);
    else {
    WidgetChild panel = getWidgets().getWidgetChild(593, 24);
    WidgetChild spell = getWidgets().getWidgetChild(201, 0, 1);
    if (panel != null && panel.isVisible() && panel.interact())
    sleepUntil(() -> !panel.isVisible(), 4000);
    else if (spell != null && spell.isVisible() && spell.interact())
    sleepUntil(() -> !spell.isVisible(), 4000);
    }
    Link to comment
    Share on other sites

    I'm still confused, can u gimme an example of what u mean.

            WidgetChild spell = getWidgets().getWidgetChild(593,23);
            WidgetChild spell1 = getWidgets().getWidgetChild(201,0);
            if (getTabs().open(Tab.COMBAT)) {
                sleep(2000);
                if (spell.interact("Choose spell")) {
                    spell1.interact("Wind strike");
    
                }
    
            }
    

    that is what i got.

    Look at the classes that implement Spell

    t7gfG1V.png

    They represent the spell books. So in your case you should be looking at Normal https://dreambot.org/javadocs/org/dreambot/api/methods/magic/Normal.html

    To get the wind strike widget child you can do this: Normal.WIND_STRIKE.getChild()

    Link to comment
    Share on other sites

            if (getTabs().getOpen() != Tab.COMBAT)
                getTabs().open(Tab.COMBAT);
            else {
                WidgetChild panel = getWidgets().getWidgetChild(593, 24);
                WidgetChild spell = getWidgets().getWidgetChild(201, 0, 1);
                if (panel != null && panel.isVisible() && panel.interact())
                    sleepUntil(() -> !panel.isVisible(), 4000);
                else if (spell != null && spell.isVisible() && spell.interact())
                    sleepUntil(() -> !spell.isVisible(), 4000);
            }
    

    thanks alot :)

    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.