Weed Scripts 0 Posted August 2, 2015 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 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 ) 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); } }
Computor 179 Posted August 2, 2015 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); } }
Chris 154 Posted August 2, 2015 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
Weed Scripts 0 Author Posted August 2, 2015 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
Computor 179 Posted August 2, 2015 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.
Vlad 216 Posted August 2, 2015 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,
Recommended Posts
Archived
This topic is now archived and is closed to further replies.