Code:
on *:TEXT:*:#: {
if ($1 == !giveaway) {
if (%open == 1) {
write Raffle.txt $nick
msg $chan $nick entered the giveaway!
}
}
elseif ($1 == !people) {
if (%open) {
msg $chan There are currently $lines(Raffle.txt) users in the giveaway!
}
}
if ($1 == !raffleopen) {
start_raffle
}
}
alias start_raffle {
if (!%open) {
write -c Raffle.txt
set %open 1
msg #yourchan The raffle is open! You have 5 minutes to enter by typing !raffle
.timer 1 120 msg #yourchan 3 minutes left for the raffle to close. Type !raffle to enter!
.timer 1 290 msg #yourchan 1 minute left people! Type !raffle to enter! Go Go Go!
.timer 1 350 end_raffle
}
elseif (%open) { echo -at There is an active raffle already. }
}
alias end_raffle { 
if (%open) {
var %user = $read(Raffle.txt,n)
write -c Raffle.txt
unset %open 
msg #yourchan /me And the winner is... %user $+ !!! Well Done!
}
elseif (!%open) { echo -at There is not a n active raffle. Type /start_raffle to start one. }
}

Replace the code with this one

Last edited by OrFeAsGr; 28/09/15 06:59 PM.