Jump to content
UBot Underground

Loop While - How To?


Recommended Posts

hello Guys and Girls,

 

I have a short question about the "Loop while" function.

 

loop while($contains(%firemailemaillist,"Name1")) {
    clear list(%firemailemaillist)
    add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global")
}

 

My intension was, that the loop while function did search all the time till they found "Name1" on firemaillist.

 

But the loop while function doesent do that.

 

Anyone knows why?

 

would be great if someone got an idea.

Link to post
Share on other sites

Loop while means that while the condition is true run the code inside of me. So if that list contains Name1 then it runs the code inside and if you add the table and then it contains Name1 again then it runs again until it can't find Name1 in that list.

 

Here is a super basic example to help you understand how it works:

set(#num,0,"Global")
loop while($comparison(#num,"<",5)) {
    increment(#num)
}

This says to increment #num while it's less than 5 and so the first time the condition is checked #num is 0 and therefore less than 5 so it increments #num. Then it checks again and now num is 1 and so it goes again until eventually num is 5 and since it is not less than 5 the loop while stops because the condition is no longer true.

Link to post
Share on other sites

Give this a try:

set(#nameFound,"false","Global")
loop while($comparison(#nameFound,"= Equals","false")) {
    clear list(%firemailemaillist)
    add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global")
    if($contains(%firemailemaillist,"Name1")) {
        then {
            set(#nameFound,"true","Global")
        }
        else {
        }
    }
}
Link to post
Share on other sites

 

Give this a try:

set(#nameFound,"false","Global")
loop while($comparison(#nameFound,"= Equals","false")) {
    clear list(%firemailemaillist)
    add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global")
    if($contains(%firemailemaillist,"Name1")) {
        then {
            set(#nameFound,"true","Global")
        }
        else {
        }
    }
}

Thank you very much! That Code works GREAT!!!!! you the best :-)

  • Like 1
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...