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
  • Help with "Level Up" Popup


    Weed Scripts

    Recommended Posts

    Hey everybody! I'm having a problem with my (very basic) fishing bot.
     

    When a character levels up a little message appears in the chatbox saying "congratulations" right? It looks like this

    udXSp9w.png
    The bot can't fish until that popup is clicked out of. The problem is that the bot won't click out of it because technically the bot is still interacting with the water like it is programmed to.

    I have tried looking in the API for something that could notify the bot that the popup has occurred so it can click out of it but I've had no luck.

    Any help at all is appreciated!  :)

    (Oah and here's the source code. Super simple; didn't think it needed any comments :P  )
     

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    //Created by Weed Scripts on 8/1/2015//
    
    @ScriptManifest(name = "Power Fisher", description = "Power fishes for dank experience!", author = "Weed Scripts", category = Category.FISHING, version = 0.1)
    public class main extends AbstractScript {
    
    	@Override
    	public int onLoop() {
    
    		NPC bubbles = getNpcs().closest(getNpcs -> getNpcs.getName().equals("Fishing spot") && getNpcs.hasAction("Net"));
    
    		if (!getLocalPlayer().isInteracting(bubbles)) {
    
    			if (getInventory().isFull()) {
    				getInventory().dropAllExcept("Small fishing net");
    
    			} else {
    				bubbles.interact("Net");
    			}
    
    		}
    
    		return Calculations.random(450, 550);
    
    	}
    
    }
    
    Link to comment
    Share on other sites

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

    Implemented into your code, it would look like this:

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    //Created by Weed Scripts on 8/1/2015//
    
    @ScriptManifest(name = "Power Fisher", description = "Power fishes for dank experience!", author = "Weed Scripts", category = Category.FISHING, version = 0.1)
    public class main extends AbstractScript {
    
        @Override
        public int onLoop() {
    
            NPC bubbles = getNpcs().closest(getNpcs -> getNpcs.getName().equals("Fishing spot") && getNpcs.hasAction("Net"));
    
            if (!getLocalPlayer().isInteracting(bubbles)) {
    
                if (getInventory().isFull()) {
                    getInventory().dropAllExcept("Small fishing net");
    
                } else {
                    bubbles.interact("Net");
                }
    
            }
    
            if (getDialogues().canContinue()){
                if(getDialogues().continueDialogue()){
                    sleepUntil(() -> !getDialogues().canContinue(), 3000);
                }
            }
    
            return Calculations.random(450, 550);
    
        }
    
    }
    
    Link to comment
    Share on other sites

    Check for the click to continue widget before you try to interact with the water

    Check for the click to continue widget before you try to interact with the water

    Link to comment
    Share on other sites

    Check for the click to continue widget before you try to interact with the water

    Check for the click to continue widget before you try to interact with the water

    Hmm. I don't mean to sound like a noob here (which I am) but how do I do that? To be honest I'm having sort of a hard time understanding what the widgets are/do given I have never used them before.

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

    Implemented into your code, it would look like this:

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    //Created by Weed Scripts on 8/1/2015//
    
    @ScriptManifest(name = "Power Fisher", description = "Power fishes for dank experience!", author = "Weed Scripts", category = Category.FISHING, version = 0.1)
    public class main extends AbstractScript {
    
        @Override
        public int onLoop() {
    
            NPC bubbles = getNpcs().closest(getNpcs -> getNpcs.getName().equals("Fishing spot") && getNpcs.hasAction("Net"));
    
            if (!getLocalPlayer().isInteracting(bubbles)) {
    
                if (getInventory().isFull()) {
                    getInventory().dropAllExcept("Small fishing net");
    
                } else {
                    bubbles.interact("Net");
                }
    
            }
    
            if (getDialogues().canContinue()){
                if(getDialogues().continueDialogue()){
                    sleepUntil(() -> !getDialogues().canContinue(), 3000);
                }
            }
    
            return Calculations.random(450, 550);
    
        }
    
    }
    

    Thanks for the help! Also thanks for your guides on how to script for helping me get started. ;p

    Link to comment
    Share on other sites

    Hmm. I don't mean to sound like a noob here (which I am) but how do I do that? To be honest I'm having sort of a hard time understanding what the widgets are/do given I have never used them before.

    Thanks for the help! Also thanks for your guides on how to script for helping me get started. ;p

    NP buddy! Also: Chris's advice is what I already said. He probably was talking about using the actual widgets like this:

    WidgetChild continueWidget = getWidgets().getChildWidget(231, 2);
            
    if(continueWidget != null && continueWidget.isVisible()){
          continueWidget.interact("Continue"); //clicks the little blue "continue" button.
    }
    

    The method I gave you does the exact same thing, it's just simpler.

    Link to comment
    Share on other sites

    Hmm. I don't mean to sound like a noob here (which I am) but how do I do that? To be honest I'm having sort of a hard time understanding what the widgets are/do given I have never used them before.

    Thanks for the help! Also thanks for your guides on how to script for helping me get started. ;p

     

    Widgets are all the interfaces you see in RuneScape. The base GUI(Minimap Orbs, Tabs, Inventory Spots, etc.), the bank/shop/deposit box screens, dialogue stuff, the Click Here to Play screen (Lobby) and many more, 

    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.