;Raffle System (Beavis)
on *:text:!raffle on:*: {
if ($nick isop #) {
.enable !ticket | /msg $chan A raffle/giveaway is now in progress. To enter the giveaway, type "!ticket"; only 1 ticket is allowed per user. Each ticket costs 200 points. Good luck!
}
else { msg $chan This command is only available to moderators. }
}
on *:text:!raffle off:*: {
if ($nick isop #) {
.disable !ticket | /msg $chan Raffle/giveaway system is now OFF. }
else { msg $chan This command is only available to moderators. }
}
on *:text:!ticket:#:{
if ((%floodraffle) || ($($+(%,floodraffle.,$nick),2))) { return }
set -u3 %floodraffle On
set -u60 %floodraffle. $+ $nick On
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. }
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.
}