Jump to content


Photo

End loop


  • Please log in to reply
8 replies to this topic

#1 The450Man

The450Man

    Advanced Member

  • UBot Users
  • PipPipPip
  • 78 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5
  • License:Dev

Posted 01 November 2011 - 05:45 PM

It would be great if there was a command that could end a loop and one that can simply end that instance of the loop once a condition was met.

#2 Legend

Legend

    Advanced Member

  • UBot Users
  • PipPipPip
  • 1454 posts
  • LocationJapan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 01 November 2011 - 07:44 PM

A loop only runs as long as certain conditions are being met... so it ends automatically. You can put a pause or stop script command in at the end or a call to any instance of a define if that would help.

__________________________________________

... this message has been approved by me...

ola.gif


#3 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3245 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 01 November 2011 - 07:57 PM

Loop while comparison #var != "END"

if something
set #var = "END"



Need a real life example let me know what your trying to do. but that same scenario should work very well.

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#4 The450Man

The450Man

    Advanced Member

  • UBot Users
  • PipPipPip
  • 78 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5
  • License:Dev

Posted 01 November 2011 - 10:12 PM

an example would be an account checker bot.

each account has its own unique email,password and proxy.

sometimes something comes up that the actions can no longer continue and doing so just causes ubot to crash. Ive done this with lots of if statements to end the loop but its a pain nesting everything inside the else or then nodes. It gets a little cluttered when you have several. I think it would just be easier to have a command that skips the current loop.

Stoping the script would do just that, i want to continue to run, just skipping over that instance of that loop.

#5 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3245 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 01 November 2011 - 10:15 PM

thats mainly the reason for conditional statements.

that if something then do something, else dont do anything, and ends or exit the loop.

The loop while before it you can set #var to true

and if it reaches a conditional that you wish to exit the loop set #var to false



and in the loop while comparison #var = true


otherwise it would exit the loop as soon as the #var is false

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#6 fdtkz

fdtkz

    Newbie

  • Members
  • Pip
  • 4 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Pro

Posted 07 December 2011 - 03:28 AM

Is there any way to order loop to go to next cycle after some period of time regardless of the actuall ability of loop to perform all the commands in it? I mean that when a command can not be executed and script stacks due to bad performance of target site you may resolve it all if there is a command which says that loop should be relaunched once again after some time regardless of success of the script.

#7 UBotDev.com

UBotDev.com

    Advanced Member

  • UBot Users
  • PipPipPip
  • 364 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Dev

Posted 20 December 2011 - 03:59 PM

You can use "Return" command (value doesn't matter) in if statement, which will trigger the bot to leave current "custom command/script". So if you are running that custom command/script in a loop, it will then start with next run.

In your case you need to run that loop in a defined custom command/script, and you need to use that if statement, that will trigger return. By this both, defined command/script and your loop will be terminated, and bot will continue with commands after custom command/script.

Hope this will help you. ;)

CLICK UBotDev.com to get FREE UBot Plugins!


#8 wimaxbro

wimaxbro

    Newbie

  • Members
  • Pip
  • 2 posts
  • OS:Windows 7
  • Total Memory:6Gb
  • Framework:v3.5
  • License:Standard

Posted 14 February 2012 - 08:01 PM

I've been searching for a couple hours now and I've hit the wall... I know this should be a fairly straightforward process but I'm just not understanding how to exit the 'loop while' after the conditions have been satisfied.

To be more specific, I'm trying to create a test bot that enters a false value in the UBot Playground CAPTCHA form using the manual $solvecaptcha browser function. After entering a false value on purpose, the bot submits the form. The 'loop while' is supposed to search the page for the text confirming an incorrectly entered CAPTCHA value and loop until the value is entered correctly. However, it just keeps looping, even after the value has been entered correctly.

Thanks to anyone who can offer some input, I just bought UBot a few days ago and am loving it, just need to overcome this first hurdle...

#9 keiooz

keiooz

    Member

  • Members
  • PipPip
  • 26 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Standard

Posted 14 February 2012 - 11:06 PM

I will be testing this code to see if it will working ending a bot cycle process. Thanks for sharing.Posted Image

Edited by keiooz, 14 February 2012 - 11:07 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users