mIRC Home    About    Download    Register    News    Help

Print Thread
#125375 17/07/05 05:12 PM
Joined: Jan 2005
Posts: 25
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2005
Posts: 25
Code:
/change {
      if (($nick == name1)) {
        alias2
      }
      else if (($nick == name2)) {
        alias3
      }
      else if (($nick == name3)) {
        alias4
      }
      else if (($nick == name4)) {
        alias1
      }
    } 


^ I have a timer set up to run that command every 24 hours, but it doesn't want to run for some reason. anyone know why?

#125376 17/07/05 05:55 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
just a suggestion: try

if ($nick == nick1) { alias2 }

Last edited by CtrlAltDel; 17/07/05 05:56 PM.

I refuse to engage in a battle of wits with an unarmed person. wink
#125377 17/07/05 06:05 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
elseif or if not else if smile


$maybe
#125378 17/07/05 11:19 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
$nick has no value in a timer... Maybe you mean $me? If you need $nick from some on TEXT trigger, you'll have to pass the $nick as a parameter, like:
//timer 00:00 1 1 change $nick
and use $1 where you used $nick in the alias. You may need to do the same for the other aliases you call from this /change alias...

I don't really know why you use 2 sets of brackets for the condition?
Just if (stuff == otherstuff) {
commands
}
is ok already. Putting () around each of multiple tests combined with && and || and () around the entire expression is ok, I'd advise it even.

If there's only one command following the if, you can put it on the same line without using {}, like
if (stuff == otherstuff) somecommand
Some people advise against it though, I'm just not one of them :tongue:


ps: else if works too, it's just a command inside an else clause, but elseif is nicer ofcourse smile

Last edited by Kelder; 17/07/05 11:25 PM.

Link Copied to Clipboard