Jump to content
UBot Underground

Jumping around a LOOP


Recommended Posts

I've got some bots that do a series of different things while it's looping. It's fairly long and I have lots of WAIT FORs while it waits for the site to do its thing. Occasionally I'll get an error message from the site - database misconfigured or something. I know I can tell Ubot to search for any messages during this process, but how can I get Ubot to go to the end of the loop and continue and not just STOP the loop?

 

As it stands now, if I get an on-screen error message, it goes through the entire loop which is about 2 minutes long as it tries to find all the missing sections. (Obviously I have stop for errors turned off.) Would be nice if I could do IF "this message" appears, then GOTO a particular spot. (like the end of the loop)

Link to post
Share on other sites

do

 

if (search page error)

than chose by attribute, and click chosen

else ()

 

loop within the loop running continuously within your 2 minute loop you have running on the site already looping itself to check for the error, and if found clicks it and the main loop continues on.

Link to post
Share on other sites
if (search page error)

than chose by attribute, and click chosen

else ()

 

I've already got a series of those in there. There's nothing to click. It's an onscreen message only. No buttons.

 

What I've done is an account creator for 300 StatusNet sites. My Ubot works flawlessly for most, but there's a few StatusNet sites that are configured improperly, so my Ubot doesn't know what to do when it sees an error screen. (not a javascript dialog box) It then wastes 2 minutes while it tries to find what I told it to look for.

 

So there's nothing to click. I want it to IGNORE the rest of the Ubot and just skip to the end. (if I get an error message) I vaguely remember when programming BASIC, you could tell it to GOTO line 30 or whatever, and continue from there. I want to tell Ubot to jump to the last "box" and go from there.

 

A "GoTo" is bad in any language.

 

I don't get it. (I'm not a programmer) Why is it bad in any language?

Link to post
Share on other sites

You are correct about Basic having that command. It was bad then and it is still a bad command.

 

The reason it is bad is because it promotes bad programming logic. If you cannot design adequate logic then throw in a Goto until you get it right.

 

In other words, a "goto" provides a false sense of logic.

 

I could go on but i am too tired to crawl up on my soap box and my high horse is back in the stable for tonight. LOL

Link to post
Share on other sites

OK, cool. That's what I'm askin'. What and where is the SKIP command?

 

USE IFs everywhere.

 

That way If there is a problem it will always be skipped.

 

I tend to write positive and failed URLS to a file, and you can tag these onto a few nodes below the one that captures whether there is success or not.

Link to post
Share on other sites

You can also use a Loop and if you set it's variable to zero then its contents will not execute. Plus, it is quicker logic than building in the IF logic. You will still need that logic but you can jump blocks of code by setting a variable to zero.

 

I would just group related IF is a single Loop with a related loop variable.

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