Jump to content
UBot Underground

Check/compare Against A List


Recommended Posts

I'm probably not doing this right. (seeing that I'm a Photoshop guy, and not a programmer.) I want to check an item against a previously saved list, if it's not on this list, then do something. The flow looks like this:

 

http://imgur.com/6P57J7S.jpg

 

I've got two lists. List ONE is recently scraped users. List TWO are scraped users in the past. (userstollsave)
 I don't want to deal with a newly scraped user if I've already dealt with them in the past.

 

Should I compare my two lists first? Make a third list of users who aren't on the old list? Then select next list item from this third list? (how would I do that?)

 

EDIT 10 MINUTES LATER

 

OK, found it via Google search, not forum search. (as usual)

 

http://network.ubotstudio.com/forum/index.php/topic/15286-comparing-lists-if-list1-item-exist-in-list2-then-ignore-function-else-perform/

Link to post
Share on other sites

That will work for basic checking, but if you want to see if the list item as an exact match is in the other list you will have to loop through and check. For example you may have a list item in list1 that is: "hello there" then in list2 you have the word: "there" it would be contained in the other list but it would not be an exact match.

 

Quick example of that:

clear list(%list)
add list to list(%list,$list from text("hello there,hi,hey",","),"Delete","Global")
if($contains(%list,"there")) {
    then {
        alert("yes")
    }
    else {
        alert("no")
    }
}

If you want to see if one list item is the exact same in another list then you have to loop through each list to check like so:

clear list(%list)
add list to list(%list,$list from text("hello there,hi,hey",","),"Delete","Global")
clear list(%list2)
add list to list(%list2,$list from text("hello there,1,2,3,4,5,hi",","),"Delete","Global")
loop($list total(%list)) {
    set(#list_item,$next list item(%list),"Global")
    set list position(%list2,0)
    loop($list total(%list2)) {
        if($comparison(#list_item,"=",$next list item(%list2))) {
            then {
                alert("{#list_item} is found in both lists")
            }
            else {
            }
        }
    }
}
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...