Mufasa 0 Posted June 14, 2014 Report Share Posted June 14, 2014 Title says it all, how do I end a loop If something exists and keep the loop going? I just dont want any commands to execute if something exists. And to keep the loop going. I dont want to stop the script if that makes sense. Quote Link to post Share on other sites
Gogetta 263 Posted June 14, 2014 Report Share Posted June 14, 2014 Your question is somewhat confusing. Check out the if exists command on the wiki. http://wiki.ubotstudio.com/wiki/Exists Quote Link to post Share on other sites
Mufasa 0 Posted June 14, 2014 Author Report Share Posted June 14, 2014 Your question is somewhat confusing. Check out the if exists command on the wiki. http://wiki.ubotstudio.com/wiki/Exists Ya. Ok so if your setting up a bot to comment on something. But your account has a error and can't. If the error pops up you want the loop to end there and stop going but continue the next account in the same loop. Quote Link to post Share on other sites
UBotDev 276 Posted June 14, 2014 Report Share Posted June 14, 2014 Use loopwhile instead of loop, so your loop can end before it loops through all. Quote Link to post Share on other sites
Gogetta 263 Posted June 14, 2014 Report Share Posted June 14, 2014 Have you script run the commands for commenting only if something exists. That could be some text that is only present on the page if the user is logged in. So, say a Log out button or some other element that only a logged in user can see on the page. Quote Link to post Share on other sites
Bot-Factory 602 Posted June 15, 2014 Report Share Posted June 15, 2014 You can also add additional conditions. Like a counter for example. If you want to repeat something. Loop while not exists.... AND counter < 5 Than you can retry something multiple times. But it's not running forever because you have a second condition (counter). I have those checks in all my newer bots. I navigate to a site. Check for a specific element. If it's not there, I wait a couple of seconds and reload the page. I retry that 3 times. And all the additional commands are only executed when the elements I'm waiting for are really there. Dan Quote Link to post Share on other sites
the_way 52 Posted June 15, 2014 Report Share Posted June 15, 2014 http://paperrollercoasters.com/loop.jpg Quote Link to post Share on other sites
Aymen 385 Posted June 15, 2014 Report Share Posted June 15, 2014 set var_exist = falseloop while(var_exist = false){if(element exists){var_exist = true;}} that will break you out of the loop 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.