Jump to content
UBot Underground

use loop cycles (list) with net list item


Recommended Posts

I'm having some problems with my first bot and loops.

 

I am using Loop Cycles: List Total

 

I call Next list item to populate a variable.

 

At the end of the list, it pushes past the end of the list and throws an error.

 

Here is the bot, it basically goes to MX Toolbox and checks the MX records of each site in sites.txt and scrapes it into a table, I am saving it to a file for now until I figure this loop issue out, then I will actually do some checks against the data instead of actually saving it. This bot is going to run daily to check mx records of my clients and make sure they are set properly.

 

The loop keeps bombing saying it is going past the end of the loop.

MX Check.ubot

Link to post
Share on other sites

try the attached.

 

That works, but I don't understand why.

 

I see you created a temp variable set to 0. You use that variable as the position for pulling the current list item. What confuses me though is I don't see INC called anywhere to increment that variable, yet your code works. Looking at this, it looks like it would pull item 0 over and over again until World War III. I would expect INC -> #temp to be called some where if you are using #temp to control the position in the list.

 

On another note, what did you think of the code, did I do anything convoluted, or was I in the right direction? The list in loops is very confusing as it doesn't appear to work like traditional programming.

Link to post
Share on other sites

That works, but I don't understand why.

 

I see you created a temp variable set to 0. You use that variable as the position for pulling the current list item. What confuses me though is I don't see INC called anywhere to increment that variable, yet your code works. Looking at this, it looks like it would pull item 0 over and over again until World War III. I would expect INC -> #temp to be called some where if you are using #temp to control the position in the list.

 

On another note, what did you think of the code, did I do anything convoluted, or was I in the right direction? The list in loops is very confusing as it doesn't appear to work like traditional programming.

 

He He...Nice catch Bob! TJ...take a nap already! http://ubotstudio.com/forum/public/style_emoticons/default/smile.gif

 

 

 

Link to post
Share on other sites

Sorry here is the fixed.

 

I also think it was nicely setup and coded. wans't much to adjust to get it working right for ya.

 

Is there a way to use a list in a loop without using a control variable for the loop iteration?

I thought Next List Item was how you did it, but it over steps the list end when using list total items as the loop cycle condition.

 

By the way, thanks a lot TJ for the quick response. I'll be able to add the additional functionality now to complete the bot and make use of 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...