Jump to content
UBot Underground

How do I use the "contains" qualifier?


Recommended Posts

Hi all, been quite a while since I touch my ubot :(

I just found out that there is a new "contains" qualifier. So I would like to know how to use this new command, and what is the meaning of "container text" and "container list", any examples? It says that the contains qualifier will search for a specific text in the "container text" or "container list" and returns true.

 

Thanks.. :)

Link to post
Share on other sites

You can use it to test a lot of stuff example check if a variable has the value you want or if a value has been saved in a list I usually use it for checking if a variable has a value or not in it example .

if

contains

#variable

Search text (submission was successful)

then create list or a table and save the results

Link to post
Share on other sites

Correct me if I am wrong but I do not believe that "Container List" works. At least it hasn't in my tests.

 

I just ran a test on a list of 10 items and I was searching for a similar item in each. It did not find a single one. And it should have if I understood.

 

Which leads me to believe that "Container List" means something totally different.

 

Food for thought:

 

IF "Container List" is for List then wouldn't it be awesome if it would return the $List Position.

 

As it stand right now.

 

I have to Load Next item into a variable and then do a "Contains" check to see if what I am searching for is in there.

 

If a "Contains" check could return a $List position THEN for large list I could see that reducing CPU cycles.

 

Just a thought.

Link to post
Share on other sites

iRobot,

 

Thanks for that.

 

Try this.

 

Open a new bot. Read a list from a file. THEN do a search using "Contains" and see if that works.

 

I am thinking that if you are building a list then that will be different in memory rather than reading a list in from a file.

 

Buddy

Link to post
Share on other sites

Hmmmmm

 

I don't like this.

 

The list item has to be an exact to what you are comparing to.

 

I want it to tell me that my search term is in that line.

 

So its working and then again its not working.

Link to post
Share on other sites

For those of you that are interested here are two Bots that I am struggling with. Not that they do not work. They both work but each processes the "contains" qualifier differently.

 

In example 1, the search criteria must EXACTLY match an item in the list. If it doesn't then the alert will not pop up.

 

In example 2, the search criteria can be a partial of a item in the list. However, using the same logic from example 1 does not work. No matter how many times yp try it will not find your selection UNLESS you type in the whole item.

 

However, in example 2 what I did was constructed a Loop whereby each list item is loaded into a variable using the Set node. Then it is checked using the Contains qualifier. Voila! It found the partial.

 

In my opinion, example 1 should work. Why?

 

If you happen to be using a large list then cycling through the entire list using Example 2 is a waste of resources. Granted, our computers are probably not going to show a considerable amount of sluggishness.

 

So, is this a Bug?

 

To be honest I have no clue.

 

I do think it might be worth checking it out. Of course I cannot do that. LOL

 

IF it is a bug then would it be possible to fix it in such a way that it could return the List's Position that it was found in? That my friends would be Kool!

 

IF NOTHING ELSE comes from this.

 

Then take this as an example of how to accomplish a problem from two different perspectives!

 

Oh!

No bots were hurt in the testing process here nor was my Start button. Thanks goes to iRobot for the data file that I started using.

url-list.txt

Contains-Example-1.ubot

Contains-Example-2.ubot

Link to post
Share on other sites

the reason is that contains treats single pieces of text differently than it treats lists. in a piece of text, it will look to see if the text contains the thing you're looking for. in a list, it will look to see if the list contains an item that is the same as the text you're looking for. I think it would create too many problems to set it up as you described, and if you have a really long list, you might get a positive search result when you didn't really want 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...