Jump to content
UBot Underground

Random List Item


Recommended Posts

Before I ask the question, I just want to say I already know the HARD way to do this. I want to see if there is an easier way. Let's say I have two lists. One has the names of ten text files (each text file contains a paragraph of text). The second list has the ten titles of those files in the exact same order. The customer wants to be able to just have a random file chosen. So having said that, is there an easier way then setting ten variables for each list to match the choice (list item) from list two to list one.

 

In other words, if text file in list position 3 is randomly chosen from list one, how can I ensure that list position 3 is also chosen from list two? Thanks.

 

John

Link to post
Share on other sites

a couple things come to mind: is there a reason why you're using lists instead of tables? then you could just select a row with all the information.

 

to answer your question, if I understood it correctly, I would just set a variable to a random number and use that variable with $list item to reference the same item number in each list.

Link to post
Share on other sites

That's why you're the genius and I'm not! Thanks Seth. The reason I am not using tables is really just a matter of convenient scripting. He wants to load text files and I on't feel like doing all the sorting tonight. I will probably (now that you've mentioned it) do it as an upgrade for him sometime in the near future. Just a bit lazy this week! http://ubotstudio.com/forum/public/style_emoticons/default/rolleyes.gif

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