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

	<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>2012-03-19T12:34:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-22T12:39:28-04:00</updated>

		<published>2011-08-22T12:39:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97481#p97481</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97481#p97481"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97481#p97481"><![CDATA[
Minor typo, lost the "eval" subcommand during copy/paste. Post updated now<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Aug 22, 2011 12:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-22T09:09:53-04:00</updated>

		<published>2011-08-22T09:09:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97480#p97480</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97480#p97480"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97480#p97480"><![CDATA[
Hi sir there is an error on the script how to fix this:<blockquote class="uncited"><div>Unknown subcommand "modecontrol" to "namespace"</div></blockquote>Thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Mon Aug 22, 2011 9:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-21T06:18:16-04:00</updated>

		<published>2011-08-21T06:18:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97475#p97475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97475#p97475"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97475#p97475"><![CDATA[
Then I am either confused of the intended behaviour, or you've got some other script or feature enabled that is interfering.<br><br>The way the script was written, is to enforce the modes set in <em class="text-italics">lockModes</em> - that is, do not let people remove the modes set from the channel, and do not let people add other modes to the channel.<br><br>I've now updated the previous post in order to separate enforced and restricted modes. I've also moved the code to a separate namespace, so make sure you restart your eggdrop (not just .rehash) to make sure the old code does not persist.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Aug 21, 2011 6:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-21T00:51:55-04:00</updated>

		<published>2011-08-21T00:51:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97472#p97472</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97472#p97472"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97472#p97472"><![CDATA[
Hello sir with the help of speechles the error found on this part: <blockquote class="uncited"><div>bind mode - "MODE" raw:modeCheck </div></blockquote>and now the script is working but opposite of what i requested: <br><blockquote class="uncited"><div>User sets mode +m<br>User sets mode -m<br>Eggdrop sets mode +m <br><br>User sets mode +M<br>User sets mode -M<br>Eggdrop sets mode +M </div></blockquote>It keep the settings that offender set that not added to the masters, owners, and other bots.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Sun Aug 21, 2011 12:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-20T18:02:52-04:00</updated>

		<published>2011-08-20T18:02:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97470#p97470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97470#p97470"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97470#p97470"><![CDATA[
What did you set lockModes to?<br>Also, did you get any error messages in your logs or dcc chat?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 20, 2011 6:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-20T13:36:51-04:00</updated>

		<published>2011-08-20T13:36:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97468#p97468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97468#p97468"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97468#p97468"><![CDATA[
I test the script this time sir but nothing happens:<br><blockquote class="uncited"><div>* User sets mode: +R</div></blockquote> <br>the bot did not -R the channel :s<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Sat Aug 20, 2011 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2012-03-19T12:34:54-04:00</updated>

		<published>2011-08-20T09:04:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97463#p97463</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97463#p97463"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97463#p97463"><![CDATA[
It seems I introduced a new bug in my last fix (should'nt have added -- to the lsearch commands, that part was working just fine as it was).<br>The following have been successfully simulated in tclsh, and should work.<br>It will allow bots and masters/owners to override the lock.<div class="codebox"><p>Code: </p><pre><code>namespace eval modecontrol {  variable enforceModes ""  #Always keep these set  variable restrictModes "" #Never permit these to be set  proc raw:modeCheck {from key text} {    variable enforceModes    variable restrictModes    set from [split $from "!"]    set nick [lindex $from 0]    set handle [nick2hand $nick]    #Sanity check    if {[isbotnick $nick] || [matchattr $handle "+mnb"]} {      return 0    }    set items [split $text]    set enforce [split $enforceModes ""]    set restrict [split $restrictModes ""]    set target [lindex $items 0]    set add 1    set act 0    foreach mode [split [lindex $items 1] ""] {      switch -- $mode {        "+" {          set add 1        }        "-" {          set add 0        }        "I" -        "e" -        "b" {          set items [lreplace $items 2 2]        }        "k" {          if {$add} {            set key [lindex $items 2]            set items [lreplace $items 2 2]          }        }        "l" {          if {$add} {            set limit [lindex $items 2]            set items [lreplace $items 2 2]          }        }        default {          if {[lsearch $enforce $mode] &gt;= 0 &amp;&amp; !$add} {            pushmode $target "+$mode"            set act 1          } elseif {[lsearch $restrict $mode] &gt;= 0 &amp;&amp; $add} {            pushmode $target "-$mode"            set act 1          }        }      }      #Uncomment this to bounce key and limits      #if {[info exists key]} {      #  pushmode $target -k $key      #}      #if {[info exists limit]} {      #  pushmode $target -l      #}    }    if {$act &amp;&amp; [llength $from] &gt; 1} {      puthelp "NOTICE $nick :Please let me handle the channel mode settings."    }    return 0  }  bind raw - "MODE" [namespace current]::modeCheck}</code></pre></div>Edit: Fixed incorrect binding type<br>Edit: Placed code in separate namespace, separated enforced and restricted modes<br>Edit: Fixed missing "eval" subcommand for namespace<br>Edit: Incorrect lsearch order and pattern.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 20, 2011 9:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-20T07:59:40-04:00</updated>

		<published>2011-08-20T07:59:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97459#p97459</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97459#p97459"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97459#p97459"><![CDATA[
Hello sir i try the script but still no luck.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Sat Aug 20, 2011 7:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-16T02:28:16-04:00</updated>

		<published>2011-08-16T02:28:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97427#p97427</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97427#p97427"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97427#p97427"><![CDATA[
Is this the huge chunk of code are you referring sir nml375?<div class="codebox"><p>Code: </p><pre><code>set lockModes "mRsC"bind raw - "MODE" raw:modeCheckproc raw:modeCheck {from key text} {  set nick [lindex [split $from "!"] 0]  #Sanity check  if {[isbotnick $nick]} {    return 0  }  set items [split $text]  set lock [split $::lockModes ""]  set target [lindex $items 0]  set add 1  set act 0  foreach mode [split [lindex $items 1] ""] {    switch -- $mode {      "+" {        set add 1      }      "-" {        set add 0      }      "I" -      "e" -      "b" {        set items [lreplace $items 2 2]      }      "k" {        if {$add} {          set key [lindex $items 2]          set items [lreplace $items 2 2]        }      }      "l" {        if {$add} {          set limit [lindex $items 2]          set items [lreplace $items 2 2]        }      }      default {        if {[lsearch -- $lock $mode] &gt;= 0 &amp;&amp; !$add} {          pushmode $target "+$mode"          set act 1        } elseif {[lsearch -- $lock $mode] &lt; 0 &amp;&amp; $add} {          pushmode $target "-$mode"          set act 1        }      }    }    #Uncomment this to bounce key and limits    #if {[info exists key]} {    #  pushmode $target -k $key    #}    #if {[info exists limit]} {    #  pushmode $target -l    #}    if {$act} {      puthelp "NOTICE $nick :Please let me handle the channel mode settings."    }  }  return 0}</code></pre></div>I will try this one and post the result later thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Tue Aug 16, 2011 2:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-13T08:43:20-04:00</updated>

		<published>2011-08-13T08:43:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97398#p97398</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97398#p97398"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97398#p97398"><![CDATA[
The last piece of code I posted is a patch, which is applied to the sourcecode of eggdrop prior compiling. The simplest way of applying it is to write it to a file (say modelock.patch), and from within the eggdrop source directory, issue this command:<div class="codebox"><p>Code: </p><pre><code>nml375@linux:~/eggdrop1.6.20$ patch -p1 modelock.patch</code></pre></div>You should then see some output similar to this:<div class="codebox"><p>Code: </p><pre><code>patching file src/mod/irc.mod/mode.cHunk #1 succeeded at 1323 with fuzz 1.nml375@linux:~/eggdrop1.6.20$</code></pre></div>At this point, you continue with the compiling as usual: ie ./configure; make config; make; make install<br><br>Otherwize, I've corrected the huge chunk of code I posted earlier, so that "should" work<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 13, 2011 8:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-13T08:34:56-04:00</updated>

		<published>2011-08-13T08:34:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97397#p97397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97397#p97397"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97397#p97397"><![CDATA[
Yep sir but i don't understand the code you provide how to make it works and i just make a script that i think on that flow i could understand i hope you help me sir with something like that or do i have to make it a new topic.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Sat Aug 13, 2011 8:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-13T08:15:28-04:00</updated>

		<published>2011-08-13T08:15:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97395#p97395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97395#p97395"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97395#p97395"><![CDATA[
I'm afraid that piece of code does not make much sense at all..<br>No variable named "nick" is ever defined within your "snowbotchk" proc, so you will get an error about that. Even if $nick would've been defined, I don't see the sense in matching it against the string "Eggdrop"...<br><br>The foreach-command does not accept any "elseif" options; your braces are mis-aligned.<br><br>Finally, if you were to correct the above issues, all your code would do, is to check each channel every 30 minutes, and remove any mMR modes (regardless of who set it initially). As I understood your earlier post, you wanted your eggdrop to permit other bots to change locked modes (override).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 13, 2011 8:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-13T02:58:58-04:00</updated>

		<published>2011-08-13T02:58:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97394#p97394</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97394#p97394"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97394#p97394"><![CDATA[
It seems i'm having difficulty how to do that thing i just made something like this but just wanted to know you sir if this is correct:<br><div class="codebox"><p>Code: </p><pre><code>set timechks 30timer $timechks snowbotchkproc snowbotchk {} {global timechksforeach chan [channels] {if {[botisop $chan] &amp;&amp; [isbotnick $nick] &amp;&amp; ![string equal "Eggdrop" $nick]} {if {[string match +*m* [lindex [getchanmode $chan] 0]]} {pushmode #bot -m}} elseif {[string match +*M* [lindex [getchanmode $chan] 0]]} {pushmode #bot -M}} elseif {[string match +*R* [lindex [getchanmode $chan] 0]]} {pushmode #bot -R}}timer $timechks snowbotchk</code></pre></div>Thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Sat Aug 13, 2011 2:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-08-12T12:17:42-04:00</updated>

		<published>2011-08-12T12:17:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97390#p97390</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97390#p97390"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97390#p97390"><![CDATA[
Unfortunately, it would seem that the built-in modelock only allows overrides from masters, owners, and the bot itself, but not other bots. As for the tcl-script, it does none of the mode enforcements, but merely notifies the offender not to change modes.<br><br>You should, however, get away with granting your bots master privileges on the individual channels:<div class="codebox"><p>Code: </p><pre><code>.chattr otherbot +m #thechannel</code></pre></div>You could also apply this patch to the source, in order to permit bots and friends (+f) to override the modelock:<div class="codebox"><p>Code: </p><pre><code>--- eggdrop1.6.20/src/mod/irc.mod/mode.c        2010-07-01 18:10:49.000000000 +0200+++ eggdrop1.6.20+modelock/src/mod/irc.mod/mode.c       2011-08-12 18:16:15.256931403 +0200@@ -1323,7 +1323,8 @@             if ((((ms2[0] == '+') &amp;&amp; (chan-&gt;mode_mns_prot &amp; todo)) ||                 ((ms2[0] == '-') &amp;&amp; (chan-&gt;mode_pls_prot &amp; todo))) &amp;&amp;                 !glob_master(user) &amp;&amp; !chan_master(user) &amp;&amp;-                !match_my_nick(nick))+                !glob_friend(user) &amp;&amp; !chan_friend(user) &amp;&amp;+                !glob_bot(user) &amp;&amp; !match_my_nick(nick))               add_mode(chan, ms2[0] == '+' ? '-' : '+', *chg, "");             else if (reversing &amp;&amp; ((ms2[0] == '+') ||                      (chan-&gt;mode_pls_prot &amp; todo)) &amp;&amp; ((ms2[0] == '-') ||</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Aug 12, 2011 12:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sydneybabe]]></name></author>
		<updated>2011-08-12T02:51:36-04:00</updated>

		<published>2011-08-12T02:51:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97384#p97384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97384#p97384"/>
		<title type="html"><![CDATA[Only bot can set channel mode lock (Dalnet network)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97384#p97384"><![CDATA[
Hello sir i add this script of into my bot <br><div class="codebox"><p>Code: </p><pre><code>bind raw - "MODE" raw:noticeModeproc raw:noticeMode {from key text} {  set nick [lindex [split $from "!"] 0]  set handle [nick2hand $nick]  set channel [lindex [split $text] 0]  #Don't bug owners or bots  if {![matchattr $handle "+nb"]} {    puthelp "NOTICE $nick :Please let me handle the channel mode settings."  }  return 0}</code></pre></div>and what i did is i added the other bot to +b flags and test but when the bot i added sets mode +M the channel .. the bot that loaded of the script -M the mode.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8947">Sydneybabe</a> — Fri Aug 12, 2011 2:51 am</p><hr />
]]></content>
	</entry>
	</feed>
