This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

irc2html

Old posts that have not been replied to for several years.
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

irc2html

Post by Clipped »

I have been looking for irc2html version 2.0 by projectx..Their page is down and the only version in the tcl section is 1.0...Was there a prob with 2.0? 1.0 is giving me some probs so Iwas hoping 2.0 would solve this :)

If anyone has this could you please pm me :)

Thanks
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I am unsure if there are any problems. The Tcl section is only updated, when the scripts are sent to slennox.

However, if we knew what the problem was, we may be able to fix it.
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

Problem is on party line :)

<DumbBot> [10:41] #deplete: mode change '-o Clipped' by Clipped!Slave@63.144.144.2d43=
<DumbBot> [10:41] Tcl error [mode11x:i2h]: called "mode11x:i2h" with too many arguments
<DumbBot> [10:41] #deplete: mode change '+o Clipped' by DumbBot!DumBot@=R8wnqwy.on.the.waste.org
<DumbBot> [10:41] Tcl error [mode11x:i2h]: called "mode11x:i2h" with too many arguments

The irc2html works fine but the tcl error is irritating when on partyline.. I posted the code in here but its a farly large script. Maybe I should have just posted the snippet that was giving me the problem :) his happens with any mode change in the room..So when on party line whenever a vop joins etc the error is stated.. :)

Code: Select all

set ver "1.00"
set i2h_history [list]

bind ctcp - ACTION ctcp:i2h
bind join - * join:i2h
bind kick - * kick:i2h
if {[string range $version 2 1] < 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=\"Monospace\"> \[[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>: [string range $server 0 [expr [string last ":" $server] - 1]]<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\"><I>Powered by <A HREF=\"http://www.projectx.mx.dk/\">ProjectX</A> irc2html by <A HREF=\"mailto:natrak@projectx.mx.dk\">Natrak</A></I></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
  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
  if {[lindex $arg 0] == "+k"} {
    set mode [lindex $arg 0] $mnick
  } 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 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} {
  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=\"Monospace\"> \[\]: ''</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\"><I>Powered by <A HREF=\"http://www.projectx.mx.dk/\">ProjectX</A> irc2html by <A HREF=\"mailto:natrak@projectx.mx.dk\">Natrak</A></I></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."
If you dont want to spend the time on this then thats fine LOL..I would be much better off to simply learn tcl and fix it myself :) but time is tight right now. Hopefully ill find some time in the near future :)

Clipped

PS Sorry about not using the code tag when I first posted :)
Last edited by Clipped on Sun Jan 26, 2003 1:41 am, edited 2 times in total.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

change this:

Code: Select all

if {[string range $version 2 1] < 1030000} { 
bind mode - * mode11x:i2h 
} else { 
bind mode - * mode13x:i2h 
}
to this:

Code: Select all

if {$numversion < 1030000} { 
bind mode - * mode11x:i2h 
} else { 
bind mode - * mode13x:i2h 
}
ofc you really don't need that if statement as I guess noone is using a eggdropversion below 1.3 anymore ;) bind mode - * mode13x:i2h is all you need from it
Elen sila lúmenn' omentielvo
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

:) changed code. and the following occured..I could see this becoming a complete rewrite of the script LOL I appreciate the help guys :) but like I said if too much dont bother yourselves..I really should sit down and start learning tcl


<DumbBot> [11:18] #depleted: mode change '+o DumbBot' by ChanServ!service@webchat.org
<DumBot> [11:18] Tcl error [mode13x:i2h]: wrong # args: should be "set varName ?newValue?"
<DumBot> [11:18] Tcl error [mode13x:i2h]: wrong # args: should be "set varName ?newValue?"
<DumBot> [11:18] Tcl error [mode13x:i2h]: wrong # args: should be "set varName ?newValue?"
<DumBot> [11:18] Tcl error [mode13x:i2h]: wrong # args: should be "set varName ?newValue?"

Clipped
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

just change this line:

Code: Select all

set mode [lindex $arg 0] $mnick
to this :)

Code: Select all

set mode "[lindex $arg 0] $mnick"
should work then :)
Elen sila lúmenn' omentielvo
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

Cool,

Works perfeect and It was not a complete rewrite LOL... I really appreciate the help.. Thanks :)

Ill have to learn tcl..I dont want to bother you guys all the time for script help :) hehe

Once again thanks :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

hehe.. don't learn tcl because you are woried you'll bother us... learn it because you want to... a much better motivator ;) .... trust me... if you were bothering us we would just ignore you :p
Elen sila lúmenn' omentielvo
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Papillon wrote: ofc you really don't need that if statement as I guess noone is using a eggdropversion below 1.3 anymore ;) bind mode - * mode13x:i2h is all you need from it

There are still a large number of veteran users (such as myself) that use
eggdrops based on the 1.1.5 series.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

heh.. I had no idea.... my apologies :)
Elen sila lúmenn' omentielvo
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Dear Papillon,

There's still an error when user parting the channel and when bot set mode +-b/+-o/+-v in the channel. The error as below;

A). Part events:

In Channel;
* Parts: Rimex (kutali@210.187.228.47)

In Partyline;
Tcl error [part:i2h]: called "part:i2h" with too many arguments

Effect;
irc2html could not write part event in webpage.

B). +ban/-ban/+op/-op/+v/-v Events:

In channel;
MyBot sets mode: -b *!*@*.lamers.org

Effect In HTML/Webpage;
MyBot sets mode: -b OR
MyBot sets mode: +b

* In the events of +b/-b/+o/-o/+v/-v, the script doesn't write in into html. So that, we can't see it via html. Additional, when some user does a netsplit, it also failed to write in into html.

Thanks.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

LOL..well im lame but I figured out the one error..

This code

Code: Select all

set i2h_history [lappend i2h_history "\[[time]\] *** $nick sets mode: $mode"]
needs to be changed to

Code: Select all

set i2h_history [lappend i2h_history "\[[time]\] *** $nick sets mode: $mode $mnick"]

Its missing the $mnick
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

and try this to fix the 1st error...

change this

Code: Select all

proc part:i2h {nick host handle chan} {
to

Code: Select all

proc part:i2h {nick host handle chan arg} {
Clipped
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

a) you are right Clipped, just a little thing... do like this

Code: Select all

proc part:i2h {nick host handle chan {arg ""}} {
to make it compatible with older versions of eggdrop

b)take this code:

Code: Select all

proc mode13x:i2h {nick host handle chan arg mnick} { 
  global i2h_history i2h_chan i2h_style 
  if {[lindex $arg 0] == "+k"} { 
    set mode [lindex $arg 0] $mnick 
  } else { 
    set mode [lrange $arg 0 end] 
  }
and make it alot more simple:)

Code: Select all

proc mode13x:i2h {nick host handle chan arg mnick} { 
  global i2h_history i2h_chan i2h_style 
  set mode "$arg $mnick"  
as for not logging netsplits.... well, there is no bind to catch them in this code... so I'd guess that is the reason ;)
Elen sila lúmenn' omentielvo
User avatar
Clipped
Halfop
Posts: 73
Joined: Fri Jan 24, 2003 2:27 am

Post by Clipped »

Thanks :)

Appreciate all the help ;)

Clipped
Locked