Jump to content
UBot Underground

Question About The If And Loop While Command(Screenshot)


Recommended Posts

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

Link to post
Share on other sites

add wait time

sample

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")
    }
}
Link to post
Share on other sites

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!

Link to post
Share on other sites

@  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.

 
Link to post
Share on other sites

 

@  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

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...