View Single Post
Old 11-12-2005, 02:24 PM  
Harm
Too much time...
 
Join Date: Jul 2003
Posts: 1,430
Default

You're getting close indeed. Perhaps I should readd that to the next release. I don't use it myself and was probably too focused on implementing core features to think about this one.

You should be able to achieve that using something like this:
Code:
proc ioB:basicreplace {section strin} {
global ioBvar colour
if {[info exists colour($section)]} {
	set col $colour($section)
} else {
	set col $ioBvar(colour)
}	
set output [ioB:replacevar $strin "%sitename" $ioBvar(sitename)]
set output [ioB:replacevar $output "%colour" $ioBvar(colour)]
set output [ioB:replacevar $output "%scolour" $col]
set output [ioB:replacevar $output "%section" $section]
return "$output"
}
You then need to define the $colour($section) variables.

You have indeed spotted a weakness of the irc colour system. If the coloured word starts with a number, this one might be interpreted as a part of the coulour code itself. You can add a space after the colour number or use a two digits colour number.
Harm is offline   Reply With Quote