<?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/8142" />

	<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>2004-08-22T07:58:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-08-22T07:58:53-04:00</updated>

		<published>2004-08-22T07:58:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39994#p39994</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39994#p39994"/>
		<title type="html"><![CDATA[code as requested]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39994#p39994"><![CDATA[
#<br># ques5.tcl<br>#<br># Copyright (C) 1995, 1996, 1997 Robey Pointer<br># Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team<br>#<br># v1 -- 20aug95<br># v2 -- 2oct95   [improved it]<br># v3 -- 17mar96  [fixed it up for 1.0 multi-channel]<br># v4 -- 3nov97  [Fixed it up for 1.3.0 version bots] by TG<br># v4.00001 nov97 [blurgh]<br># v5-BETA1 -- 26sep99 by rtc<br>#<br># $Id: ques5.tcl,v 1.10 2002/12/24 02:30:04 wcc Exp $<br>#<br># o clean webfile var removal<br># o using timezone variable from config file<br># o unified options and removed unnecessary ones.<br># o convert urls, nicks etc. to HTML before we put them into the page.<br># o nice html source indenting<br># o replace the old file after the new one has completely written to<br>#   disk<br># o the description still contained robey's address, replaced<br>#   by the eggheads email.<br># o don't link any spaces in the HTML2.0 file<br># v5-RC1 -- 29sep99 by rtc<br># o info line wasn't converted to HTML.<br># o now supports bold, italic and underline text style and colors.<br># v5-FINAL -- 04oct99 by rtc<br># o style converter now strictly follows HTML standard.<br># o Fake color attributes with number &gt; 2^32 don't cause Tcl<br>#   error anymore.<br># o now uses strftime as time and date functions have both been removed<br>#   in 1.3.29<br><br># this will create an html file every so often (the default is once every<br># 5 minutes).  the html file will have a table showing the people currently<br># on the channel, their user@hosts, who's an op, and who's idle.  it<br># uses a table which some browsers (and pseudo-browsers like lynx) can't<br># see, but it can optionally make a second page which will support these<br># archaic browsers.  browsers supporting push-pull will receive the updated<br># page automatically periodically.<br>#<br># if you have a "url" field defined for a user, their nickname in the<br># table will be a link pointing there.  otherwise it checks the info<br># line and comment field to see if they start with "http://" -- if so,<br># that link will be used.  as a last resort, it will make a "mailto:"<br># link if an email address is recorded for the user.<br>#<br># feel free to modify and play with this.  the original was written in<br># 15 minutes, then at various times i fixed bugs and added features.<br># softlord helped me make the design look a little nicer. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">  if you make<br># any nifty improvements, please let us know.<br>#                                       <a href="mailto:eggheads@eggheads.org">eggheads@eggheads.org</a><br><br># this line makes sure other scripts won't interfere<br>if {[info exists web_file] || [array exists web_file]} {unset web_file}<br><br># You must define each channel you want a webfile for .<br># If you want a HTML2.0 file, too, put it's filename separated by<br># a colon to the same option, it goes to the same directory.<br>set web_file(#mp3world) "/home/sdpete/public_html/channel/index.html"<br><br># This example demonstrates how to put lynx files into another dir.<br>#set web_file(#gloom) "/home/lamest/public_html/gloom.html:lynx/gloom.html"<br><br># You can also prevent the HTML2.0 file from being written.<br>#set web_file(#channel) "/home/lamest/public_html/channel.html"<br><br># You can even let the bot write only a HTML2.0.<br>#set web_file(#blah) "/home/lamest/public_html/:blah.html"<br><br># how often should these html files get updated?<br># (1 means once every minute, 5 means once every 5 minutes, etc)<br>set web_update 5<br><br># Which characters should be allowed in URLs?<br># DO NOT MODIFY unless you really know what you are doing.<br># Especially never add '&lt;', '"' and '&gt;'<br>set web_urlchars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 :+-/!\$%&amp;()=[]{}#^~*.:,;\\|?_@"<br><br># IRC -&gt; HTML color translation table<br>set web_color(0) "#FFFFFF"<br>set web_color(1) "#000000"<br>set web_color(2) "#00007F"<br>set web_color(3) "#008F00"<br>set web_color(4) "#FF0000"<br>set web_color(5) "#7F0000"<br>set web_color(6) "#9F009F"<br>set web_color(7) "#FF7F00"<br>set web_color(8) "#F0FF00"<br>set web_color(9) "#00F700"<br>set web_color(10) "#008F8F"<br>set web_color(11) "#00F7FF"<br>set web_color(12) "#0000FF"<br>set web_color(13) "#FF00FF"<br>set web_color(14) "#7F7F7F"<br>set web_color(15) "#CFCFCF"<br><br># IRC -&gt; HTML style translation table<br>set web_style(\002) "&lt;B&gt; &lt;/B&gt;"<br>set web_style(\003) "&lt;FONT&gt; &lt;/FONT&gt;"<br>set web_style(\026) "&lt;I&gt; &lt;/I&gt;"<br>set web_style(\037) "&lt;U&gt; &lt;/U&gt;"<br><br>proc getnumber {string} {<br>  set result ""<br>  foreach char [split $string ""] {<br>    if {[string first $char "0123456789"] == -1} {<br>      return $result<br>    } else {<br>      append result $char<br>    }<br>  }<br>  return $result<br>}<br><br>proc webify {string} {<br>  # Tcl8.1 only:<br>  #return [string map {\" " &amp; &amp; &lt; &lt; &gt; &gt;} $string]<br><br>  # Otherwise use this:<br>  regsub -all "\\&amp;" $string "\\&amp;" string<br>  regsub -all "\"" $string "\\"" string<br>  regsub -all "&lt;" $string "&lt;" string<br>  regsub -all "&gt;" $string "&gt;" string<br><br>  return $string<br>}<br><br>proc convstyle {string} {<br>  global web_color web_style<br>  set result ""<br>  set stack ""<br>  for {set i 0} "\$i &lt; [string length $string]" {incr i} {<br>    set char [string index $string $i]<br>    switch -- $char {<br>      "\002"  - "\026" - "\037" {<br>        if {[string first $char $stack] != -1} {<br>          # NOT &amp;&amp;<br>          if {[string index $stack 0] == $char} {<br>            append result [lindex $web_style($char) 1]<br>            set stack [string range $stack 1 end]<br>          }<br>        } else {<br>          append result [lindex $web_style($char) 0]<br>          set stack $char$stack<br>        }<br>      }<br>      "\003" {<br>        if {[string first $char $stack] != -1} {<br>          if {[string index $stack 0] == $char} {<br>            append result [lindex $web_style($char) 1]<br>            set stack [string range $stack 1 end]<br>          }<br>        }<br>        set c [getnumber [string range $string [expr $i + 1] [expr $i + 2]]]<br>        if {$c != "" &amp;&amp; $c &gt;= 0 &amp;&amp; $c &lt;= 15} {<br>          incr i [string length $c]<br>          append result "&lt;FONT COLOR=\"$web_color($c)\"&gt;"<br>          set stack $char$stack<br>        }<br>      }<br>      default {append result $char}<br>    }<br>  }<br>  foreach char [split $stack ""] {<br>    if {$char == "\002" || $char == "\003" ||<br>        $char == "\026" || $char == "\037"} {<br>      append result [lindex $web_style($char) 1]<br>    }<br>  }<br>  return $result<br>}<br><br>proc urlstrip {string} {<br>  global web_urlchars<br>  set result ""<br>  foreach char [split $string ""] {<br>    if {[string first $char $web_urlchars] != -1} {<br>      append result $char<br>    }<br>  }<br>  return $result<br>}<br><br>proc do_ques {} {<br>  global web_file web_update web_timerid<br>  global botnick timezone<br><br>  if {[info exists web_timerid]} {unset web_timerid}<br><br>  foreach chan [array names web_file] {<br>    if {[lsearch -exact [string tolower [channels]] [string tolower $chan]] == -1} {continue}<br>    set i [split $web_file($chan) ":"]<br>    set dir ""<br>    set file1 [lindex $i 0]<br>    set file2 [lindex $i 1]<br>    set j [string last "/" $file1]<br>    if {$j != -1} {<br>      set dir [string range $file1 0 $j]<br>      set file1 [string range $file1 [expr $j + 1] end]<br>    }<br>    unset i j<br>    if {$file1 != ""} {<br>      set fd1 [open $dir$file1~new w]<br>    } else {<br>      set fd1 [open "/dev/null" w]<br>    }<br>    if {$file2 != ""} {<br>      set fd2 [open $dir$file2~new w]<br>    } else {<br>      set fd2 [open "/dev/null" w]<br>    }<br><br>    puts $fd1 "&lt;HTML&gt;"<br>    puts $fd1 "  &lt;HEAD&gt;"<br>    puts $fd1 "    &lt;TITLE&gt;People on [webify $chan] right now&lt;/TITLE&gt;"<br>    puts $fd1 "    &lt;META HTTP-EQUIV=\"Refresh\" CONTENT=\"[webify [expr $web_update * 60]]\"&gt;"<br>    puts $fd1 "    &lt;META NAME=\"GENERATOR\" VALUE=\"ques5.tcl\"&gt;"<br>    puts $fd1 "  &lt;/HEAD&gt;"<br>    puts $fd1 "  &lt;BODY&gt;"<br><br>    puts $fd2 "&lt;HTML&gt;"<br>    puts $fd2 "  &lt;HEAD&gt;"<br>    puts $fd2 "    &lt;TITLE&gt;People on [webify $chan] right now&lt;/TITLE&gt;"<br>    puts $fd2 "    &lt;META HTTP-EQUIV=\"Refresh\" CONTENT=\"[webify [expr $web_update * 60]]\"&gt;"<br>    puts $fd2 "    &lt;META NAME=\"GENERATOR\" VALUE=\"ques5.tcl\"&gt;"<br>    puts $fd2 "  &lt;/HEAD&gt;"<br>    puts $fd2 "  &lt;BODY&gt;"<br>    if {![onchan $botnick $chan]} {<br>      puts $fd1 "    &lt;H1&gt;Oops!&lt;/H1&gt;"<br>      puts $fd1 "    I'm not on [webify $chan] right now for some reason&lt;BR&gt;"<br>      puts $fd1 "    IRC isn't a very stable place these days..."<br>      puts $fd1 "    Please try again later!&lt;BR&gt;"<br><br>      puts $fd2 "    &lt;H1&gt;Oops!&lt;/H1&gt;"<br>      puts $fd2 "    I'm not on [webify $chan] right now for some reason&lt;BR&gt;"<br>      puts $fd2 "    IRC isn't a very stable place these days..."<br>      puts $fd2 "    Please try again later!&lt;BR&gt;"<br>    } else {<br>      puts $fd1 "    &lt;H1&gt;[webify $chan]&lt;/H1&gt;"<br>      puts $fd2 "    &lt;H1&gt;[webify $chan]&lt;/H1&gt;"<br>      if {$file2 != ""} {<br>        puts $fd1 "    If this page looks screwy on your browser, "<br>        puts $fd1 "    try the &lt;A HREF=\"$file2\"&gt;HTML 2.0 "<br>        puts $fd1 "    version&lt;/A&gt;.&lt;BR&gt;"<br>      }<br>      puts $fd1 "    &lt;TABLE BORDER=\"1\" CELLPADDING=\"4\"&gt;"<br>      puts $fd1 "      &lt;CAPTION&gt;People on [webify $chan] as of [webify [strftime %a,\ %d\ %b\ %Y\ %H:%M\ %Z]]&lt;/CAPTION&gt;"<br>      puts $fd1 "      &lt;TR&gt;"<br>      puts $fd1 "        &lt;TH ALIGN=\"LEFT\"&gt;Nickname&lt;/TH&gt;"<br>      puts $fd1 "        &lt;TH ALIGN=\"LEFT\"&gt;Status&lt;/TH&gt;"<br>      puts $fd1 "        &lt;TH ALIGN=\"LEFT\"&gt;User@Host&lt;/TH&gt;"<br>      puts $fd1 "      &lt;/TR&gt;"<br>      puts $fd2 "    &lt;EM&gt;People on [webify $chan] as of [webify [strftime %a,\ %d\ %b\ %Y\ %H:%M\ %Z]]&lt;/EM&gt;"<br>      puts $fd2 "    &lt;PRE&gt;"<br>      puts $fd2 "      Nickname  Status           User@Host"<br>      foreach nick [chanlist $chan] {<br>        set len1 9<br>        set len2 16<br>        puts $fd1 "      &lt;TR ALIGN=\"LEFT\" VALIGN=\"TOP\"&gt;"<br>        if {[isop $nick $chan]} {lappend status "op"}<br>        if {[getchanidle $nick $chan] &gt; 10} {lappend status "idle"}<br>        set host [getchanhost $nick $chan]<br>        set handle [finduser $nick!$host]<br>        set host [webify $host]<br>        if {[onchansplit $nick $chan]} {<br>          lappend status "&lt;STRONG&gt;split&lt;/STRONG&gt;"<br>          #incr len2 [string length "&lt;STRONG&gt;&lt;/STRONG&gt;"]<br>          incr len2 17<br>        }<br>        if {![info exists status]} {<br>          set status "-"<br>        } else {<br>          set status [join $status ", "]<br>        }<br>        set url [urlstrip [getuser $handle XTRA url]]<br>        set info [getuser $handle INFO]<br>        set comment [getuser $handle COMMENT]<br>        set email [getuser $handle XTRA email]<br>        if {$url == "" &amp;&amp; [string range $comment 0 6] == "http://"} {<br>          set url [urlstrip $comment]<br>        }<br>        if {$url == "" &amp;&amp; [string range $info 0 6] == "http://"} {<br>          set url [urlstrip $info]<br>        }<br>        if {$url == "" &amp;&amp; $email != "" &amp;&amp; [string match *@*.* $email]} {<br>          set url [urlstrip mailto:$email]<br>        }<br>        incr len1 [string length [webify $nick]]<br>        incr len1 -[string length $nick]<br>        if {[string tolower $nick] == [string tolower $botnick]} {<br>          set host "&lt;EM&gt;&lt;- it's me, the channel bot!&lt;/EM&gt;"<br>          set info ""<br>        } elseif {[matchattr $handle b]} {<br>          set host "&lt;EM&gt;&lt;- it's another channel bot&lt;/EM&gt;"<br>          set info ""<br>        }<br>        if {$url != ""} {<br>          incr len1 [string length "&lt;A HREF=\"$url\"&gt;&lt;/A&gt;"]<br>          puts $fd1 "        &lt;TD&gt;&lt;A HREF=\"$url\"&gt;[webify $nick]&lt;/A&gt;&lt;/TD&gt;"<br>          puts $fd2 "      [format %-${len1}s &lt;A\ HREF=\"$url\"&gt;[webify $nick]&lt;/A&gt;] [format %-${len2}s $status] $host"<br>        } else {<br>          puts $fd1 "        &lt;TD&gt;[webify $nick]&lt;/TD&gt;"<br>          puts $fd2 "      [format %-${len1}s [webify $nick]] [format %-${len2}s $status] $host"<br>        }<br>        puts $fd1 "        &lt;TD&gt;$status&lt;/TD&gt;"<br>        puts $fd1 "        &lt;TD&gt;$host&lt;/TD&gt;"<br>        puts $fd1 "      &lt;/TR&gt;"<br>        if {$info != ""} {<br>          puts $fd1 "      &lt;TR ALIGN=\"LEFT\" VALIGN=\"TOP\"&gt;"<br>          puts $fd1 "        &lt;TD&gt;&lt;/TD&gt;&lt;TD COLSPAN=\"2\"&gt;&lt;STRONG&gt;Info&lt;/STRONG&gt;: [convstyle [webify $info]]&lt;/TD&gt;"<br>          puts $fd1 "      &lt;/TR&gt;"<br>          puts $fd2 "                &lt;STRONG&gt;Info:&lt;/STRONG&gt; [convstyle [webify $info]]"<br>        }<br>        unset len1 len2 status info url host comment email<br>      }<br>      puts $fd1 "    &lt;/TABLE&gt;"<br>      puts $fd2 "    &lt;/PRE&gt;"<br>    }<br>    puts $fd1 "    &lt;HR&gt;"<br>    puts $fd1 "    This page is automatically refreshed every [webify $web_update] minute(s).&lt;BR&gt;"<br>    puts $fd1 "    &lt;ADDRESS&gt;Created by quesedilla v5 via &lt;A HREF=\"<a href="http://www.eggheads.org/%5C%22%3Eeggdrop%3C/A%3E.%3C/ADDRESS" class="postlink">http://www.eggheads.org/\"&gt;eggdrop&lt;/A&gt;.&lt;/ADDRESS</a>&gt;"<br>    puts $fd1 "  &lt;/BODY&gt;"<br>    puts $fd1 "&lt;/HTML&gt;"<br>    puts $fd1 ""<br>    puts $fd2 "    &lt;HR&gt;"<br>    puts $fd2 "    This page is automatically refreshed every [webify $web_update] minute(s).&lt;BR&gt;"<br>    puts $fd2 "    &lt;ADDRESS&gt;Created by quesedilla v5 via &lt;A HREF=\"<a href="http://www.eggheads.org/%5C%22%3Eeggdrop%3C/A%3E.%3C/ADDRESS" class="postlink">http://www.eggheads.org/\"&gt;eggdrop&lt;/A&gt;.&lt;/ADDRESS</a>&gt;"<br>    puts $fd2 "  &lt;/BODY&gt;"<br>    puts $fd2 "&lt;/HTML&gt;"<br>    puts $fd2 ""<br>    close $fd1<br>    close $fd2<br>    if {$file1 != ""} {exec /bin/mv $dir$file1~new $dir$file1}<br>    if {$file2 != ""} {exec /bin/mv $dir$file2~new $dir$file2}<br>    unset nick file1 file2 dir fd1 fd2<br>  }<br><br>  set web_timerid [timer $web_update do_ques]<br>}<br><br>#if {[info exists web_timerid]} {<br>#  killtimer $web_timerid<br>#  unset web_timerid<br>#}<br>if {![info exists web_timerid] &amp;&amp; $web_update &gt; 0} {<br>  set web_timerid [timer $web_update do_ques]<br>}<br>#do_ques<br><br>foreach chan [array names web_file] {<br>  if {[string first ":" $web_file($chan)] != -1} {<br>    lappend channels "$chan"<br>  } else {<br>    lappend channels "$chan (no lynx)"<br>  }<br>}<br><br>if {![info exists channels]} {<br>  putlog "Quesedilla v5 final loaded (no channels)"<br>} else {<br>  putlog "Quesedilla v5 final loaded: [join $channels ,\ ]"<br>  unset channels<br>}<br><br>if {![info exists timezone]} {<br>  set timezone [clock format 0 -format %Z]<br>}<p>Statistics: Posted by Guest — Sun Aug 22, 2004 7:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]Kami[]]></name></author>
		<updated>2004-08-21T20:56:07-04:00</updated>

		<published>2004-08-21T20:56:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39984#p39984</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39984#p39984"/>
		<title type="html"><![CDATA[ques5.tcl help with extra code pls]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39984#p39984"><![CDATA[
If would be nice if you would paste code here <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3559">]Kami[</a> — Sat Aug 21, 2004 8:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-08-21T17:30:09-04:00</updated>

		<published>2004-08-21T17:30:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39973#p39973</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39973#p39973"/>
		<title type="html"><![CDATA[ques5.tcl help with extra code pls]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39973#p39973"><![CDATA[
Hi<br><br>I have ques5.tcl and it works great, but would like to add extra code to make it list Names as well as the nick, status, user@host.<br><br>I can code in a line to make the name box for the webpage, but that is the extent of my coding skills.<br><br>If anyone can help it would be appreciated.<br><br>Pete.<p>Statistics: Posted by Guest — Sat Aug 21, 2004 5:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
