Jump to content
UBot Underground

How to combine & arrange keywords into a list?


Recommended Posts

Hey fellow botters; got a puzzle for you today.

 

I've been working with a Table that I want to compile a Keyword List out of. It looks like a longer version of this:

 

post-625-0-57633600-1297625188_thumb.png

 

It doesn't have to be a &table, it could be 3 separate %lists instead... But either way what I'm trying to wind up with is a single %list that combines the first two columns, both apart and together, with the 3rd column, all in a big list. So here is the exact output I'm looking for in this case:

 

Widget

Cog

Sprocket

New Widget

New Cog

New Sprocket

Used Widget

Used Cog

Used Sprocket

Red Widget

Red Cog

Red Sprocket

Blue Widget

Blue Cog

Blue Sprocket

Green Widget

Green Cog

Green Sprocket

Orange Widget

Orange Cog

Orange Sprocket

Black Widget

Black Cog

Black Sprocket

New Red Widget

New Red Cog

New Red Sprocket

New Blue Widget

New Blue Cog

New Blue Sprocket

New Green Widget

New Green Cog

New Green Sprocket

New Orange Widget

New Orange Cog

New Orange Sprocket

New Black Widget

New Black Cog

New Black Sprocket

Used Red Widget

Used Red Cog

Used Red Sprocket

Used Blue Widget

Used Blue Cog

Used Blue Sprocket

Used Green Widget

Used Green Cog

Used Green Sprocket

Used Orange Widget

Used Orange Cog

Used Orange Sprocket

Used Black Widget

Used Black Cog

Used Black Sprocket

 

-So Row 2 (3rd row) is used in every keyword combination, but the other rows are not used every single time. The rows are also not equal lengths.

 

I would imagine that there is a way to do this using either &table rows or lists, that use $next list item in a loop, to combine the words together, but the usage escapes me. And how can we make it so Row 2 is always used but Rows 0 and 1 aren't used in every keyword? Confusing. Help!

Link to post
Share on other sites

I think you can do it in three loops. I will think on it so I might pop up an example.

Thanks Buddy! I'll try working with three loops now and see what I can come up with now too.

 

Just to expand on what you said though; the three loops are for the three rows, right?

 

So If in reality my script is 9 rows, I need 9 loops, right?

 

Cheers,

Luke

Link to post
Share on other sites

Luke,

 

Save this bot to a folder then run add New & Used in the Status box separated by a comma,

 

Then add you colors to the Colors text box and separate them with a comma.

 

In the Product box add your Widget, Cog and Sprocket and separate then with a comma.

 

Then run the bot. A text file will be created.

 

It's not perfect, in fact, three items are missing. I will try to debug the code but at least you will see where I was going with the Three loops i was talking about.

Keyword-List-Builder.ubot

  • Like 1
Link to post
Share on other sites

Awesome Buddy, Thank you! It works very well.

 

It's not perfect, in fact, three items are missing. I will try to debug the code but at least you will see where I was going with the Three loops i was talking about.

 

Hmm, I see what you mean about the 3 missing. -I wonder how that happened... Perhaps my example had 3 repeats in it somehow?

 

Anyway It's what I needed to build from so thanks again. I was making it to hard as usual, mucking around with a table... :blink:

Link to post
Share on other sites

Hmm, I found the missing 3:

 

new widget

new cog

new Sprocket

 

It got the used ones, just not the new ones somehow... Likely you're just missing another "set list position" in the final loop or something...

 

Thanks again!

Link to post
Share on other sites

Much better!

 

It is getting them all perfectly now, and I much prefer the ordering this way.

 

Thanks a bunch, I can take it from here. Now I'm off to make conditionals like "if no Color variable exists, run it as two combiniations instead of three"... Should be fun.

 

Oh yeah, & i'm going to expand it into 6 Keyword blanks instead of three! Six nested loops, all conditional except for the Product. Should be fun, don't you think? :(

 

Thanks again,

Luke

Link to post
Share on other sites
  • 2 years later...

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