mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2018
Posts: 1
R
Mostly harmless
OP Offline
Mostly harmless
R
Joined: May 2018
Posts: 1
For now I created simple counter like that :
Code:
on *:text:!smth:#: {
  inc %counter | .msg $chan $+($nick,:) Something happend %counter times
}


I would like to add specific message or another message if (%counter % 100 == 0)

I tried with this but doesnt work:
Code:
on *:text:!smth:#: {
  inc %counter | var %message $nick: Something happend %counter times
  if (%counter % 100 == 0) var %message $nick: diffrent message
  msg # %message
}

Last edited by ra1ndrop; 03/05/18 02:26 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
/help If then else
you can't do match in an if() like that nor "if (2 + 2 == 4)"

Code:
//var %counter 100 | if (%counter // 0) echo -a match
//var %counter 100 | if ($calc(%counter % 100) == 0) echo -a match

or since the multiple of 100's always end with 2 zeroes:
Code:
//var %counter 100 | if (*00 iswm %counter) echo -a match


Link Copied to Clipboard