KryptonCnR   -  Feb 15, 2014
on $*:TEXT:/^[!](add?swat)/Si:*:{
  if ($nick isop #) {
    if (!$2) { msg $iif($chan,$chan,$nick) Enter A S.W.A.T Name To Add! }
    else {
      write addswat.txt $2-
      msg $iif($chan,$chan,$nick) 14Added07 $2- 14To S.W.A.T ID07 $lines(addswat.txt) $+ 14.
    }
  }
  else {
    msg $chan $nick has failed to use this command!
  } 
}
on $*:TEXT:/^[!](del?swat)/Si:*:{
  if ($nick isop #) {
    if (!$2) { msg $iif($chan,$chan,$nick) Enter A S.W.A.T ID Number To Delete! }
    else {
      if ($2 isnum) {
        msg $iif($chan,$chan,$nick) Deleted S.W.A.T ID $2 From The Database.
        write -dl $+ $2 addswat.txt
      }
      else { msg $nick $2 Is Not A Valid S.W.A.T ID }
    }
  }
}
else {
  msg $chan $nick has failed to use this command!
}
on $*:TEXT:/^[!](swat?)/Si:#lvcnr.swats:{
  if ($2) {
    if ($2 !isnum) { msg $chan 07 $+ $2 14Isn't A S.W.A.T ID | halt }
    if ($2 isnum) {
      if ($read(addswat.txt,$2)) {
        msg $chan 10Swat ID0: 10 $+ $2 $+ 4/10 $+ $lines(addswat.txt) 0- $read(addswat.txt,$2)
      }
      else {
        msg $chan 14Invalid S.W.A.T ID On Line07 $2 $+ 14.
      }
    }
  }
}

Edit:

I managed to do a simpler way and it works perfectly!

Sorasyn  -  Feb 17, 2014

I don't understand your regex expressions at all.

(b(adswat)?)

Matches badswat, with any wildcard character (badswat*). You have no OR operators inside your regex expressions which make a lot of them painfully redundant.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.