RSMasterGuard 19 Share Posted May 9, 2022 I am writing a script and when I attempt to open tabs I am able to open them with this command Tabs.openWithMouse(OPTIONS); However this doesn't seem to run successfully after any other command and just hangs. Is there something I should wrap this statement in or is this statement? What am I missing? Link to comment Share on other sites More sharing options...
camelCase 257 Share Posted May 10, 2022 17 hours ago, RSMasterGuard said: However this doesn't seem to run successfully after any other command and just hangs. Is there something I should wrap this statement in or is this statement? What am I missing? youll have to post code. that method works fine your issue is most likely the logic of your script Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Author Share Posted May 10, 2022 5 hours ago, camalCase said: youll have to post code. that method works fine your issue is most likely the logic of your script case BROTHER_BRACE: status = "Walk to Church"; while (!TUTORIAL_ISLAND_CHURCH_AREA.contains(getLocalPlayer())) { getWalking().walk(TUTORIAL_ISLAND_CHURCH_AREA); sleep(Calculations.random(3000, 6000)); } NPC BroBrace = getNpcs().closest("Brother Brace"); BroBrace.interact("Talk-to"); sleep(Calculations.random(2000, 3000)); while (getDialogues().inDialogue()) { getDialogues().continueDialogue(); sleep(Calculations.random(500, 1000)); } if (!getTabs().isOpen(PRAYER)) { getTabs().openWithMouse(PRAYER); sleep(200, 600); } BroBrace.interact("Talk-to"); sleep(Calculations.random(2000, 3000)); while (getDialogues().inDialogue()) { getDialogues().continueDialogue(); sleep(Calculations.random(500, 1000)); } while(!Tabs.isOpen(FRIENDS)) { Tabs.open(FRIENDS); } BroBrace.interact("Talk-to"); while (getDialogues().inDialogue()) { getDialogues().continueDialogue(); sleep(Calculations.random(500, 1000)); } Here ya go! Link to comment Share on other sites More sharing options...
camelCase 257 Share Posted May 10, 2022 1. you are using DB2 methods to get an instance of different classes, the api is static now so you dont need to do that (getTabs().open() should just be Tabs.open() same getDialogues should just be Dialogues etc) 2. using while loops is discouraged and is generally a good way to get your script stuck. i think on tutorial island you are almost always in a dialogue because the chatbox always is covered telling you what to do / who to talk to, your script is probably stuck in the while loop above your open the prayer tab step Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Author Share Posted May 10, 2022 23 minutes ago, camalCase said: 1. you are using DB2 methods to get an instance of different classes, the api is static now so you dont need to do that (getTabs().open() should just be Tabs.open() same getDialogues should just be Dialogues etc) 2. using while loops is discouraged and is generally a good way to get your script stuck. i think on tutorial island you are almost always in a dialogue because the chatbox always is covered telling you what to do / who to talk to, your script is probably stuck in the while loop above your open the prayer tab step For the loop about dialogue I thought that was the case too but it works for navigation and testing shows its out of the loop it seems to be mostly your first point. and if you look at the code above I have tested both the old DB2 and DB3 and both don't appear to be working, Do you know if there is a weird state that exist for those tabs the first time you open on tut island and as a result you need to use the widget function instead? Link to comment Share on other sites More sharing options...
camelCase 257 Share Posted May 10, 2022 4 minutes ago, RSMasterGuard said: For the loop about dialogue I thought that was the case too but it works for navigation and testing shows its out of the loop what testing? the code you posted has no logging. you said it hangs if i did get out of that loop it wouldnt hang it would start interacting with the priest 5 minutes ago, RSMasterGuard said: Do you know if there is a weird state that exist for those tabs the first time you open on tut island and as a result you need to use the widget function instead? maybe Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Author Share Posted May 10, 2022 I didnt post all the code as that would be north of 1,000 lines. I'll play with the widget functions and see if that works as I tested switching tabs outside of tut island and also after that first click of the tab and it appears to work fine with both DB2 and DB3 functions so there might be a one unique case for the first time interacting with the tabs on tut. Link to comment Share on other sites More sharing options...
SubCZ 282 Share Posted May 10, 2022 4 hours ago, RSMasterGuard said: I didnt post all the code as that would be north of 1,000 lines. I'll play with the widget functions and see if that works as I tested switching tabs outside of tut island and also after that first click of the tab and it appears to work fine with both DB2 and DB3 functions so there might be a one unique case for the first time interacting with the tabs on tut. If you're talking about opening tabs when they are flashing during the tutorial, I'm pretty sure you have to handle that yourself with widgets (unless something changed and dreambot supports those now). Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Author Share Posted May 11, 2022 3 hours ago, SubCZ said: If you're talking about opening tabs when they are flashing during the tutorial, I'm pretty sure you have to handle that yourself with widgets (unless something changed and dreambot supports those now). That is what I was referring to, thanks for the confirmation! Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Author Share Posted May 11, 2022 Changing diaglogue code fixed it... while (Dialogues.canContinue()) { getDialogues().continueDialogue(); sleep(Calculations.random(500, 1000)); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.