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

	<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>2001-11-25T23:21:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-11-25T23:21:00-04:00</updated>

		<published>2001-11-25T23:21:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2054#p2054</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2054#p2054"/>
		<title type="html"><![CDATA[CPU-draining Proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2054#p2054"><![CDATA[
Try the following<br><blockquote class="uncited"><div>bind time - "0 * * * *" si_logcheck<br>proc si_logcheck {min hour day month year} {<br>  foreach user [userlist L] {<br>    set m "LD"<br>    if {[matchattr $user B]} { set m "D" }<br>    foreach chan [channels] {<br>      if {[handonchan $user $chan]} {<br>        set m "D"<br>        break<br>      }<br>    }<br>    chattr $user "-${m}"<br>  }<br>  return 1<br>}</div></blockquote>There should be no need to unset the variables used, as they are automaticaly destroyed upon leaving the proc.<br><br>Forum has a little bug slennox.<br><br>&lt;font size=-1&gt;[ This Message was edited by: ppslim on 2001-11-25 20:25 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Nov 25, 2001 11:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wcc]]></name></author>
		<updated>2001-11-25T22:21:00-04:00</updated>

		<published>2001-11-25T22:21:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2049#p2049</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2049#p2049"/>
		<title type="html"><![CDATA[CPU-draining Proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2049#p2049"><![CDATA[
Change <div class="codebox"><p>Code: </p><pre><code>if {[handonchan $logged $channel]} { chattr $logged +L}</code></pre></div>to<div class="codebox"><p>Code: </p><pre><code>if {[handonchan $logged $channel]} { chattr $logged +L        break}</code></pre></div>You don't need to continue the loop if that if is true. It won't save a whole lot of CPU, but it should help a little.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=270">Wcc</a> — Sun Nov 25, 2001 10:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ClubCX]]></name></author>
		<updated>2001-11-25T22:07:00-04:00</updated>

		<published>2001-11-25T22:07:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2048#p2048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2048#p2048"/>
		<title type="html"><![CDATA[CPU-draining Proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2048#p2048"><![CDATA[
I'm having a problem with a proc in my script. It's causing the bots to put a strain on the cpu, so I was wondering if there is a way I could phrase it better in order to be kinder to the shell. I have dozens of bots running the script and can't afford for them to be so crude with resources.<br><br><br>bind time - "*0 * * * *" si_logcheck<br><br>proc si_logcheck {min hour day month year} {<br> foreach logged [userlist L] {<br>  chattr $logged -LD<br>  if {[matchattr $logged B]} {<br>  chattr $logged +L<br>  }<br>   foreach channel [channels] {<br>     if {[handonchan $logged $channel]} {<br>       chattr $logged +L<br>      }<br>    }<br>  }<br> unset logged<br> return 1<br>}<br><br><br>Basically, I want to periodically (no less often than every 15 minutes) make sure that no user retains flag L unless they are online. This is a security flag, and should allow time for the user to quit and return.  I'd appreciate any suggestions.<br><br>- Tom<br><a href="http://www.botservice.net" class="postlink">http://www.botservice.net</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=398">ClubCX</a> — Sun Nov 25, 2001 10:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
