mIRC Homepage
Posted By: learn3r Into one single event - 14/01/07 06:57 AM
Code:
on *:input:*:{
  if ($left($1,1) != /) && (!$ctrlenter) {
    say $acro($1-)
    halt
  }
}
on *:INPUT:*: {
  if (/* !iswm $1-) {
    if ( $nick(#,$me,ov) ) echo $target $+(,$iif($me isop #,04@,12+),,$me) : $1-
    else echo $target $me ¬ $1-
    .msg $target $1-
    halt
  }
}


How can I make this work at the same time?
coz it gives me a double message on channel...
Posted By: CitizenKane Re: Into one single event - 14/01/07 02:36 PM
Code:
on *:input:*:{
  if ($left($1,1) != /) && (!$ctrlenter) {
    say $acro($1-)
    halt
  }
  else if (/* !iswm $1-) {
    if ( $nick(#,$me,ov) ) echo $target $+(,$iif($me isop #,04@,12+),,$me) : $1-
    else echo $target $me ¬ $1-
    .msg $target $1-
    halt
  }
}
Posted By: learn3r Re: Into one single event - 14/01/07 04:06 PM
doesnt work
Posted By: landonsandor Re: Into one single event - 14/01/07 08:06 PM
what about:

Code:
on *:input:*:{
  if ($left($1,1) != /) && (!$ctrlenter) {
    say $acro($1-)
    halt
  }
  elseif (/* !iswm $1-) {
    if ( $nick(#,$me,ov) ) echo $target $+(,$iif($me isop #,04@,12+),,$me) : $1-
    else echo $target $me ¬ $1-
    .msg $target $1-
    halt
  }
}



There was a space between the ELSE and IF. ELSEIF is one word smile
Posted By: CitizenKane Re: Into one single event - 15/01/07 05:53 AM
I always use "else if", not "elseif". Works for me.

Also, shouldn't
Code:
if ($left($1,1) != /) && (!$ctrlenter) {

be
Code:
if (($left($1,1) != /) && (!$ctrlenter)) {

?

Again, that's my just my style. You don't need my extra parenthesis?
Posted By: Riamus2 Re: Into one single event - 15/01/07 05:48 PM
Whether it works or not, ELSEIF is the correct format.

And, no. You don't need the parentheses. It doesn't hurt to have them, though. I prefer seeing the parentheses around the whole IF so you can easily see where it is. The inside parentheses aren't necessary unless you're trying to change the order of operation:
Code:
if (%this == 100 && (%that == 1 || %that == 100)) { echo -a test }



Otherwise, it checks the && first, then does the ||.
© mIRC Discussion Forums