Skip to content
General IRCX

CUSA font colours

A TG007 community discussion started by morph3us.

Discussion 5 posts
Page 1 of 1
Open
Topic #4761 · 5 published posts · 1,646 views

Hey anyone can u please help me. I can convert font colours that have one word in the font name like "arial"

 

 if (*|&H0|* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 1 $cusa($1-) 
   halt
  ;Black Colour (global)
 }

 

But when the font is like "Comic Sans MS" it wont work Please help.

 

Operating System: Microsoft Windows 7 Ultimate 6.1.7600 (Ultimate)

CPU: AMD RX™ 8120 Eight Core, 3.10 GHz

Maximum Clock: 2200 MHz

RAM: DDR3 1333 16 gb Ram

Video Adapter: ATI Radeon HD 3200 Graphics (512 MB)

3D Accelerator: ATI Radeon HD 3200 (RS780)

Monitor: DELL ST2420 (Digital) [24 "LCD]

Monitor: HP 2159 Series Widle LCD monitor [23" LCD]

 

Your better off to have a friend than to be all alone.. If you fail, Your friend can help you up.

I think I got the numbers right...

alias cfont {
 if ($regex($1-,/^CUSA\|\^\|.+?\|\^\|&[0-9A-Z]+\|\^\|[BI]*\|\^\| \72/iS) == 0) { halt }
 var %a, %b = $regsub($1,/^CUSA\|\^\|.+?\|\^\|&[0-9A-Z]+\|\^\|[BI]*\|\^\| \72/iS,,%a)
 var %text = $remove($1-,%a)
 if (BI == $gettok(%text,7,124)) var %t = bold & italic
 elseif (B == $gettok(%text,7,124)) var %t = bold
 elseif (I == $gettok(%text,7,124)) var %t = italic
 elseif ($gettok(%text,7,124) !isin BI) var %t = normal
 echo -a Font: hex colour $right($gettok(%text,5,124),-2) $gettok(%text,3,124) in %t
}

 

Edited to support text without cusa's font

Re-edited to work properly

Edited Sep 13, 2005 4:30 PM by Cleric xtx

 

This is what i use

 

;;;;;;;;;;;;;;;;;;Chats Usa Font Stripper By Ozzy10 edited by Morph3us
alias cusa {
 if (* $+ CUSA $+ $chr(124) $+ $chr(94) $+ $chr(124) $+ * $+ $chr(124) $+ $chr(94) $+ $chr(124) $+ * $+ $chr(124) $+ $chr(94) $+ $chr(124) $+ * $+ $chr(124) $+ $chr(94) $+ $chr(124) $+ * !iswm $1) {
   if ($chr(38) isin $left($1,1)) { return $mid($1,2) $2- | halt }
   else { return $1- | halt }
 }
 tokenize 32 $1-
 if ($chr(38) isin $1) && ($chr(58) isin $2) { var %f $2- | return $mid(%f,2) | halt }
 elseif ($chr(38) isin $2) && ($chr(58) isin $3) { var %f $3- | return $mid(%f,2) | halt }
 elseif ($chr(38) isin $3) && ($chr(58) isin $4) { var %f $4- | return $mid(%f,2) | halt }
}

on ^*:text:*:#: { 
 if (*|B* iswm $1) {
   var %bold 
 }
 if (*|&H0|* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 1 $cusa($1-) 
   halt
  ;Black Colour (global)
 }
 if (*|&HFF0000|* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 12 $cusa($1-) 
   halt
  ;Blue Colour (global)
 }
 if (*|&H800000|* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 2 $cusa($1-) 
   halt
  ;Navy Colour (global)
 }
 if (*|&H2A2AA5|* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 5 $cusa($1-) 
   halt
  ;Brown Colour (global)
 }
 if (*&H3F85CD^* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 7 $cusa($1-) 
   halt
  ;Orange Colour (global)
 }
 if (*&HFF00FF* iswm $1) { 
   echo -t $chan $chr(32) $chr(32) $chr(32) $+ $nick : $+ %bold 13 $cusa($1-) 
   halt
  ;Pink Colour (global)
 }
}

 

That only picks up single named fonts

 

Operating System: Microsoft Windows 7 Ultimate 6.1.7600 (Ultimate)

CPU: AMD RX™ 8120 Eight Core, 3.10 GHz

Maximum Clock: 2200 MHz

RAM: DDR3 1333 16 gb Ram

Video Adapter: ATI Radeon HD 3200 Graphics (512 MB)

3D Accelerator: ATI Radeon HD 3200 (RS780)

Monitor: DELL ST2420 (Digital) [24 "LCD]

Monitor: HP 2159 Series Widle LCD monitor [23" LCD]

 

Your better off to have a friend than to be all alone.. If you fail, Your friend can help you up.

I've corrected the coding I previously posted. Instead of using a space as the token, you should have used just the font coding by itself.

The way you were trying would have taken the first token before a space, which would have returned CUSA|^|Comic. The coding below will return the font formatting only:

  var %a, %b = $regsub($1,/^CUSA\|\^\|.+?\|\^\|&[0-9A-Z]+\|\^\|[BI]*\|\^\| \72/iS,,%a)
var %text = $remove($1-,%a)

Alternatively, you can try replaceing tokenize 32 $1- with tokenize 58 $1- as a colon follows the formatting.

Edited Sep 13, 2005 4:38 PM by Cleric xtx

 

yeah at once stage it was returning some thing in echo. But i want it actually show the person fonts colour. Im a tad confused on it all. I havnt had much time to get around to my script. If theres a few more pointers to show please let me know

 

Cheers

 

Operating System: Microsoft Windows 7 Ultimate 6.1.7600 (Ultimate)

CPU: AMD RX™ 8120 Eight Core, 3.10 GHz

Maximum Clock: 2200 MHz

RAM: DDR3 1333 16 gb Ram

Video Adapter: ATI Radeon HD 3200 Graphics (512 MB)

3D Accelerator: ATI Radeon HD 3200 (RS780)

Monitor: DELL ST2420 (Digital) [24 "LCD]

Monitor: HP 2159 Series Widle LCD monitor [23" LCD]

 

Your better off to have a friend than to be all alone.. If you fail, Your friend can help you up.