on *:TEXT:*:#: {
if ($1 == !raffle) {
if (!$($+(%,joinraf,$nick),2)) {
set $+(%,joinraf,$nick) 1
if (%open == 1) {
write raffle.txt $nick
msg #cartooncyborg /me $nick entered the raffle!
}
elseif (!%open) { msg #cartooncyborg /me There is not an active raffle. }
}
elseif ($1 == !people) {
if (%open) {
msg #cartooncyborg /me There are currently $lines(raffle.txt) users in the raffle!
}
}
}
if ($1 == !startraffle) {
if ($nick isop #) || ($nick == cartooncyborg) {
start_raffle
}
}
if ($1 == !stopraffle) {
if ($nick isop #) || ($nick == cartooncyborg) {
end_raffle
}
}
}
alias start_raffle {
if (!%open) {
unset %joinraf*
write -c raffle.txt
set %open 1
msg #cartooncyborg /me --[[ A NEW RAFFLE HAS BEGUN ]]--
msg #cartooncyborg You have 5 minutes to submit a level by typing !raffle. MrDestructoid
msg #cartooncyborg Type !people to see how many people have already entered the raffle!
.timerraffle1 1 120 msg #cartooncyborg 3 minutes left for the raffle to close. Type !raffle if you have a level suggestion!
.timerraffle2 1 290 msg #cartooncyborg 1 minute left to enter the raffle! Hurry!
.timerraffle3 1 350 end_raffle
}
elseif (%open) { msg #cartooncyborg /me There is an active raffle already. }
}
alias end_raffle {
if (%open) {
.timerraffle* off
var %user = $read(raffle.txt,n)
write -c raffle.txt
unset %open
unset %joinraf*
msg #cartooncyborg /me --[[ %user $+ ]]-- HAS WON THE RAFFLE! --[[ CONGRATULATIONS ]]--
msg #cartooncyborg Please type your level in the chat so we can play it! MrDestructoid
}
elseif (!%open) { msg #cartooncyborg /me There is not an active raffle. }
}
}