Author Topic: Easy IRC colour code application  (Read 2233 times)

Windlord

  • Guest
Easy IRC colour code application
« on: April 25, 2011, 04:41:47 am »
Code: (squirrel) [Select]
const ircCol = "\x0003";
const ircBold = "\x0002";

function iCol ( col, string ) return ircCol + iColnumToString( col ) + string + ircCol;

function iBold( string ) return ircBold + string + ircBold;

function iColnumToString( colnum )
{
 if (typeof(colnum) == "string") return colnum;
 local colstr = colnum.tostring();
 return colnum < 10 ? "0"+colstr : colstr;
}

Example usage:
Code: (squirrel) [Select]
Echo( iCol( 2, "Server Connected" ) +" "+ iBold( iCol( 4, "BUT IT'S BURNING!!!" ) ) );Server Connected BUT IT'S BURNING!!!
« Last Edit: April 27, 2011, 12:45:25 am by Windlord »

Orpheus

  • Newbie
  • *
  • Posts: 49
  • Karma: +1/-0
  • Music is a way of life.
    • View Profile
    • Orphtown UK
Re: Easy IRC colour code application
« Reply #1 on: April 27, 2011, 12:16:08 am »
Thanks again wind for yet another clean cut and useful script snippet (:

Regards Orpheus

Windows: A 64-bit/32-bit extension to a 16-bit GUI on an 8-bit OS written for a 4-bit architecture by a 2-bit company who can not stand 1-bit of competition.

 

© Liberty Unleashed Team.