mIRC Home    About    Download    Register    News    Help

Print Thread
mention on text #269748 10/01/22 05:32 PM
Joined: Apr 2005
Posts: 71
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 71
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

Re: mention on text [Re: XGamerAMD] #269752 11/01/22 06:27 AM
Joined: Jan 2004
Posts: 1,744
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,744
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