mIRC Homepage

mention on text

Posted By: XGamerAMD

mention on text - 10/01/22 05:32 PM

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
Posted By: maroon

Re: mention on text - 11/01/22 06:27 AM

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
© 2022 mIRC Discussion Forums