mIRC Home    About    Download    Register    News    Help

Print Thread
#168774 14/01/07 06:57 AM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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...


learn learn learn
Joined: Mar 2006
Posts: 47
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Mar 2006
Posts: 47
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
  }
}

Last edited by CitizenKane; 14/01/07 02:37 PM.
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
doesnt work


learn learn learn
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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


Those who fail history are doomed to repeat it
Joined: Mar 2006
Posts: 47
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Mar 2006
Posts: 47
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?

Last edited by CitizenKane; 15/01/07 05:54 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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 ||.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard