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


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…


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:


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.


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

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


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.


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


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++) {
	if (msgToggle) {
		$.say($.lang.get('ticketrafflesystem.enter.confirm', $.whisperPrefix(user), times));

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


its work!
tks u very much!


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