<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/3926" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-03-19T06:11:01-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/3926</id>

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-03-19T06:11:01-04:00</updated>

		<published>2003-03-19T06:11:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17997#p17997</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17997#p17997"/>
		<title type="html"><![CDATA[IRC Control Codes -&gt; HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17997#p17997"><![CDATA[
If you feel like trying something different...<br>This code's not much tested but should deal with every possible combination of control codes in the same way as mirc does.<br><br>Feel free to flame me on irc if it doesn't work like it's supposed to <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>(sorry for the long lines)<br><div class="codebox"><p>Code: </p><pre><code># mIRC control codes to html (css styles)# (c) user - #tcl@undernet 2003.03.18#- Colors like in mirc (0-99)#- Reverse overrides color but does not reset it#- No invalid nesting of html tags (which means alot more tags for complicated stuff :/)proc mirc2html s {  array set cl {0 #FFF 1 #000 2 #00007F 3 #009300 4 #F00 5 #7F0000 6 #9C009C 7 #FC7F00 8 #FF0 9 #0F0 10 #009393 11 #0FF 12 #0000FC 13 #F0F 14 #7F7F7F 15 #D2D2D2}  foreach {e o t x(\002) x(\003) x(\026) x(\037) fg bg} [list [string length $s] "" 0 0 0 0 0 "" ""] break  for {set i 0} {$i&lt;$e} {incr i} {    switch -- [set c [string index $s $i]] {      "\002" - "\026" - "\037" {set x($c) [expr {!$x($c)}]}      "\003" {        if {[set x($c) [regexp {^[0-9]{1,2}(,[0-9]{1,2})?} [string range $s [incr i] [incr i 5]] fg]]} {          incr i -[expr {6-[string length $fg]}]          foreach {fg bg} [split "$fg,$bg" ,] {            set fg [format %g $fg]            if {[string length $bg]&gt;0} {set bg [format %g $bg]}            break          }        } else {          incr i -6; set bg ""        }      }      "\017" {foreach {x(\002) x(\003) x(\026) x(\037) bg} {0 0 0 0 ""} break}      default {append o $c; continue}    }    if {$t} {append o "&lt;/span&gt;"} {set t 1}    set l {}    if {$x(\002)} {lappend l "font-weight: bold"}    if {$x(\037)} {lappend l "text-decoration: underline"}    if {$x(\026)} {      lappend l "color: $cl(0); background-color: $cl(1)"    } else {      if {$x(\003)} {        if {$fg==99} {lappend l "color: $cl(1)"} else {lappend l "color: $cl([expr {$fg%16}])"}        if {[string length $bg]&gt;0} {          if {$bg==99} {            lappend l "background-color: transparent"          } else {            lappend l "background-color: $cl([expr {$bg%16}])"          }        }      }    }    if {[llength $l]&gt;0} {append o "&lt;span style=\"[join $l "; "]\"&gt;"} {set t 0}  }  if {$t} {append o "&lt;/span&gt;"}  regsub -all {&lt;[^&gt;]+&gt;&lt;/[^&gt;]+&gt;} $o {} o  set o}</code></pre></div>EDIT: added the regsub at the end<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Mar 19, 2003 6:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[FreakyComputer]]></name></author>
		<updated>2003-03-16T15:47:59-04:00</updated>

		<published>2003-03-16T15:47:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17919#p17919</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17919#p17919"/>
		<title type="html"><![CDATA[IRC Control Codes -&gt; HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17919#p17919"><![CDATA[
Thank you for your replies <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I'm using that script as I type this, and I got it show backgrounds too!! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>See it in action: <a href="http://lobby24.knightnet.net" class="postlink">http://lobby24.knightnet.net</a> and click <strong class="text-strong">#Lobby24 Live</strong>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> <br><br>Thanks again,<br>FC<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1240">FreakyComputer</a> — Sun Mar 16, 2003 3:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-03-16T13:37:07-04:00</updated>

		<published>2003-03-16T13:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17911#p17911</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17911#p17911"/>
		<title type="html"><![CDATA[IRC Control Codes -&gt; HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17911#p17911"><![CDATA[
written by stdragon :<div class="codebox"><p>Code: </p><pre><code>## irc_to_html.tcl -- by stdragon#set html_color(00) "white"set html_color(01) "black"set html_color(02) "blue"set html_color(03) "green"set html_color(04) "lightred"set html_color(05) "brown"set html_color(06) "purple"set html_color(07) "orange"set html_color(08) "yellow"set html_color(09) "lightgreen"set html_color(10) "cyan"set html_color(11) "lightcyan"set html_color(12) "lightblue"set html_color(13) "pink"set html_color(14) "grey"set html_color(15) "lightgrey"proc irc_to_html {text} {global html_colorset chars [split $text ""]set len [llength $chars]set output ""set in_bold 0set in_color 0set in_uline 0for {set i 0} {$i &lt; $len} {incr i} {switch -exact [lindex $chars $i] {"\002" {if {$in_bold} {append output "&lt;/b&gt;"set in_bold 0} else {append output "&lt;b&gt;"set in_bold 1}}"\003" {incr iset c [lindex $chars $i]if {$i &lt; $len &amp;&amp; [string is integer $c]} {incr iset d [lindex $chars $i]if {$i &lt; $len &amp;&amp; [string is integer $d]} {incr iset num "$c$d"} else {set num "0$c"}if {$in_color} { append output "&lt;/font&gt;" }append output "&lt;font color="if {[info exists html_color($num)]} {append output $html_color($num)} else {append output "black"}append output "&gt;"set in_color 1# Skip past background color if it's there.set c [lindex $chars $i]if {$i &lt; $len &amp;&amp; $c == ","} {incr iset c [lindex $chars $i]if {$i &lt; $len &amp;&amp; [string is integer $c]} {incr iset c [lindex $chars $i]if {![string is integer $c]} { incr i -1 }} else { incr i -2 }} else { incr i -1 }} else {if {$in_color} { append output "&lt;/font&gt;" }set in_color 0incr i -1}}"\015" {if {$in_bold} { append output "&lt;/b&gt;" }if {$in_color} { append output "&lt;/font&gt;" }if {$in_uline} { append output "&lt;/u&gt;" }set in_bold 0set in_color 0set in_uline 0}"\031" {if {$in_uline} {append output "&lt;/u&gt;"set in_uline 0} else {append output "&lt;u&gt;"set in_uline 1}}default {append output [lindex $chars $i]}}}if {$in_bold} { append output "&lt;/b&gt;" }if {$in_color} { append output "&lt;/font&gt;" }if {$in_uline} { append output "&lt;/u&gt;" }return $output}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Sun Mar 16, 2003 1:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-03-16T13:15:28-04:00</updated>

		<published>2003-03-16T13:15:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17909#p17909</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17909#p17909"/>
		<title type="html"><![CDATA[IRC Control Codes -&gt; HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17909#p17909"><![CDATA[
Please search the forum, as code for this has been discussed within the last month.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Mar 16, 2003 1:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[FreakyComputer]]></name></author>
		<updated>2003-03-16T08:56:06-04:00</updated>

		<published>2003-03-16T08:56:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17899#p17899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17899#p17899"/>
		<title type="html"><![CDATA[IRC Control Codes -&gt; HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17899#p17899"><![CDATA[
Hello everyone <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I'd like to know, is there a script that can convert IRC Control Codes (ie. colour, bold, underline, reverse/italic) to normal HTML code? If not, can someone please help me in the correct direction to do this, as you can't just replace all BOLD chars with &lt;b&gt; since HTML needs a closing tag too.<br><br>Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>FC<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1240">FreakyComputer</a> — Sun Mar 16, 2003 8:56 am</p><hr />
]]></content>
	</entry>
	</feed>
