mIRC Home    About    Download    Register    News    Help

Print Thread
#269748 10/01/22 05:32 PM
Joined: Apr 2005
Posts: 111
X
Vogon poet
OP Offline
Vogon poet
X
Joined: Apr 2005
Posts: 111
on *:text:$($+(*,$me,*)):#:{
if !$window(@mencion) { window -lke +b @mencion 50 250 960 50 }
set %texto $1- | set %menchan $chan | motor
}

alias -l motor2 {
aline @mencion caca $time - $chan - %texto
}


alias -l motor {
var %i = 100
while (%i <= 170) {
window -lke +b @mencion 50 250 960 %i arial 50
inc %i
}
if %menchan iswm #debug { .echo -a 1,7 c2c2  }
elseif aline @mencion $time - $+ 05 $+ ( $+ $chan $+ ) $+ - Nick: $+ ( $+ $nick $+ ) - %texto
}

i want test if then channel is debug and show a different text

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I don't understand your question, because it looks like you're already doing a different behavior depending on whether the channel is named #debug or not.

Are you saying you want the code to be modified to call the not-being-used motor2 when the channel name is #debug, instead of doing the current echo?

Note that you don't need to use the global variable %menchan if you will always be using it from within the ON TEXT event where the alias can also see the $chan string.

Also, you should get into the habit of putting parenthesis around the terms of your if() condition, because when you do not do that, it gives you the $v1 and $v2 from the wrong evaluation, which is almost certainly what you do not want. Plus, it's easier to read the code when you do have the parenthesis. See the difference in the output when I do/don't use the parenthesis:

//if foo == bar noop | if string1 != string2 echo -a v1 $v1 and v2 $v2
result: v1 foo and v2 bar
//if foo == bar noop | if (string1 != string2) echo -a v1 $v1 and v2 $v2
result: v1 string1 and v2 string2


Link Copied to Clipboard