Thanks for this code. I am trying to make a few edits. How could I make it say "there is not an active raffle right now" when the raffle is closed? Also how can I make it so only mods or the broadcaster can open the raffle? It seems that typing !raffle will automatically just start a new raffle for anyone as this is. Also ending the raffle will restart the timed message when there is not a raffle under way. Is there a way to fix this? Here's what my code looks like.
Code:

on *:TEXT:*:#: {
  if ($1 == !raffle) {
    if (%open == 1) {
      write raffle.txt $nick
      msg #cartooncyborg /me $nick entered the raffle!
    }
    elseif (!%open) { echo -at msg /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 == !raffleopen) {
    start_raffle
  }
  alias start_raffle {
    if (!%open) {
      write -c raffle.txt
      set %open 1
      msg #cartooncyborg The raffle is open! You have 5 minutes to submit a level by typing !raffle. Type !people to see who's already entered the raffle!
      .timer 1 120 msg #cartooncyborg 3 minutes left for the raffle to close. Type !raffle if you have a level suggestion!
      .timer 1 290 msg #cartooncyborg 1 minute left people! Type !raffle to enter! Go Go Go!
      .timer 1 350 end_raffle
    }
    elseif (%open) { echo -at msg #cartooncyborg /me There is an active raffle already. }
  }
  alias end_raffle { 
    if (!%open) {
      var %user = $read(raffle.txt,n)
      write -c raffle.txt
      unset %open 
      msg #cartooncyborg /me And the winner is... %user $+ !!! Well Done!
    }
    elseif (!%open) { echo -at msg /me There is not an active raffle. }


Last edited by Jae55555; 19/10/15 03:21 PM.