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

	<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-03-05T04:03:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-05T04:03:13-04:00</updated>

		<published>2004-03-05T04:03:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34261#p34261</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34261#p34261"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34261#p34261"><![CDATA[
<blockquote class="uncited"><div>this part:<div class="codebox"><p>Code: </p><pre><code>$fXML = file_get_contents(</code></pre></div>gives an error:<br><div class="codebox"><p>Code: </p><pre><code>Fatal error: Call to undefined function: file_get_contents() in /var/www/html/xml/users.php on line 10</code></pre></div>Just to mention it. Not TCL related at all<br><br>gr.<br><br>Chrizz</div></blockquote>Then you're running on a seriously outdated version of PHP.<br>See <a href="http://www.php.net/file_get_contents" class="postlink">http://www.php.net/file_get_contents</a> - it's implemented since PHP 4.3.0<br><br>An alternative (if you do not want to or cannot update) would be;<br><div class="codebox"><p>Code: </p><pre><code>&lt;? // Error handling error_reporting(E_ALL); // Handler require('IRCChannelInfo.inc.php'); // Get XML $fXML = fopen('myfile.xml', 'r');$sXML = fread($fXML, filesize('myfile.xml'));fclose($fXML);// Create object $IRC = new IRCChannelInfo($sXML); var_dump($IRC); ?&gt;</code></pre></div>- Fahr<p>Statistics: Posted by Guest — Fri Mar 05, 2004 4:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cvanmeer]]></name></author>
		<updated>2004-03-05T03:57:33-04:00</updated>

		<published>2004-03-05T03:57:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34260#p34260</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34260#p34260"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34260#p34260"><![CDATA[
this part:<div class="codebox"><p>Code: </p><pre><code>$fXML = file_get_contents(</code></pre></div>gives an error:<br><div class="codebox"><p>Code: </p><pre><code>Fatal error: Call to undefined function: file_get_contents() in /var/www/html/xml/users.php on line 10</code></pre></div>Just to mention it. Not TCL related at all<br><br>gr.<br><br>Chrizz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4215">cvanmeer</a> — Fri Mar 05, 2004 3:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-04T17:45:35-04:00</updated>

		<published>2004-03-04T17:45:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34249#p34249</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34249#p34249"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34249#p34249"><![CDATA[
<blockquote class="uncited"><div>Dear fahr,<br><br>Can I see online example of this script?</div></blockquote>Sure you can.<br><br>Here is the direct output: <a href="http://www.lycantrope.com/~ircbots/" class="postlink">http://www.lycantrope.com/~ircbots/</a><br>The xml file therein is the file generated by the TCL script, it changes every minute. This channel is VERY low traffic, so don't expect to see any user there anytime soon.<br>The IRCChannelInfo.inc.php is the file I linked the source of.<br>The users.php contains only the following:<div class="codebox"><p>Code: </p><pre><code>&lt;?// Error handlingerror_reporting(E_ALL);// Handlerrequire('IRCChannelInfo.inc.php');// Get XML$fXML = file_get_contents('http://www.lycantrope.com/~ircbots/eqrus.xml');// Create object$IRC = new IRCChannelInfo($fXML);var_dump($IRC);?&gt;</code></pre></div>Basically, this will give you a var_dump of the object generated from XML.<br><br>To see it working in practise, you'll have the visit the actual site hosting the chat, but it's in Russian.<br>Anyways, here's the link to the chat login: <a href="http://www.imagesofher.com/EQrus/chat.php" class="postlink">http://www.imagesofher.com/EQrus/chat.php</a><br>There, after the italic text (Пользователи онлайн) it will list the online users (with @ or + if they're opped or voiced), or njet (нет) if there's none.<br><br>On the forum (<a href="http://www.imagesofher.com/EQrus/forum" class="postlink">http://www.imagesofher.com/EQrus/forum</a>) it somewhere lists chat (Чат), below it, it lists the usercount.<br><br>That's all the practise examples I can give <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>- Fahr<p>Statistics: Posted by Guest — Thu Mar 04, 2004 5:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blood_x]]></name></author>
		<updated>2004-03-04T12:41:36-04:00</updated>

		<published>2004-03-04T12:41:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34243#p34243</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34243#p34243"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34243#p34243"><![CDATA[
Dear fahr,<br><br>Can I see online example of this script?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=402">blood_x</a> — Thu Mar 04, 2004 12:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-03T12:46:30-04:00</updated>

		<published>2004-03-03T12:46:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34205#p34205</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34205#p34205"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34205#p34205"><![CDATA[
For those interested, the PHP source is available here:<br><br><a href="http://dump.lycantrope.com/IRCChannelInfo.phps" class="postlink">http://dump.lycantrope.com/IRCChannelInfo.phps</a><br><br>Feel free to modify it into whatever, but please send me back a copy (to Fahr at -[IDONTLIKESPAM]- lycantrope -[IMEANIT]- dot com).<br><br>I'll post the final version of the TCL script here (I made some minor adjustments).<br><br>Once more, thanks to everyone! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code># Channel to export to xmlset chanxml(channel) "#EQrus"# Export file nameset chanxml(filename) "../WWW/eqrus.xml"# Set initial timerif {![info exists chanxml(timer)]} {  set chanxml(timer) [timer 1 chanxml_timer]}proc chanxml_timer {args} {  global chanxml  # Reset timer  set chanxml(timer) [timer 1 chanxml_timer]  # Write file  set fp [open $chanxml(filename) w]  puts $fp "&lt;?xml version=\"1.0\"?&gt;"  puts $fp "&lt;!-- $chanxml(channel) channel user statistics --&gt;"  puts $fp "&lt;channel_list&gt;"  puts $fp "  &lt;time&gt;[unixtime]&lt;/time&gt;"  puts $fp "  &lt;channel&gt;"  puts $fp "    &lt;name&gt;$chanxml(channel)&lt;/name&gt;"  puts $fp "    &lt;topic&gt;[topic $chanxml(channel)]&lt;/topic&gt;"  puts $fp "    &lt;chanmode&gt;[getchanmode $chanxml(channel)]&lt;/chanmode&gt;"  # Loop users  foreach nick [chanlist $chanxml(channel)] {    # Skip bot's nick    if {[isbotnick $nick]} { continue }    puts $fp "    &lt;user&gt;"    puts $fp "      &lt;nick&gt;$nick&lt;/nick&gt;"    puts $fp "      &lt;uhost&gt;[getchanhost $nick]&lt;/uhost&gt;"    puts $fp "      &lt;jointime&gt;[getchanjoin $nick $chanxml(channel)]&lt;/jointime&gt;"    puts $fp "      &lt;idletime&gt;[getchanidle $nick $chanxml(channel)]&lt;/idletime&gt;"    # Get channel mode for user    set mode ""    if {[isvoice $nick $chanxml(channel)]} { append mode "v" }    if {[isop $nick $chanxml(channel)]} { append mode "o" }    puts $fp "      &lt;mode&gt;$mode&lt;/mode&gt;"    # Done with this user    puts $fp "    &lt;/user&gt;"  }  # Finish file  puts $fp "  &lt;/channel&gt;"  puts $fp "&lt;/channel_list&gt;"  close $fp}</code></pre></div>- Fahr<p>Statistics: Posted by Guest — Wed Mar 03, 2004 12:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-02T14:09:24-04:00</updated>

		<published>2004-03-02T14:09:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34159#p34159</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34159#p34159"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34159#p34159"><![CDATA[
I figured it out already, using [unixtime] <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>I still decided to run the script every minute and I added some comments and the unixtime. Plus, stdragon forgot a &gt; after &lt;/chanmode.<br><br>Here is my altered script, maybe someone else can use it as well <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>proc chanxml_timer {args} {  global chanxml  # Reset timer  set chanxml(timer) [timer 1 chanxml_timer]  # Write file  set fp [open $chanxml(filename) w]  puts $fp "&lt;?xml version=\"1.0\"?&gt;"  puts $fp "&lt;!-- $chanxml(channel) channel user statistics --&gt;"  puts $fp "&lt;channel_list time=\"[unixtime]\"&gt;"  puts $fp "  &lt;channel&gt;"  puts $fp "    &lt;name&gt;$chanxml(channel)&lt;/name&gt;"  puts $fp "    &lt;topic&gt;[topic $chanxml(channel)]&lt;/topic&gt;"  puts $fp "    &lt;chanmode&gt;[getchanmode $chanxml(channel)]&lt;/chanmode&gt;"  # Loop users  foreach nick [chanlist $chanxml(channel)] {    # Skip bot's nick    if {[isbotnick $nick]} { continue }    puts $fp "    &lt;user&gt;"    puts $fp "      &lt;nick&gt;$nick&lt;/nick&gt;"    puts $fp "      &lt;uhost&gt;[getchanhost $nick]&lt;/uhost&gt;"    puts $fp "      &lt;jointime&gt;[getchanjoin $nick $chanxml(channel)]&lt;/jointime&gt;"    puts $fp "      &lt;idletime&gt;[getchanidle $nick $chanxml(channel)]&lt;/idletime&gt;"    # Get channel mode for user    set mode ""    if {[isvoice $nick $chanxml(channel)]} { append mode "v" }    if {[isop $nick $chanxml(channel)]} { append mode "o" }    puts $fp "      &lt;mode&gt;$mode&lt;/mode&gt;"    # Done with this user    puts $fp "    &lt;/user&gt;"  }  # Finish file  puts $fp "  &lt;/channel&gt;"  puts $fp "&lt;/channel_list&gt;"  close $fp}</code></pre></div>Thanks for all the help, especially to stdragon. All that remains now is building a PHP parser for this particular XML file. I'll share it here as soon as it's finished <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>- Fahr[/code]<p>Statistics: Posted by Guest — Tue Mar 02, 2004 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-03-02T14:05:09-04:00</updated>

		<published>2004-03-02T14:05:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34158#p34158</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34158#p34158"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34158#p34158"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set now unixtime</code></pre></div></div></blockquote>Uh... yea... if he wanted the word "unixtime" ....<br><br>Should be:<div class="codebox"><p>Code: </p><pre><code>set now [unixtime]</code></pre></div>Or more Tcl-friendly would be to use the clock command:<div class="codebox"><p>Code: </p><pre><code>set now [clock seconds]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Mar 02, 2004 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2004-03-02T13:40:37-04:00</updated>

		<published>2004-03-02T13:40:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34153#p34153</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34153#p34153"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34153#p34153"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set now unixtime</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Mar 02, 2004 1:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-02T13:19:17-04:00</updated>

		<published>2004-03-02T13:19:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34152#p34152</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34152#p34152"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34152#p34152"><![CDATA[
That's excellent, thanks a lot <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I'll give it a try and let you know if it works! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>One more thing; is there any way to get the current time in UNIX timestamp format?<br><br>Thanks,<br>- Fahr<p>Statistics: Posted by Guest — Tue Mar 02, 2004 1:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-03-01T18:43:18-04:00</updated>

		<published>2004-03-01T18:43:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34139#p34139</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34139#p34139"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34139#p34139"><![CDATA[
Not tested, but probably works...<br><div class="codebox"><p>Code: </p><pre><code># Channel to export to xmlset chanxml(channel) "#sheep"# Export file nameset chanxml(filename) "sheep.xml"if {![info exists chanxml(timer)]} {  set chanxml(timer) [timer 5 chanxml_timer]}proc chanxml_timer {args} {  global chanxml  set chanxml(timer) [timer 5 chanxml_timer]  set fp [open $chanxml(filename) w]  puts $fp "&lt;?xml version=\"1.0\"?&gt;"  # Add dtd and all that here if you want  puts $fp "&lt;!-- Generated by stdragon's cool script --&gt;"  puts $fp "&lt;channel_list&gt;"  puts $fp "  &lt;channel&gt;"  puts $fp "    &lt;name&gt;$chanxml(channel)&lt;/name&gt;"  puts $fp "    &lt;topic&gt;[topic $chanxml(channel)]&lt;/topic&gt;"  puts $fp "    &lt;chanmode&gt;[getchanmode $chanxml(channel)]&lt;/chanmode"  foreach nick [chanlist $chanxml(channel)] {    # Skip bot's nick    if {[isbotnick $nick]} { continue }    puts $fp "    &lt;user&gt;"    puts $fp "      &lt;nick&gt;$nick&lt;/nick&gt;"    puts $fp "      &lt;uhost&gt;[getchanhost $nick]&lt;/uhost&gt;"    puts $fp "      &lt;jointime&gt;[getchanjoin $nick $chanxml(channel)]&lt;/jointime&gt;"    puts $fp "      &lt;idletime&gt;[getchanidle $nick $chanxml(channel)]&lt;/idletime&gt;"    # Get channel mode for user    set mode ""    if {[isvoice $nick $chanxml(channel)]} { append mode "v" }    if {[isop $nick $chanxml(channel)]} { append mode "o" }    puts $fp "      &lt;mode&gt;$mode&lt;/mode&gt;"    # Done with this user    puts $fp "    &lt;/user&gt;"  }  puts $fp "  &lt;/channel&gt;"  puts $fp "&lt;/channel_list&gt;"  close $fp}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon Mar 01, 2004 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-03-01T17:07:23-04:00</updated>

		<published>2004-03-01T17:07:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34138#p34138</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34138#p34138"/>
		<title type="html"><![CDATA[Write out userlist on a specific channel every x minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34138#p34138"><![CDATA[
Hello all,<br><br>first of all, I am a complete newbie when it comes to TCL scripting, so please endure my idiocy. I should pick up quickly, though, seeing how I am a programmer by profession.<br><br>Second, I searched the forums and found some things remotely connected to what I want, but I wasn't able to pour them into one working solution. If I missed something, I'm sorry to needlessly bother you all.<br><br>That being said, here's the actual question;<br><br>I am looking for a way to write a list of users in a specific IRC channel to a file, say, every 5 minutes. I should not be a command or trigger, just every 5 minutes it should check all the users in the channel and write their names to a flatfile, one username per line.<br>I can deal with any overhead data, filter it out in the after processing.<br>Ideally, the list would not contain the nick of the bot itself. The most utopic situation would be if it were to export the list of nicks to XML format, but I guess that's going to by quite impossibe.<br><br>Anyways, any help is appreciated, I can work with a list containing all users (and botnick) + overhead data just as well.<br><br>Thanks a lot,<br>- Fahr<p>Statistics: Posted by Guest — Mon Mar 01, 2004 5:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
