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

	<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>2010-01-12T18:17:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2010-01-12T18:17:12-04:00</updated>

		<published>2010-01-12T18:17:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91667#p91667</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91667#p91667"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91667#p91667"><![CDATA[
Yes indeed, my bad <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> Updated my post above.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Jan 12, 2010 6:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-01-12T18:06:30-04:00</updated>

		<published>2010-01-12T18:06:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91666#p91666</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91666#p91666"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91666#p91666"><![CDATA[
The main logic problem, is that you test if the time is within the desired range (correct) and if mode i is set (incorrect).<br><br>If i is not set, the logics will always evaluate to false, and the channel will be set +i. As such, you'll still end up adding and removing the i mode every other minute.<br><br>Solution would be to nest the mode check, rather than AND it to the time-check:<div class="codebox"><p>Code: </p><pre><code>if {validtime} {  if {channel-is+i} {    pushmode #channel -i  }} else {  if {!channel-is+i} {    pushmode #channel +i  }}</code></pre></div>Sorry for the psuedo-code, just got home from a long drive and can't be arsed to write too much code at once :p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jan 12, 2010 6:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-09T17:37:53-04:00</updated>

		<published>2010-01-09T17:37:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91641#p91641</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91641#p91641"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91641#p91641"><![CDATA[
Sir_Fz's code above slightly altered can do this. Also made it easier for you to set the channel and durations.<div class="codebox"><p>Code: </p><pre><code># channelvariable lockchan "#mychannel"# durationsvariable lockstart 20variable lockend 23# changed the time bind to do this _AT_ the start# of every hour, since we base this on hours, and# not to run the proc every minute needlessly# checking when to change modes...bind time - "00 *" lock:chanproc lock:chan {min hour args} {   global lockchan   if {![botisop $lockchan]} return   set hr [scan $hour %d]   # stole this from nml375  this allows wrapping of start/end hours.   if {($hour &gt;= $::lockstart &amp;&amp; $hour &lt; $::lockend || \      ($hour &gt;= $::lockstart || $hour &lt; $::lockend) &amp;&amp; \      $::lockstart &gt; $::lockend) &amp;&amp; [string match "*i*" [getchanmode #channel]]} {      channel set $lockchan chanmode -i   } else {      channel set $lockchan chanmode +i   }}</code></pre></div>You simply channel set (chanset) the #channel's chanmode settings to keep this from happening. This also keeps other ops from changing this schedule making the bot enforce these modes during these time periods.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Jan 09, 2010 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[.pt]]></name></author>
		<updated>2010-01-09T17:11:18-04:00</updated>

		<published>2010-01-09T17:11:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91640#p91640</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91640#p91640"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91640#p91640"><![CDATA[
ty u, but it keeps spamming +i and -i during that time, i tried to fix it but with no luck<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6989">.pt</a> — Sat Jan 09, 2010 5:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2010-01-12T18:15:46-04:00</updated>

		<published>2009-12-30T19:42:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91497#p91497</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91497#p91497"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91497#p91497"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind time - * lock:chanproc lock:chan {min hour args} { if {![botisop #channel]} return set hr [scan $hour %d] if {$hr &gt;= 20 &amp;&amp; $hr &lt;= 23} {  if {[string match "*i*" [getchanmode #channel]]} {   pushmode #channel -i  } } elseif {![string match "*i*" [getchanmode #channel]]} {  pushmode #channel +i }}</code></pre></div>Edit1: Replace #channel with your channel's name.<br><br>Edit2: It seems someone modified my post (moderators? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_exclaim.gif" width="15" height="15" alt=":!:" title="Exclamation"> uncool); fixed it.<br><br>Edit3: Updated the code to avoid +/-i spamming.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 30, 2009 7:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[.pt]]></name></author>
		<updated>2009-12-29T10:50:43-04:00</updated>

		<published>2009-12-29T10:50:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91479#p91479</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91479#p91479"/>
		<title type="html"><![CDATA[auto +i]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91479#p91479"><![CDATA[
can someome make a script that will put a especific channel +i during a especific hour of the day, for example lock the channel all day except from 20:00 to 00:00<br><br><br>ty in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6989">.pt</a> — Tue Dec 29, 2009 10:50 am</p><hr />
]]></content>
	</entry>
	</feed>
