t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 (edited) 47 minutes ago, Xx pk xX said: while (getDialogues().isPendingContinuation() || getDialogues().isPendingOption()) { getDialogues().clickContinue(); getDialogues().completeDialogue("Option you want to click if there are more options", "another options to click", "another option..."); } If you want to just click continue (e.g. you don't have to choose an option while talking to a NPC), and you are expecting only "Click here to continue" then: while (getDialogues().isPendingContinuation()) { if (getDialogues().clickContinue()) { //click fishing spot again } } Put above code somewhere where you are using sleep condition while your player is fishing (e.g. after/before checking your player.isAnimating() method) For bank depositing just use getBank.deposit methods. I believe widgets are used in banking methods like deposit, withdraw, etc, but you don't need to worry about that. Just use OSBot banking API, and you should be fine (unless you need something really special that's not covered in API). Thank you so much, helping me alot! Guessing I could use this for questing too? Might be a better method though idk As for sleep, I am just using ' sleep(random()); ' at the moment, not used to conditional sleep yet. Put it in like this, - what do you think? // Fishing code NPC fishingSpot = getNpcs().closest("Fishing spot"); if(fishingSpot != null && !myPlayer().isAnimating() && !myPlayer().isMoving()){ while (getDialogues().isPendingContinuation()){ log("Leveled up, clicking continue"); getDialogues().clickContinue(); if(getDialogues().clickContinue()){ log("Interacting with fishingSpot again"); fishingSpot.interact("Net"); } } log("Interacting with fishingSpot"); fishingSpot.interact("Net"); Is it possible to do this without ' if ' after clicking continue, - and also what type is ' getDialogues ' ? I want to declare a variable called Continueing Sry, am noob. Thanks EDIT: - This might not work as myPlayer(); would still be isAnimating(); before going idle, then it would just fish again, making this pointless haha...hm. Should I put it somewhere else maybe? - Tested it again, aaand now my log just confirmed it clicking continue over and over again before going idle hmm Edited March 21, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
Xx pk xX Posted March 21, 2019 Share Posted March 21, 2019 (edited) 19 minutes ago, t0r3 said: Thank you so much, helping me alot! Guessing I could use this for questing too? Might be a better method though idk As for sleep, I am just using ' sleep(random()); ' at the moment, not used to conditional sleep yet. Put it in like this, - what do you think? // Fishing code NPC fishingSpot = getNpcs().closest("Fishing spot"); if(fishingSpot != null && !myPlayer().isAnimating() && !myPlayer().isMoving()){ while (getDialogues().isPendingContinuation()){ log("Leveled up, clicking continue"); getDialogues().clickContinue(); if(getDialogues().clickContinue()){ log("Interacting with fishingSpot again"); fishingSpot.interact("Net"); } } log("Interacting with fishingSpot"); fishingSpot.interact("Net"); Is it possible to do this without ' if ' after clicking continue, - and also what type is ' getDialogues ' ? I want to declare a variable called Continueing Sry, am noob. Thanks Of course you could use something like this for quests if (getDialogues().isPendingOption()) getDialogues().completeDialogue("Option you want to click"); and for the rest: NPC fishingSpot = getNpcs().closest("Fishing spot"); if(fishingSpot != null && !myPlayer().isAnimating() && !myPlayer().isMoving()) { log("Interacting with fishingSpot"); if (fishingSpot.interact("Net")) { //I'm not sure about exact conditions for fishing, but this should work while ((myPlayer().isMoving() || myPlayer().isAnimating()) && fishingSpot.exists()) { //if you want to click continue while you are fishing, then put this condition here if (getDialogues().isPendingContinuation()) { log("Leveled up, clicking continue"); //you don't need if condition here if there is no action you want to do after clicking continue getDialogues().clickContinue(); //but you can do something like this if (getDialogues().clickContinue() && fishingSpot.exists()) { //click fish again after clicking dialog fishingSpot.interact("Net"); } } sleep(MethodProvider.random(50, 500)); } } } Edited March 21, 2019 by Xx pk xX Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 18 minutes ago, Xx pk xX said: Of course you could use something like this for quests if (getDialogues().isPendingOption()) getDialogues().completeDialogue("Option you want to click"); and for the rest: NPC fishingSpot = getNpcs().closest("Fishing spot"); if(fishingSpot != null && !myPlayer().isAnimating() && !myPlayer().isMoving()) { log("Interacting with fishingSpot"); if (fishingSpot.interact("Net")) { //I'm not sure about exact conditions for fishing, but this should work while ((myPlayer().isMoving() || myPlayer().isAnimating()) && fishingSpot.exists()) { //if you want to click continue while you are fishing, then put this condition here if (getDialogues().isPendingContinuation()) { log("Leveled up, clicking continue"); //you don't need if condition here if there is no action you want to do after clicking continue getDialogues().clickContinue(); //but you can do something like this if (getDialogues().clickContinue() && fishingSpot.exists()) { //click fish again after clicking dialog fishingSpot.interact("Net"); } } sleep(MethodProvider.random(50, 500)); } } } Got this to work : // Fishing code NPC fishingSpot = getNpcs().closest("Fishing spot"); while (getDialogues().isPendingContinuation()){ if(getDialogues().clickContinue()){ log("Interacting with fishingSpot again"); fishingSpot.interact("Net"); } } if(fishingSpot != null && !myPlayer().isAnimating() && !myPlayer().isMoving()){ log("Interacting with fishingSpot"); fishingSpot.interact("Net"); I put the While loop first, so that it checks before fishing. If no dialogue option it would just skip it and do usual fishing routine. I think. Why are you using ' .exists ' though, instead of ' fishingSpot != null? It's not the same? Thanks for helping Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 (edited) 1 minute ago, zwaffel said: fishing spots are npc's Yeah I already know that now - check latest post in thread Thanks though Edited March 21, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
zwaffel Posted March 21, 2019 Share Posted March 21, 2019 (edited) 6 minutes ago, t0r3 said: Why are you using ' .exists ' though, instead of ' fishingSpot != null? It's not the same? Thanks for helping Calling .exists on an object that is null will still trow a nullpointerexception so you should check first if its not null. Not null is just checking if you have it stored in memory, it will check if your reference is pointing to something. Exists checks if it actually exists ingame (if i recall correctly) though some objects might implement exists in another way. Edited March 21, 2019 by zwaffel Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 @zwaffel So, what would be the point in using .exists? If so isn't .exists for an object always true, as it is always in game? Sry if that is a stupid question.. haha Quote Link to comment Share on other sites More sharing options...
Xx pk xX Posted March 21, 2019 Share Posted March 21, 2019 4 minutes ago, t0r3 said: @zwaffel So, what would be the point in using .exists? If so isn't .exists for an object always true, as it is always in game? Sry if that is a stupid question.. haha From API: public boolean exists() Checks whether this Entity still exists or not. Returns: Whether this Entity still exists or not. So for example you could call NPC fishingSpot = getNpcs().closest("Fishing spot"); First of all you need to check if it's not null. Calling exists() on null object will throw NullPointerException. Then you can do some actions. However, after running some actions, e.g. interact, wait while animating etc. that fishing spot might "disappear" from RS, so calling if if(fishingSpot.exists()) returns true if the fishingSpot still exists in RS. So as @zwaffel said. Once you know it is not null, you are certain that object is stored in your memory. But as time pass, it will still be in your memory, but it might not exist in RS anymore. That's why you can always use exists() method as well to check that out. Quote Link to comment Share on other sites More sharing options...
Nor3g Posted March 21, 2019 Share Posted March 21, 2019 You need to get really autistic about what you're doing. Log into runescape and then very slowly note down everything you want to do. So the exact conditions that need to be met for you to perform an action, and then create if and else ifs for everything in the right priority. Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 8 minutes ago, Nor3g said: You need to get really autistic about what you're doing. Log into runescape and then very slowly note down everything you want to do. So the exact conditions that need to be met for you to perform an action, and then create if and else ifs for everything in the right priority. Hahahaha yeah, already on my way! Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 21, 2019 Author Share Posted March 21, 2019 3 hours ago, Xx pk xX said: From API: public boolean exists() Checks whether this Entity still exists or not. Returns: Whether this Entity still exists or not. So for example you could call NPC fishingSpot = getNpcs().closest("Fishing spot"); First of all you need to check if it's not null. Calling exists() on null object will throw NullPointerException. Then you can do some actions. However, after running some actions, e.g. interact, wait while animating etc. that fishing spot might "disappear" from RS, so calling if if(fishingSpot.exists()) returns true if the fishingSpot still exists in RS. So as @zwaffel said. Once you know it is not null, you are certain that object is stored in your memory. But as time pass, it will still be in your memory, but it might not exist in RS anymore. That's why you can always use exists() method as well to check that out. Thanks, that clarified alot Love learning to script Quote Link to comment Share on other sites More sharing options...