i am trying to make a giveaway script and my current code is this
Code:
on *:TEXT:!giveaway enter:#:{
  if (%giveaway == on) {
    if (!$read(giveaway.txt,nw,$nick)) {
      write giveaway.txt $nick
      msg $chan $nick - you have been entered into the giveaway! 
    }
  }
  elseif (%giveaway == off) {
    msg $chan There is no active giveaway
  }
}
on *:TEXT:!giveaway start:#:{
  var %giveaway = on
  { msg $chan giveaway started. please do "!giveaway enter" to enter. To clear all names, please do "!giveaway done" }
}
on *:TEXT:!giveaway end:#:{
  var %giveaway = off
  { msg $chan Giveaway has ended. please do !draw to pick a winner!" }
}
on *:text:!giveaway done:#:{
  var %giveaway = off
  { msg $chan giveaway is complete. erasing all names from the giveaway }
  write $+(-ds,1) giveaway.txt
}
on *:text:!draw:#:{ 
  if (%giveaway == off) { msg $chan The winner is $read(giveaway.txt) $+ !! If you would like to pick another winner draw again. }
  elseif (%giveaway == on) { msg $chan The giveaway is still on! please do "!giveaway end" }
}


The thing is i can't get "!giveaway done" to erase all the line of the file, and when i type !draw it doesn't do anything (i suspect the variables aren't working right) Please help


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball