-1

How can I use on text $date on mirc?

I am trying to do something like this.

on *:text:$(* %date *):#: { 
  var %date = $date(yy-mm-dd)
  if ($nick == user) { 
    do something 
  } 
}
skdfsfwse
  • 19
  • 7

2 Answers2

1

You can encapsulate the text to listen to in $() to evaluate it before matching it to the incoming message:

on *:TEXT:$($date(yy-mm-dd)):#:{
  msg $chan That's today!
}
Patrickdev
  • 2,341
  • 1
  • 21
  • 29
  • The wildcards on text match means that it can be in any part of the text... not only at the beginning of it, what happens if it is at the end of the text with colors? – Sirius_Black Aug 14 '16 at 00:37
  • Then it won't work. Note that the question was changed as I was writing up this answer, it originally didn't include any wildcards. Regardless, wildcards can be added within the `$()` too. – Patrickdev Aug 14 '16 at 08:03
0

i recommend this

on *:text:$($iif($+(*,$date(yy-mm-dd),*) iswm $strip($1-),$1-)):#:{
if ($nick == user) { do something } 
}

the on text will strip the color codes at $1- and return all the text colors stripped. by the way, it will match the date at any position of the line, not just at the beginning

Sirius_Black
  • 471
  • 3
  • 11