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

	<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>2009-08-04T15:56:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rabanne]]></name></author>
		<updated>2009-08-04T15:56:20-04:00</updated>

		<published>2009-08-04T15:56:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89748#p89748</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89748#p89748"/>
		<title type="html"><![CDATA[Webchat.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89748#p89748"><![CDATA[
You are number one ! <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=10784">rabanne</a> — Tue Aug 04, 2009 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2009-08-04T13:46:55-04:00</updated>

		<published>2009-08-04T13:46:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89745#p89745</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89745#p89745"/>
		<title type="html"><![CDATA[Webchat.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89745#p89745"><![CDATA[
try:<div class="codebox"><p>Code: </p><pre><code># channelset irc_chan "#channel"# html fileset channel_file "/home/www/chat.html"# max lines numberset output_lines 20##################################################33bind pubm -|- "*" log_channelif {![file exists $channel_file]} {set create_new [open $channel_file w]close $create_new}proc log_channel { nick uhost hand chan text } {global irc_chan channel_file output_linesif {$irc_chan != $chan} {return}set log_time [clock format [clock seconds] -format "%H:%M:%S"] set log_date [clock format [clock seconds] -format "%d %B %Y"] set log_line "&lt;b&gt;($log_date) ($log_time) ($nick) ($text)&lt;/b&gt;&lt;br&gt;"set read_current [open $channel_file r]set get_all [split [read $read_current] "\n"]close $read_currentlappend get_all $log_lineset get_all [lrange $get_all end-$output_lines end]set line_idx 1set rewrite [open $channel_file w]foreach each_line $get_all {if {$each_line != ""} {regsub {^[0-9]+\. } $each_line "" each_lineputs $rewrite "$line_idx\. $each_line"incr line_idx 1}}close $rewrite}putlog "html-chan-log.tcl"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue Aug 04, 2009 1:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rabanne]]></name></author>
		<updated>2009-08-04T11:30:44-04:00</updated>

		<published>2009-08-04T11:30:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89744#p89744</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89744#p89744"/>
		<title type="html"><![CDATA[Webchat.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89744#p89744"><![CDATA[
Ten q ;&gt;<br>Working Perfectly<br><br>...And if you want the last 30 lines should be<br><br>set last_lines [join [lrange [split [read $filehand] "\n"] end-<strong class="text-strong">28</strong> end] "\n"] ?<br><br>for 40 <br><br>set last_lines [join [lrange [split [read $filehand] "\n"] end-<strong class="text-strong">38</strong> end] "\n"] .... etc<br><br><br>How can I make a site to see the numbers of rows? etc:<br>1. (date) (time) (nick) (text)<br>2. (date) (time) (nick) (text)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10784">rabanne</a> — Tue Aug 04, 2009 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2009-08-04T04:49:35-04:00</updated>

		<published>2009-08-04T04:49:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89740#p89740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89740#p89740"/>
		<title type="html"><![CDATA[Webchat.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89740#p89740"><![CDATA[
try:<br><div class="codebox"><p>Code: </p><pre><code>set chat_setting(chan) "#kupa" set chat_setting(file) "/home/www/chat.html" set chat_setting(temp) "/home/www/chat.tmp" if {![file exists $chat_setting(file)]} { set filehand [open $chat_setting(file) w] puts -nonewline $filehand "" close $filehand } bind pubm - * chat_update proc chat_update {nick uhost hand chan text} { global chat_setting if {![string match "* [string tolower $chan ]*" "l [string tolower $chat_setting(chan)] l"]} { return 0 } set time [clock format [clock seconds] -format "(%H:%M:%S\)"] set date [clock format [clock seconds] -format {%d %B %Y}] set text_nick "($nick)" set text_form "&lt;b&gt;($date) $time text_nick&lt;/b&gt; $text&lt;BR&gt;" chat_file $text_form return 0 } proc chat_file {text} { global chat_setting set filehand [open $chat_setting(file) r] set filehandtemp [open $chat_setting(temp) w] #set linenum 0 #while {![eof $filehand]} { #set line [gets $filehand] #set lines [incr linenum] #puts $filehandtemp "$line" #} set last_lines [join [lrange [split [read $filehand] "\n"] end-18 end] "\n"]puts $filehandtemp $last_linesputs -nonewline $filehandtemp "$text" close $filehand close $filehandtemp file rename -force $chat_setting(temp) $chat_setting(file) } putlog "Инсталиран: WebChat.tcl"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue Aug 04, 2009 4:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rabanne]]></name></author>
		<updated>2009-08-04T11:29:02-04:00</updated>

		<published>2009-08-03T23:58:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89739#p89739</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89739#p89739"/>
		<title type="html"><![CDATA[Webchat.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89739#p89739"><![CDATA[
Hello. Can I do this TCL to show only the lastest 20 lines that are written in the channel?<br><div class="codebox"><p>Code: </p><pre><code>set chat_setting(chan) "#Channel"set chat_setting(file) "/home/ircd/www/radio/chat.html"set chat_setting(temp) "/home/ircd/www/radio/chat.tmp"if {![file exists $chat_setting(file)]} {set filehand [open $chat_setting(file) w]puts -nonewline $filehand ""close $filehand}bind pubm - * chat_updateproc chat_update {nick uhost hand chan text} {global chat_settingif {![string match "* [string tolower $chan ]*" "l [string tolower $chat_setting(chan)] l"]} {return 0}set time [clock format [clock seconds] -format "(%H:%M:%S\)"]set date [clock format [clock seconds] -format {%d %B %Y}]set text_nick "($nick)"set text_form "&lt;b&gt;($date) $time text_nick&lt;/b&gt; $text&lt;BR&gt;"chat_file $text_formreturn 0}proc chat_file {text} {global chat_settingset filehand [open $chat_setting(file) r]set filehandtemp [open $chat_setting(temp) w]set linenum 0while {![eof $filehand]} {set line [gets $filehand]set lines [incr linenum]puts $filehandtemp "$line"}puts -nonewline $filehandtemp "$text"close $filehandclose $filehandtempfile rename -force $chat_setting(temp) $chat_setting(file)}putlog "Инсталиран: WebChat.tcl"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10784">rabanne</a> — Mon Aug 03, 2009 11:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
