Giveway's [Ticket Raffle] not work with tickets proportion


#1

sry about poor english

[Ticket Raffle] is the most convenient function i used.
but today i think its not work about how many audiences buy their tickets.

for Ex1:
Player1 buy 97 tickets,and player2 buy 3 tickets.
Under normal circumstances only 3% will be selected to player2.
But! if repick and like 80% selected player1 and 20% selected player2?

for Ex2:
Player1 buy 1997 tickets,and player2 buy only 3 tickets.
Under normal circumstances only 0.15% will be selected to player2.
But! if repick and like 50% selected player1 and 50% selected player2?!

I dont understand how it work…


#2

From what I recall, each ticket bought places the user’s name into an array. So if you bought 300, your name would be in there 300 times.

And when a raffle is closed, it picks a random value from that array.

So think of it like having a list like:

Name1
Name1
Name1
Name2
Name1
Name3
Name1

And the bot picks one at random. Name1 has the best chance here, but Name2 and Name3 still can get picked. It will (sometimes) seem like the raffle leans towards one winner over the other, but it’s just picking randomly.


#3

i think i got the problem…?

  for (var i = 0; i < times; i++) {
       entries.push(user), $.say($.whisperPrefix(user) + $.lang.get('ticketrafflesystem.cost', times, times * cost,  >getTickets(user)))
 	return;

and i think because i add $.say and return;?


#4

Why would you return during the loop? If you try to enter 10 times, it’d return after the first entry… It needs to enter 10 times.


#5

because my audiences say they want to know how many they buy when they buy…
sry…
how can i change?
cant join say when entries?


#6

If you want it to return a message saying how many tickets they’ve entered, change it to this:

    for (var i = 0; i < times; i++) {
        entries.push(user);
    }
	if (msgToggle) {
		$.say($.lang.get('ticketrafflesystem.enter.confirm', $.whisperPrefix(user), times));
	}

You can change the msgToggle to true/false with:
!traffle messagetoggle


#7

its work!
tks u very much!


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.