Anyone can help me on how to modified irc2html originally written by Natrak to be more interactive (using color) such as seen on default mIRC color. For example, I want to change 'Join Event' to be in GREEN color when this script display it on web html.
Modified and Patched Version for irc2html script as below;
###############################################################
# __ __ _ #
# ___ ____ __ _ ___ ___ / /_ \ \/ / #
# / _ \' __/ _ `/ / -_)/ __/ _/ ) ( #
# / .__/_/ \___/ /\___/\__/\__/ /_/\_\ #
# /_/ -------- /__/ --------------------- #
# #
###############################################################
# Filename.....: irc2html.tcl #
# Description..: ProjectX irc2html v1.00 #
# Author.......: Natrak <natrak@projectx.mx.dk> #
# Website......: http://www.projectx.mx.dk/ #
###############################################################
### -----------------------------------------------------------
### Description
### -----------------------------------------------------------
### This script logs what goes on in an IRC channel, converts
### it to HTML and make it visible to user on the web. To see
### irc2html in action visit:
### http://www.projectx.mx.dk/contact/spycam.html
### -----------------------------------------------------------
### User-defined settings
### -----------------------------------------------------------
### Path and name of html file to create:
set i2h_htmlfile "../public_html/mychannel.php"
### IRC channel to log:
set i2h_chan "#mychannel"
### Text that start with this character will not be included on
### the web page that is generated:
set i2h_secret "*"
### What sort of output should the script mimic:
### 0 = BitchX
### 1 = mIRC
set i2h_style 1
### Most browsers support page refreshing using meta tags. This
### value determins how long the browser should wait before
### checking if the page has been change:
set i2h_refresh 6
### This value is the maximum number of lines the script will
### keep 'logged' at once and display on the web page:
set i2h_maxlines 18
### All the settings below determin what the generated page
### should look like. Topic, colors of the text, background,
### heading, and the font to use:
set i2h_title "$i2h_chan Live! Chat"
set i2h_text "#666666"
set i2h_joincolor "#006600"
set i2h_bgcolor "#FFFFFF"
set i2h_heading "#666666"
set i2h_font "Fixedsys"
### -----------------------------------------------------------
### About ProjectX
### -----------------------------------------------------------
###
### We are an organised group of scripters determined to help
### each other create, develop and refine scripts. We bundle our
### knowledge, so that the inexperienced scripters may benefit
### from our experienced crew-members and our experienced
### members benefit from the enthousiasm and fresh insights
### from our less-experienced members. We are not trying to
### create the 'ULTIMATE' script, there is no such thing. We
### concentrate on creating good, reliable, compatible and
### useful scripts for eggdrops.
### You can contact ProjectX in the following ways:
### - Visit our homepage..: http://www.projectx.mx.dk/
### - Vist us on IRC......: #ProjectX (GalaxyNet)
### - Drop us an e-mail...: info@projectx.mx.dk
###############################################################
########### Don't change anything below this line! ############
###############################################################
set ver "1.00"
set i2h_history
- bind ctcp - ACTION ctcp:i2h
bind join - * join:i2h
bind kick - * kick:i2h
if {$numversion < 1030000} {
bind mode - * mode11x:i2h
} else {
bind mode - * mode13x:i2h
}
bind nick - * nick:i2h
bind part - * part:i2h
bind pubm - * pubm:i2h
bind sign - * sign:i2h
bind topc - * topc:i2h
proc i2h:make {} {
global i2h_history i2h_htmlfile i2h_maxlines i2h_chan i2h_text i2h_bgcolor i2h_heading i2h_refresh i2h_font i2h_title server
if {[llength $i2h_history] > $i2h_maxlines} { set i2h_history [lrange $i2h_history 1 end] }
set i2h_file [open $i2h_htmlfile w]
puts $i2h_file "<HTML>\n<HEAD>\n <TITLE>$i2h_title</TITLE>\n <META HTTP-EQUIV=\"Refresh\" CONTENT=\"$i2h_refresh\">\n</HEAD>"
puts $i2h_file "<BODY TEXT=\"$i2h_text\" BGCOLOR=\"$i2h_bgcolor\" LINK=\"$i2h_heading\" VLINK=\"$i2h_heading\">"
puts $i2h_file " <FONT SIZE=\"+1\" COLOR=\"$i2h_heading\" FACE=\"Tahoma, Sans-serif\">$i2h_chan<FONT SIZE=\"-1\" FACE=\"Fixedsys\"> \[[lindex [getchanmode $i2h_chan] 0]\]: '[i2h:convert [topic $i2h_chan]]'</FONT></FONT><P>"
puts $i2h_file " <FONT SIZE=\"-1\" FACE=\"$i2h_font\">"
puts $i2h_file " <B>Server</B>: underworld.undernet.org<BR>"
puts $i2h_file " <B>Users</B>: [lrange [chanlist $i2h_chan] 0 end] \[[llength [chanlist $i2h_chan]]\]<BR>\n <HR SIZE=\"1\">"
close $i2h_file
set i2h_file [open $i2h_htmlfile a]
for {set i 0} {$i < [llength $i2h_history]} { incr i } {
puts $i2h_file " [lindex $i2h_history $i]<BR>"
}
puts $i2h_file " </FONT>\n <HR SIZE=\"1\">\n <CENTER><FONT SIZE=\"-1\" FACE=\"Sans-serif\"></FONT></CENTER>\n</BODY>\n</HTML>"
close $i2h_file
return 1
}
proc i2h:convert {i2h_text} {
#Strip control codes.. sorta
regsub -all $i2h_text "" i2h_text
regsub -all $i2h_text "" i2h_text
regsub -all $i2h_text "" i2h_text
regsub -all $i2h_text "" i2h_text
regsub -all $i2h_text "" i2h_text
#Convert special chars
regsub -all & $i2h_text "\\&" i2h_text
regsub -all \" $i2h_text "\\&" i2h_text
regsub -all < $i2h_text "\\&" i2h_text
regsub -all > $i2h_text "\\&" i2h_text
regsub -all " " $i2h_text " \\&" i2h_text
return $i2h_text
}
proc ctcp:i2h {nick host handle dest keyword arg} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $dest] [string tolower $i2h_chan]] && ![string compare $keyword "ACTION"]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] * $nick [i2h:convert $arg]"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] ð $nick [i2h:convert $arg]"]
}
}
utimer 1 i2h:make
}
proc join:i2h {nick host handle chan} {
global i2h_history i2h_chan i2h_style i2h_joincolor
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick ($host) has joined $chan"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- $nick \[$host\] has joined $chan"]
}
}
i2h:make
}
proc kick:i2h {nick host handle chan knick arg} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $knick was kicked by $nick ([i2h:convert $arg])"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- $knick was kicked off $chan by $nick ([i2h:convert $arg])"]
}
}
utimer 1 i2h:make
}
proc mode11x:i2h {nick host handle chan arg} {
global i2h_history i2h_chan i2h_style
if {[lindex $arg 0] == "+k"} {
set mode [lindex $arg 0]
} else {
set mode [lrange $arg 0 end]
}
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick sets mode: $mode"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- mode/$chan \[$mode\] by user $nick"]
}
}
utimer 1 i2h:make
}
proc mode13x:i2h {nick host handle chan arg mnick} {
global i2h_history i2h_chan i2h_style
set mode "$arg $mnick"
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick sets mode: $mode"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- mode/$chan \[$mode\] by user $nick"]
}
}
utimer 1 i2h:make
}
proc nick:i2h {nick host handle chan newnick} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick is now known as $newnick"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- $nick is now known as $newnick"]
}
}
utimer 1 i2h:make
}
proc part:i2h {nick host handle chan {arg ""}} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick ($host) has left $chan"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- $nick has left $chan"]
}
}
utimer 1 i2h:make
}
proc pubm:i2h {nick host handle chan arg} {
global i2h_history i2h_chan i2h_secret
if {![string compare [string tolower $chan] [string tolower $i2h_chan]] && [string range $arg 0 0] != $i2h_secret} {
set i2h_history [lappend i2h_history "\[[time]\] &$nick&&[i2h:convert $arg]"]
}
i2h:make
}
proc sign:i2h {nick host handle chan arg} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $chan] [string tolower $i2h_chan]]} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick ($host) has quit irc ([i2h:convert $arg])"]
} else {s
set i2h_history [lappend i2h_history "\[[time]\] -o- $nick \[$host\] quit ([i2h:convert $arg])"]
}
}
utimer 1 i2h:make
}
proc topc:i2h {nick host handle chan topic} {
global i2h_history i2h_chan i2h_style
if {![string compare [string tolower $chan] [string tolower $i2h_chan]] && $nick != "*"} {
if {$i2h_style} {
set i2h_history [lappend i2h_history "\[[time]\] *** $nick changes topic to '[i2h:convert $topic]'"]
} else {
set i2h_history [lappend i2h_history "\[[time]\] -o- $nick changes topic on $chan to '[i2h:convert $topic]'"]
}
}
utimer 1 i2h:make
}
set i2h_file [open $i2h_htmlfile w]
puts $i2h_file "<HTML>\n<HEAD>\n <TITLE>$i2h_title</TITLE>\n <META HTTP-EQUIV=\"Refresh\" CONTENT=\"$i2h_refresh\">\n</HEAD>"
puts $i2h_file "<BODY TEXT=\"$i2h_text\" BGCOLOR=\"$i2h_bgcolor\" LINK=\"$i2h_heading\" VLINK=\"$i2h_heading\">"
puts $i2h_file " <FONT SIZE=\"+1\" COLOR=\"$i2h_heading\" FACE=\"Tahoma, Sans-serif\">$i2h_chan<FONT SIZE=\"-1\" FACE=\"Fixedsys\"> \[\]: ''</FONT></FONT><P>"
puts $i2h_file " <FONT SIZE=\"-1\" FACE=\"${i2h_font}\">"
puts $i2h_file " <B>Server.</B>: unknown<BR>"
puts $i2h_file " <B>Users..</B>: unknown<BR>\n <HR SIZE=\"1\">"
puts $i2h_file " </FONT>\n <HR SIZE=\"1\">\n <CENTER><FONT SIZE=\"-1\" FACE=\"Sans-serif\"></FONT></CENTER>\n</BODY>\n</HTML>"
close $i2h_file
utimer 2 i2h:make
putlog "\[ProjectX\] irc2html v$ver by Natrak <natrak@projectx.mx.dk> loaded."
Thanks for your help