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
  • How to remove the pop up when you level up?


    st3ealth

    Recommended Posts

    I think it has something to do with getDialogues().inDialogue() 

    but I can't figure it out how to implement it in this code.

    Thanks in advance

    (sorry for my unorganised and bad code, I just started a few days ago)

    import org.dreambot.api.methods.container.impl.bank.BankLocation;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.methods.map.Tile;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.widgets.WidgetChild;
    
    @ScriptManifest(
            author = "Stealth",
            description = "stuff",
            category = Category.CRAFTING,
            version = 0.01,
            name = "Crafter Script"
    )
    
    public class Main extends AbstractScript {
    
        public static final int RING_MOULD = 1592;
        public static final int GOLD_BAR = 2357;
        public static final int FURNACE = 16469;
        private static final Tile FURNACE_TILE = new Tile(3108, 3499);
    
    
        @Override
        public int onLoop() {
    
    
            if (getInventory().contains(GOLD_BAR)) {
                if (FURNACE_TILE.distance() > 1) {
                    getWalking().walk(FURNACE_TILE);
                } else if (getInventory().contains(GOLD_BAR)) {
                    WidgetChild makeAllWidg = getWidgets().getWidgetChild(446, 7);
                    getInventory().get(GOLD_BAR).useOn(getGameObjects().closest(FURNACE));
                    if (makeAllWidg.isVisible()){
                        makeAllWidg.interact("Make Gold ring");
                        sleepUntil(()->!getInventory().contains(GOLD_BAR),50000); // script needs to stop sleeping if you level up
                    }
    
                }
            }
    
            else if (!getInventory().contains(RING_MOULD)){
                getBank().open(BankLocation.EDGEVILLE);
                getBank().withdraw(RING_MOULD);
            }
            else if (!getInventory().contains(GOLD_BAR)){
                getBank().open(BankLocation.EDGEVILLE);
    
    
                if (getBank().isOpen()){
                    getBank().depositAllExcept(RING_MOULD);
                    getBank().withdrawAll(GOLD_BAR);
                }
            }
    
    
    
    
    
    
    
    
    
            return 1000;
    
    
    
    
    
    
    
    
        }
    }
    Link to comment
    Share on other sites

    1 hour ago, Nuclear Nezz said:

    if(getDialogues().canContinue()){
        getDialogues().continue();
    }

    does this work if there will be more lines of dialogue for example 5-6 or do i need to define it somehow that there will be more lines

    Link to comment
    Share on other sites

    36 minutes ago, TuzasLT said:

    does this work if there will be more lines of dialogue for example 5-6 or do i need to define it somehow that there will be more lines

    What Nezz posted works if you're in a dialogue with the only option to continue the dialogue. The amount of text in the dialogue doesn't matter. However, if you're referring to the options you can choose, the code doesn't work with that.

    Link to comment
    Share on other sites

    6 minutes ago, Hashtag said:

    What Nezz posted works if you're in a dialogue with the only option to continue the dialogue. The amount of text in the dialogue doesn't matter. However, if you're referring to the options you can choose, the code doesn't work with that.

    yeah i get i need to getLength and then choose which option  thanks alot for clarifying

    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.