#(zyphhh) Comparing key values then getting the higher key

25 messages · Page 1 of 1 (latest)

open forum
#

So I'm working on a bingo game

I want to use the value of the difficulty key to help me create the tasks which fill the card

I need to pull every task name with a specific difficulty value, then randomly choose between all tasks with that difficulty value

https://paste.denizenscript.com/View/128742

maiden aspenBOT
#

(zyphhh) Comparing key values then getting the higher key

maiden aspenBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

gaunt compass
#

How are you storing the list of possible tasks?

open forum
#

Its in the paste

#

exactly like that

gaunt compass
#

Why not have each difficulty in a separate data script?

#

Sorry not data script itself, but each separate category between “tasks” and the task name?

#

Then use ListTag.random to choose random ones from that list?

open forum
cunning wedge
open forum
open forum
warm rivet
#

Do you want to always have the same amount selected for a certain category?

#

or do you want a weight system that selects randomly

open forum
warm rivet
#

You can just assign a certain weight to each of your keys then have code that gets a random pull based on those assigned values repeated x times (based on how many pulls you want)

#

Here's a showcase post you can take an example from #showcase message

#

Obviously that's how the base picker would work, if you'd like to have a max amount of duplicate entries, max entries of a certain difficulty etc you'd have to add in those checks yourself

#

If you're having trouble coming up with the code feel free to come back here and ask, if I don't respond someone else definitely will :)

fervent deltaBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@open forum