Why does this work
Code:
on *:TEXT:!youtube*:#: {
  if (!$2-) { goto b }
  if ($2- && $nick == %ADMIN. [ $+ [ $chan ] ] || $nick == %SUPERADMIN) { goto a }
  :a
  set %YOUTUBE. $+ $chan $2-
  $msg($chan,New youtube message has been set.)
  return
  :b
  $msg($chan,%YOUTUBE. [ $+ [ $chan ] ] $+ .)
  return
}


but this doesn't work
Code:
on *:TEXT:!youtube*:#: {
  if ($2- && $nick == %ADMIN. [ $+ [ $chan ] ] || $nick == %SUPERADMIN) { goto a }
  if (!$2-) { goto b }
  :a
  set %YOUTUBE. $+ $chan $2-
  $msg($chan,New youtube message has been set.)
  return
  :b
  $msg($chan,%YOUTUBE. [ $+ [ $chan ] ] $+ .)
  return
}


Calling me confused. Took me a while to move things around to figure out why something I found to be a perfectly fine script no matter how I looked at it, wouldn't work. Surely #2 if wouldn't fire no matter what (if condition isn't met), regardless of where it's positioned? Clearly something I'm missing here.

Thanks!

Last edited by lindenkron; 24/11/13 04:54 AM.