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

	<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>2008-06-12T13:36:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[pakistani1]]></name></author>
		<updated>2008-06-12T13:36:00-04:00</updated>

		<published>2008-06-12T13:36:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83497#p83497</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83497#p83497"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83497#p83497"><![CDATA[
the problem persists .. the bot gives the command to deop the idle nick on all the channels the script is turned on..<br>plus it is now not ignoring the idle_exempt_nicks it deopes the nicks present in the idle_exempt_nicks nick list ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6119">pakistani1</a> — Thu Jun 12, 2008 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-09T16:49:14-04:00</updated>

		<published>2008-06-09T16:49:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83466#p83466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83466#p83466"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83466#p83466"><![CDATA[
Try the edited code above, heh. Forgot to globalize those variable calls, in other words used $ instead of $:: ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jun 09, 2008 4:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pakistani1]]></name></author>
		<updated>2008-06-09T13:31:15-04:00</updated>

		<published>2008-06-09T13:31:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83465#p83465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83465#p83465"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83465#p83465"><![CDATA[
thanku for ur help speechles <br>here is the error that i got after i used the above script <br><br>can't read "whois_exempt_nicks": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6119">pakistani1</a> — Mon Jun 09, 2008 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-11T10:29:10-04:00</updated>

		<published>2008-06-09T11:50:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83464#p83464</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83464#p83464"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83464#p83464"><![CDATA[
@Nimos, you are close (we need the foreach, it isn't replaced at all).. but since you can't be correct, why do you even post? To raise your post count?<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -exact [chanlist $channel] $nick] != -1} {</code></pre></div>A simple check like this in the appropriate place is what is needed. This will return a 1 (since nicks cannot repeat) if our nick is in the channel list, or a -1 if it is not. Simply checking that it isn't -1 does it.<br><br>@pakistani1, this should fix it. Also allows you to use .chanset #youchan +idletime<br>Also cleaned up your injection of nicks into the evaluation statements. You can now add/remove nicks without having to 'code' them in.<div class="codebox"><p>Code: </p><pre><code>#--- begin  config ---## how often to check idletimeset idle_interval "6"# max idletime allowedset idle_time "5"# exclude other bots from deop?set idle_exclude_bots "1"# nicks exempt from deopset idle_exempt_nicks "^pagli^ Pakistani1 n0mercy Go|dLeaf priya007 ^ash^ PehReDaaR pinky^ bilal huzur janat"# nicks exempt from whoisset whois_exempt_nicks "topguard pr0b"# enter the name of the channel service bot hereset idle_servicebot "Chanserv@services.dal.net"# enter your idle message given hereset idle_message_chan "deoped %nick from %channel (Too Much Idle!)"set idle_message_nick "deoped you from %channel (Inactive Op with too much idle)"#--- end of config ---#bind raw - 317 idlechecksetudef flag idlechanproc idlecheck {nick int arg} {global idle_timeset nick [lindex [split $arg] 1]set minutesidle [expr {[lindex [split $arg] 2] / 60}]if {($minutesidle &gt; $idle_time) &amp;&amp; ([lsearch -nocase -exact [split $::idle_exempt_nicks] $nick] == -1)} {foreach channel [channels] {if {[lsearch -exact [channel info $channel] +idlechan] != -1} {# this fixes the problem with chanserv deop messages# given when that nick isn't even in the channelif {[lsearch -nocase -exact [chanlist $channel] $nick] != -1} {# this allows us to use dynamic messages containing# variable references which will be replacedset idle_mchan [string map {% $} $::idle_message_chan]set idle_mnick [string map {% $} $::idle_message_nick] putserv "PRIVMSG $::idle_servicebot :deop $channel $nick"putserv "PRIVMSG $channel :$idle_mchan"putserv "PRIVMSG $nick :$idle_mnick"}}}}}proc perform_whois { } {global idle_exclude_bots idle_intervalforeach chan [channels] {if {[lsearch -exact [channel info $chan] +idlechan] != -1} {foreach person [chanlist $chan] {if {[isop $person $chan]} {if {$idle_exclude_bots != 0} {if {![matchattr [nick2hand $person $chan] b] &amp;&amp; ([lsearch -nocase -exact [split $::whois_exempt_nicks] $person] == -1)} {putserv "WHOIS $person $person" }} else {if {![isbotnick $person] &amp;&amp; ([lsearch -exact [split $::whois_exempt_nicks] $person] == -1)} { putserv "WHOIS $person $person" }}}}}}if {![string match "*time_idle*" [timers]]} {timer $idle_interval perform_whois}}if {![string match "*time_idle*" [timers]]} {timer $idle_interval perform_whois} </code></pre></div>Edit: edited to correct problem noted below, forgot to :: those global variables.. DOH!<br>Also neated up a ton of stuff.. enjoyz  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jun 09, 2008 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nimos]]></name></author>
		<updated>2008-06-09T08:20:23-04:00</updated>

		<published>2008-06-09T08:20:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83460#p83460</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83460#p83460"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83460#p83460"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach channel $idle_channels {         putserv "PRIVMSG Chanserv@services.dal.net :deop $channel $nick"      putserv "PRIVMSG $channel :deoped  $nick from $channel (too Much Idle)"      putserv "privmsg $nick :deoped u from $channel (too much idle)"      } </code></pre></div>thats your problem!<br><br>use the "search thing" instead of foreach...sry I dont know the command at the moment  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9877">Nimos</a> — Mon Jun 09, 2008 8:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pakistani1]]></name></author>
		<updated>2008-06-09T08:03:28-04:00</updated>

		<published>2008-06-09T08:03:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83459#p83459</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83459#p83459"/>
		<title type="html"><![CDATA[how to add multiple channel support in idleop.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83459#p83459"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set idle_interval "6"set idle_time "5"set idle_exclude_bots "1" set idle_channels "#channel1 #channel2 #channel3"bind raw - 317 idlecheckproc idlecheck {nick int arg} {  global idle_time idle_channels   set nick [string tolower [lindex $arg 1]]   set idle [string tolower [lindex $arg 2]]   set minutesidle [expr $idle / 60]   if {$minutesidle &gt; $idle_time &amp;&amp; $nick != "^pagli^" &amp;&amp; $nick != "Pakistani1" &amp;&amp; $nick != "n0mercy" &amp;&amp; $nick != "Go|dLeaf" &amp;&amp; $nick != "priya007" &amp;&amp; $nick != "^ash^" &amp;&amp; $nick != "PehReDaaR" &amp;&amp; $nick != "pinky^" &amp;&amp; $nick != "bilal" &amp;&amp; $nick != "huzur" &amp;&amp; $nick != "janat" } {      foreach channel $idle_channels {         putserv "PRIVMSG Chanserv@services.dal.net :deop $channel $nick"   putserv "PRIVMSG $channel :deoped  $nick from $channel (too Much Idle)"   putserv "privmsg $nick :deoped u from $channel (too much idle)"      }    }}proc perform_whois { } {  global idle_channels botnick idle_exclude_bots idle_interval    if {$idle_channels == " "} {      set idle_temp [channels]    } else {    set idle_temp $idle_channels    }    foreach chan $idle_temp {       foreach person [chanlist $chan] {          if { [isop $person $chan]} {            if {$idle_exclude_bots == 1} {             if {(![matchattr [nick2hand $person $chan] b]) &amp;&amp; ($person != $botnick) &amp;&amp; $person != "topguard" &amp;&amp; $person != "pr0b"} { putserv "WHOIS $person $person" }           }           if {$idle_exclude_bots == 0} {              if {$person != $botnick} { putserv "WHOIS $person $person" }           }         }        }     }if {![string match "*time_idle*" [timers]]} { timer $idle_interval perform_whois  }}if {![string match "*time_idle*" [timers]]} { timer $idle_interval perform_whois  }</code></pre></div>the script works fine if only one channel is added in set idle_channels "#channel1"<br><br>but when i add multiple channels .. it tries to deop idle nicks on all the channels even if the nick is not in that channel .. <br><br>eg if nick1 is oped in #channel1 and the script is turned on in #channel1 #channel2 #channel3 <br>the bot sends <br>msg <a href="mailto:chanserv@services.dal.net">chanserv@services.dal.net</a> deop #channel1 nick1 <br>msg <a href="mailto:chanserv@services.dal.net">chanserv@services.dal.net</a> deop #channel2 nick1 <br>msg <a href="mailto:chanserv@services.dal.net">chanserv@services.dal.net</a> deop #channel3 nick1 <br><br>even if nick1 is not on #channel2 and #channel3 <br><br>can some one please tell me how to fix this  ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6119">pakistani1</a> — Mon Jun 09, 2008 8:03 am</p><hr />
]]></content>
	</entry>
	</feed>
