eindbaas 0 Posted October 29, 2015 Report Share Posted October 29, 2015 Hi, I have a bot like this if > then > loop while > els The loop while is looping as long as a certain text is loaded on the page. If this text is not loaded the bot should start with the els command. I think im on the right track but not sure what hapens with the loop when the text is not loaded. Thanks edit: i did atach a screenshot which i no where to be seen. try to upload it some where els and share link Quote Link to post Share on other sites
eindbaas 0 Posted October 29, 2015 Author Report Share Posted October 29, 2015 http://oi64.tinypic.com/11b6cfr.jpg Quote Link to post Share on other sites
pash 504 Posted October 29, 2015 Report Share Posted October 29, 2015 add wait timesample wait(1)more sample set(#TimeOut,0,"Global") loop while($both($not($search page("Video")),$comparison(#TimeOut,"< Less than",10))) { comment("Do something") wait(1) increment(#TimeOut) } if($comparison(#TimeOut,"= Equals",10)) { then { alert("Not found") } else { alert("Found") } } Quote Link to post Share on other sites
tnhomestead 16 Posted October 29, 2015 Report Share Posted October 29, 2015 Wait time and double check your conditions on the if -- I am real bad at getting them backwards at times! Quote Link to post Share on other sites
UbotBuilders 0 Posted October 29, 2015 Report Share Posted October 29, 2015 If the text is not found or loaded like you mentioned when reaching the 'if' command, the bot will skip to the 'else' part of the command and run all/any codes in the 'else' part of the 'if'.So, if the text is not found or loaded when reaching the 'if' command, the 'then' part of the 'if' command will NOT be ran/used. In this case, your 'loopwhile' part will not be ran if no text is found or loaded like you mentioned.*if the text was first found or loaded and your software hits the loopwhile part BUT THEN doesn't find the text while in the 'then' part or while looping in the loopwhile, then it will NOT jump to the 'else' part! Instead, it jumps to the Next Node. But that's why you're using the 'if' command to see if the text is there or not. So i'm not sure what you're worried or curious about. If the text is there, it will go to 'then' part. If it's not it goes to 'else' part. So if the text is there or loaded, it's not going to be not found when it reaches the 'then' part. It's either there or not there. If i'm missing a point, let me know.Hope this clarifies it.Cheers! Quote Link to post Share on other sites
eindbaas 0 Posted October 29, 2015 Author Report Share Posted October 29, 2015 @ pash and thhomestead, so i should ad the wait time before the loop? i have the wait for page to load in the loop is that what ou meen? @ UbotBuilders, you say: it wille jump to the next node, is this the next node in the then command , or in the if command? the next node in the if command is the els command. which i want the bot to go when the loop is done because the text is not loaded. Quote Link to post Share on other sites
RickBot0906 10 Posted October 29, 2015 Report Share Posted October 29, 2015 Would recommend to put wait inside the loop, otherwise certain conditions maybe skipped. If speed is not your concern, I would add more than 1 wait just to slow it down to be more accurate. Quote Link to post Share on other sites
pash 504 Posted October 30, 2015 Report Share Posted October 30, 2015 @ pash and thhomestead, so i should ad the wait time before the loop? i have the wait for page to load in the loop is that what ou meen? @ UbotBuilders, you say: it wille jump to the next node, is this the next node in the then command , or in the if command? the next node in the if command is the els command. which i want the bot to go when the loop is done because the text is not loaded. inside loop while Quote Link to post Share on other sites
tnhomestead 16 Posted October 30, 2015 Report Share Posted October 30, 2015 yeah the wait goes after the search page command, to give the page time to load. Sometimes the wait until page loaded command seems to need some extra time on some pages so I just add a wait command for a second or 3. I add a wait after every page load to be sure it has time to load the page and scrape it. Quote Link to post Share on other sites
eindbaas 0 Posted October 31, 2015 Author Report Share Posted October 31, 2015 Will as some wait commands. Thanks guys. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.