morph3us Posted September 12, 2005 Report Share Posted September 12, 2005 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. Link to comment Share on other sites More sharing options...
Cleric xtx Posted September 13, 2005 Report Share Posted September 13, 2005 (edited) 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 September 13, 2005 by Cleric xtx Link to comment Share on other sites More sharing options...
morph3us Posted September 13, 2005 Author Report Share Posted September 13, 2005 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 Link to comment Share on other sites More sharing options...
Cleric xtx Posted September 13, 2005 Report Share Posted September 13, 2005 (edited) 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 September 13, 2005 by Cleric xtx Link to comment Share on other sites More sharing options...
morph3us Posted September 25, 2005 Author Report Share Posted September 25, 2005 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now