;Raffle System (Beavis)
on *:text:!raffle off:#:{
if ($nick isop #) {
set %ticketoff 1
msg $chan $nick, the raffle/giveaway system is now set to OFF.
}
else { msg $chan This command is only available to moderators. }
}
on *:text:!raffle on:#:{
if ($nick isop #) {
unset %ticketoff
msg $chan $nick has started a raffle/giveaway. To enter the raffle/giveaway, you need a ticket. You can purchase a ticket for 200pts by typing the command "!ticket"; only 1 ticket allowed per user.
}
else { msg $chan This command is only available to moderators. }
}
on *:text:!ticket:#:{
if (%ticketoff) { msg $chan There is currently no raffle/giveaway. | HALT }
if ((%floodraffle) || ($($+(%,floodraffle.,$nick),2))) { return }
set -u3 %floodraffle On
set -u60 %floodraffle. $+ $nick On
/* Add follower check script here.
https://albinstuff.net/twitch2.php?id=[USERNAME]&follows=[FOLLOWS] might have what I need.
*/
if ($hget($+(tickets.,#),$nick)) { msg # $nick , you already have a ticket! | return }
var %topic = $+(#,.,$nick)
; Check if enough points
if ($readini(Points.ini,%topic,Points) >= 200) {
; Deduct the points
var %a = $v1 - 200
writeini Points.ini %topic Points %a
; Add the user to tickets.#channel hash table, creating the table if it doesn't exist
hadd -m $+(tickets.,#) $nick 1
msg # $nick spent 200 points on a raffle ticket.
}
else msg # Sorry $nick , you don't have enough points to join this raffle. You need 200 points to join. }
on *:text:!roll:#:{
if ($nick isop #) {
if ($hget($+(tickets.,#))) {
var %i = $r(1,$hget($+(tickets.,#),0).item)
msg # The winner is $hget($+(tickets.,#),%i).item
; The next line frees the table (all data in it is gone)
hfree $+(tickets.,#)
}
else msg # There are no ticket entries at this time.
}
else msg # $nick, only moderators can use that command.
}