Jump to content
  • 0

Need ideas on how this can be scripted...


Yamil Dagger
 Share

You are about to reply to a thread that has been inactive for 3929 days.

Please take a moment to consider if this thread is worth bumping.

Question

I'm working on a script right now and I've hit a wall. I'm out of ideas on how this can be done... I have a list which is setup by a number then a key, number, key, number...etc

The number is how many chances or 'entries' they have and the key is the person's key. How can I pick a random person/key from the list giving the people with higher entries a better chance of winning? It's kinda similar to the lottery. I can't simply list repeat keys because people can buy 100+ entries so how can this be done?

 

EDIT: I'm already filtering for duplicates, I just need the randomization part. Thanks for anybody who trys to help!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

It's not quite clear to me what you are doing, but it sounds to me as if when you have duplicate entries for the same av, only the one with the higher number of entries is valid (or at least only that one is interesting). So first sort the list for duplicates and eliminate all but the one with the highest number of entries.  (You might find it easier to do that as part of the process of creating the list in the first place.  Just use llListReplaceList to update an avatar's record whenever the number of entries for that av changes.)  THEN do your random selection from the optimized list.

BTW, this question does not really belong in Answers.  When you have a scripting question of this sort, post it in the LSL Scripting forum.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3929 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...