mIRC Home    About    Download    Register    News    Help

Print Thread
#113070 01/03/05 04:24 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Code:
 
alias channelkill {
  if ($left($1,1) !== #) {
    echo -a Channel Kill Error: First parameter is to be a channel!
  }
  elseif ($2 == $null) {
    echo -a Channel Kill Error: Second parameter must be filled with a reason!
  }
  else {
    echo -a Channel Kill Command Success
  }
}
 

First when I try to test the first if
/channelkill Test
=
Channel Kill Error: First parameter is to be a channel!
Which is correct
Then when I try to test the elseif
/channelkill #Test
=
Channel Kill Error: First parameter is to be a channel!
And even if I do the whole command right
/channelkill #Test Hi
Channel Kill Error: First parameter is to be a channel!

#113071 01/03/05 04:26 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
That's because # is the same as $chan, try this:

Code:
alias channelkill {
  if ($left($1,1) !== [color:red]$([/color]#[color:red],)[/color]) {
    echo -a Channel Kill Error: First parameter is to be a channel!
  }
  elseif ($2 == $null) {
    echo -a Channel Kill Error: Second parameter must be filled with a reason!
  }
  else {
    echo -a Channel Kill Command Success
  }
}


New username: hixxy
#113072 01/03/05 04:34 AM
Joined: Mar 2004
Posts: 540
A
Armada Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Duh thought i used the $chr I even have the $asc echo in my status ffs blonde moment thanks


Link Copied to Clipboard