Jethro commented on a Page, Quote Bot  -  Oct 25, 2010

DragonFlare, > if ($1 == AddQuote) { if (%Quotes == On) {You should use the handy && operator:

if ($1 == AddQuote) && (%Quotes == On) {
           ...
         }
         elseif (...) && (...) {
          ...
        }

Why put another if statement within the else condition and halt it? (In fact, you don't need the else condition at all) You don't want your code to appear redundant. Same for the rest.

If possible, don't make the use of pipe a habit, as well as the the /halt where it's not necessary.

Edit: I see what you tried to achieve. But this will look a lot better nevertheless:

on *:text:*:#:{
  tokenize 32 $strip($1-)
  if ($1 == quotes) && ($2 == on) { 
    set %Quotes On 
    msg Random Quotes Activated. 
  }
  elseif ($1 == quotes) && ($2 == off) {
    msg $chan Random Quotes Are Off. 
  }
}

If you know regex, it can be shortened a bit further:

on $*:text:/^quotes\so(n|ff)$/iS:#:{
  if ($regml(1) == n) {
    set %quotes On 
    msg # Random Quotes Activated. 
  }
  else { 
    set %quotes off
    msg # Random Quotes Are Off.
  }
}
 Respond  
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.