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

	<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-09-22T17:02:27-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-09-22T17:02:27-04:00</updated>

		<published>2009-09-22T17:02:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90317#p90317</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90317#p90317"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90317#p90317"><![CDATA[
<blockquote class="uncited"><div>Thanks, I am actually looking for activity by users, not the channel in general. but I should be able to adapt this.</div></blockquote><blockquote class="uncited"><div>getchanidle &lt;nickname&gt; &lt;channel&gt;<br><br>    Returns: number of minutes that person has been idle; 0 if the specified user isn't on the channel<br><br>    Module: irc</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Tue Sep 22, 2009 5:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[asim]]></name></author>
		<updated>2009-09-22T13:52:06-04:00</updated>

		<published>2009-09-22T13:52:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90313#p90313</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90313#p90313"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90313#p90313"><![CDATA[
Thanks, I am actually looking for activity by users, not the channel in general. but I should be able to adapt this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10873">asim</a> — Tue Sep 22, 2009 1:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-22T07:46:47-04:00</updated>

		<published>2009-09-22T07:46:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90309#p90309</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90309#p90309"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90309#p90309"><![CDATA[
Limited testing done, but seems OK<br><div class="codebox"><p>Code: </p><pre><code># logs a timestamp for the last channel event in all the bots channels# an event is normal channel chat, channel notice or onotice, channel action# calling 'pActivityReturn #channelname' will return 0 (inactive) or 1 (active)# according to the preconfigured time limit# example# if {[pActivityReturn #botchannel]} {#     code here# }# set here a time limit in seconds# if the last channel event occurred within this time limit, the channel is deemed activeset vActivityTime 3600bind CTCP - ACTION pActivityCtcpbind NOTC - * pActivityNotcbind PUBM - * pActivityPubmproc pActivityCtcp {nick uhost hand dest keyword text} {    global vActivityCurrent    set channel [string tolower $dest]    set vActivityCurrent($channel) [unixtime]    return 0}proc pActivityNotc {nick uhost hand text dest} {    global vActivityCurrent    if {[regexp -- {^#} [string trimleft $dest @]]} {        set channel [string tolower [string trimleft $dest @]]        set vActivityCurrent($channel) [unixtime]    }    return 0}proc pActivityPubm {nick uhost hand chan text} {    global vActivityCurrent    set channel [string tolower $chan]    set vActivityCurrent($channel) [unixtime]    return 0}proc pActivityReturn {chan} {    global vActivityCurrent vActivityTime    set channel [string tolower $chan]    if {[info exists vActivityCurrent($channel)]} {        set now [unixtime]        set elapsed [expr {$now - $vActivityCurrent($channel)}]        if {$elapsed &lt;= $vActivityTime} {            return 1        }    }    return 0}# eof</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Sep 22, 2009 7:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[asim]]></name></author>
		<updated>2009-09-21T17:51:04-04:00</updated>

		<published>2009-09-21T17:51:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90308#p90308</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90308#p90308"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90308#p90308"><![CDATA[
correct any message or action in the channel. just some sign of interaction, although if it makes it easier to just do activity based on chat text that is fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10873">asim</a> — Mon Sep 21, 2009 5:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2009-09-21T17:46:28-04:00</updated>

		<published>2009-09-21T17:46:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90307#p90307</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90307#p90307"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90307#p90307"><![CDATA[
What exactly do you mean by activity? messages in the channel?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Sep 21, 2009 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[asim]]></name></author>
		<updated>2009-09-22T13:52:33-04:00</updated>

		<published>2009-09-21T14:44:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90303#p90303</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90303#p90303"/>
		<title type="html"><![CDATA[[SOLVED] help with check for activity]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90303#p90303"><![CDATA[
Ok, i have a script and I would like to modify it to check for activity in the channel before giving credit.<br><br>Here is the code:<div class="codebox"><p>Code: </p><pre><code>proc out_bonus { min hour day month year} {set sql [mysqlconnect -h HOST -u USERNAME -password PASSWD -db DBNAME ]foreach user [chanlist #TheStash] {if {$user != "velvet" &amp;&amp; $user != "stash" &amp;&amp; $user != "destiny"} {set clock [ clock format [clock seconds] -format {%b. %d, %Y %I:%M:%S %p}] set query [ mysqlquery $sql "UPDATE users SET seedbonus = seedbonus + 0.6 WHERE username=\'$user\'"]}}set user [chanlist #thestash]set clock [ exec sh -c { date  +'%Y-%m-%d %R:%S'} ]set query [ mysqlquery $sql "INSERT DELAYED INTO sitelog \(added, txt\) VALUES\(\'$clock\', \'Added 0.6 Point to $user for irc\'\)" ]mysqlclose $sql}bind time - "?0 * * * *" out_bonus</code></pre></div>Velvet, Stash, Destiny are the name of bots in the channel. I am just not sure the best way to check for activity before awarding the bonus points.<br><br>Thanks in advance for the help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10873">asim</a> — Mon Sep 21, 2009 2:44 pm</p><hr />
]]></content>
	</entry>
	</feed>
