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

	<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>2014-05-29T13:45:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[psybertech]]></name></author>
		<updated>2014-05-29T13:45:17-04:00</updated>

		<published>2014-05-29T13:45:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102869#p102869</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102869#p102869"/>
		<title type="html"><![CDATA[Help scripting a commands reply to text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102869#p102869"><![CDATA[
Caesar,<br><br>Thanks, but I am actually doing that. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Using is_readable... if it is, PHP does its thing, otherwise it spits out a message that the list is currently being updated and to please refresh the page.<br><br>It is a tiny room with very little users so I don't expect it to happen often and by the time a user reads the message, the bot's work should be done and all is right with the world.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> <br><br>Good call and thanks!<br><br>Oh and additionally I am sorting the list of users (case insensitive) to make the view a little nicer. I don't care about ops or voice, I just wanted a simple csv'd list of users in the room with a little matching on known nicks to make some users stand out like the site admin, mods and me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> <br><br>cheers!<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12395">psybertech</a> — Thu May 29, 2014 1:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-05-29T13:03:40-04:00</updated>

		<published>2014-05-29T13:03:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102867#p102867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102867#p102867"/>
		<title type="html"><![CDATA[Help scripting a commands reply to text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102867#p102867"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind cron - * chanlist:writeproc chanlist:write {minute hour day month weekday} {set file "who.#channel"if {[file readable $file]} {set fh [open $file w]puts $fh [lreplace [chanlist #channel] 0 0]close $fh}}</code></pre></div>Since there's the possibility to have PHP and the bot open the same file at the same time I think it's a good idea to check if the file is readable (meaning it's not used by some other process in the system). Also, you can trim the list of members directly from the TCL proc with <em class="text-italics">lreplace</em>.<br><br>PS: Replace #channel to match the actual channel name.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu May 29, 2014 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[psybertech]]></name></author>
		<updated>2014-05-29T09:30:13-04:00</updated>

		<published>2014-05-29T09:30:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102865#p102865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102865#p102865"/>
		<title type="html"><![CDATA[Help scripting a commands reply to text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102865#p102865"><![CDATA[
Madalin,<br><br>Thank you very much!  It worked like a champ! So simple and elegant. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>I need to brush up on tcl, that's for sure. <br><br>I modified the file path to make it accessible to my webserver and then used fgets and a little logic to parse out how many people and to exclude my bot and spit out a friendly message with the user count and people in the room.<br>Looks and works fantastic!<br><br>Thanks again!<br><br>There is no thank or like system here, but if there was, points to you!<br><br>cheers!<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12395">psybertech</a> — Thu May 29, 2014 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2014-05-29T06:06:24-04:00</updated>

		<published>2014-05-29T06:06:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102862#p102862</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102862#p102862"/>
		<title type="html"><![CDATA[Help scripting a commands reply to text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102862#p102862"><![CDATA[
It will create a filename who.#channel-name in the main director with all the names from the channel (it will refresh the list every 1 minute)<br><br><br><div class="codebox"><p>Code: </p><pre><code>bind time - * create:fileset what(chan) "#tcl"set what(file) "who.$what(chan)"proc create:file {min hour day month year} {global whatset fo [open $what(file) w]foreach nick [chanlist $what(chan)] { puts $fo $nick }close $fo}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Thu May 29, 2014 6:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[psybertech]]></name></author>
		<updated>2014-05-28T18:26:42-04:00</updated>

		<published>2014-05-28T18:26:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102859#p102859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102859#p102859"/>
		<title type="html"><![CDATA[Help scripting a commands reply to text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102859#p102859"><![CDATA[
Hi there.<br><br>I am very new to eggdrop but I have my bot working well.<br><br>I am running a web based client on my forums for users to login to the IRC room so they don't need to know anything about IRC.<br><br>However, since it is not part of the forums it is not integrated.<br><br>I would like to see if there is a way for the eggdrop to perform a /who on a channel (or any command to accomplish this) that will then output the results to a file that I can then use PHP read the file and show people if anyone is in the room so they don't need to pop in just to see if anyone is there.<br><br>I tried a .who #channel in the partyline and it doesn't appear to work.<br><br>In my head, I would like to have a small script that every 2 minutes checks the channel and outputs who is in there and writes (overwrites) a static file. I think putlog would work if I can overwrite the same log file each time.<br><br>Is this possible with an eggdrop or will I need to find another way to do this on my server (a client that I can maybe cron a command piped to a file).<br><br>My goal is simply to let people know if anyone is online or not. Seems simple enough. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Any thoughts on this would be great.<br><br>cheers and thanks in advance!<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12395">psybertech</a> — Wed May 28, 2014 6:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
