mIRC Homepage
Posted By: westor mIRC Color Code finder - 17/03/14 12:10 AM
Hello,

How can i parse the currently color codes that are in one text with an alias.

alias: $get_code(this is test)
result: 03 04 12

- Thanks!
Posted By: Wims Re: mIRC Color Code finder - 17/03/14 12:17 AM
Loop through the text and whenever you find a $chr(3), check if you have a number etc, how do you want it to work exactly if there is a background color?
Posted By: westor Re: mIRC Color Code finder - 17/03/14 12:27 AM
if there is an background color then i want only the foreground color.
Posted By: Wims Re: mIRC Color Code finder - 17/03/14 12:53 AM
Code:
alias get_colorindex {
  var %pattern,%a 1
  if ($prop == noback) %pattern = /\x03(\d{1,2})/g
  else %pattern =  /\x03(\d{1,2}(?:,\d{1,2})?)/g
  noop $regex($1-,%pattern)
  while ($regml(%a)) var %r %r $v1,%a %a + 1
  return %r
}
Use $get_colorindex(text).noback if you only want the foreground color.
Posted By: westor Re: mIRC Color Code finder - 17/03/14 12:57 AM
Thanks a lot mate!
© mIRC Discussion Forums