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

	<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>2020-07-20T08:38:11-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T08:38:11-04:00</updated>

		<published>2020-07-20T08:38:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108765#p108765</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108765#p108765"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108765#p108765"><![CDATA[
tnx crazycat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 8:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-07-20T08:31:49-04:00</updated>

		<published>2020-07-20T08:31:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108764#p108764</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108764#p108764"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108764#p108764"><![CDATA[
bind mode - "* +b" <strong class="text-strong">devoice-bans</strong><br><br>proc <strong class="text-strong">devoice-ban</strong> {nick uhost hand chan mc ban} {<br><br>Use same name in bind and proc.<br><br>And when you have an error, use .set errorInfo to have more information.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Jul 20, 2020 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T08:36:56-04:00</updated>

		<published>2020-07-20T08:30:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108763#p108763</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108763#p108763"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108763#p108763"><![CDATA[
fixed the errors seems to be working proper now thnx CrazyCat and Caesar<br>much apreciated<br><br>this is what i have as end result:<br><div class="codebox"><p>Code: </p><pre><code>bind mode - "* +b" devoice-banproc devoice-ban {nick uhost hand chan mc ban} {   if {[isbotnick $nick] || ![botisop $chan]} returnif { [string first ":" $ban] != -1 } {   set ban [lindex [split $ban ":"] 1]}   foreach user [chanlist $chan] {      if {[isbotnick $user] || ![isvoice $user $chan]} continue      if {[isop $user $chan] || [ishalfop $user $chan]} continue      if {[matchattr [nick2hand $user] fnmo|fnmo $chan]} continue      if {![string match -nocase $ban $user![getchanhost $user $chan]]} continue      pushmode $chan -v $user   }   flushmode $chan}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 8:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T08:24:40-04:00</updated>

		<published>2020-07-20T08:24:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108762#p108762</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108762#p108762"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108762#p108762"><![CDATA[
took the error out this is what i got atm:<br><div class="codebox"><p>Code: </p><pre><code>bind mode - "* +b" devoice-bansproc devoice-ban {nick uhost hand chan mc ban} {   if {[isbotnick $nick] || ![botisop $chan]} return   foreach user [chanlist $chan] {      if {[isbotnick $user] || ![isvoice $user $chan]} continue      if {[isop $n $chan] || [ishalfop $user $chan]} continue      if {[matchattr [nick2hand $user] fnmo|fnmo $chan]} continue      if {![string match -nocase $ban $user![getchanhost $user $chan]]} continue      pushmode $chan -v $user   }   flushmode $chan}</code></pre></div>noting happens tho it doesnt devoice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 8:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T08:08:58-04:00</updated>

		<published>2020-07-20T08:08:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108761#p108761</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108761#p108761"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108761#p108761"><![CDATA[
i tried your proc caesar :<br><div class="codebox"><p>Code: </p><pre><code>bind mode - "* +b" devoice-bansproc devoice-ban {nick uhost hand chan mc ban} {   if {[isbotnick $nick] || ![botisop $chan]} return   foreach user [chanlist $chan] {      if {[isbotnick $user] || ![isvoice $user $chan]} continue      if {[isop $n $chan] || [ishalfop $user $chan]} continue      if {[matchattr [nick2hand $user] fnmo|fnmo $chan]}} continue      if {![string match -nocase $ban $user![getchanhost $user $chan]]} continue      pushmode $chan -v $user   }   flushmode $chan}</code></pre></div>and got this error:<br><br>Error loading script 'test.tcl': can't read "chan": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 8:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-07-20T06:54:58-04:00</updated>

		<published>2020-07-20T06:54:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108760#p108760</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108760#p108760"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108760#p108760"><![CDATA[
<blockquote class="uncited"><div>Use <em class="text-italics">continue</em> instead of <em class="text-italics">return</em> inside a loop.</div></blockquote>Didn't see that, caesar is right.<br>If the user has clones, you will only devoice the first seen, not the others.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Jul 20, 2020 6:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-07-20T07:17:36-04:00</updated>

		<published>2020-07-20T06:42:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108758#p108758</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108758#p108758"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108758#p108758"><![CDATA[
Use <em class="text-italics">continue</em> instead of <em class="text-italics">return</em> inside a loop.<br><br>And you should loop over the channel user list you should skip those that don't have voice in the first place and then do the matching and whatnot.<br><br>Apart this I see this:<div class="codebox"><p>Code: </p><pre><code>if {[isbotnick $nick] || ![botisop $chan]} { return }</code></pre></div>and then again in the loop:<div class="codebox"><p>Code: </p><pre><code>if {![botisop $chan]} { return 0 }</code></pre></div>Your loop should make more sense like:<br>- if the user is bot OR the user isn't voiced continue with the next user in the chanlist<br>- if the user is channel operator or halfop continue with the next user in the chanlist<br>- if the user has fnmo|fnmo continue with the next user in the chanlist<br>- if the host doesn't match user's host continue with the next user in the chanlist<br>- else devoice the user<div class="codebox"><p>Code: </p><pre><code>proc devoice-ban {nick uhost hand chan mc ban} {if {[isbotnick $nick] || ![botisop $chan]} returnforeach user [chanlist $chan] {if {[isbotnick $user] || ![isvoice $user $chan]} continueif {[isop $n $chan] || [ishalfop $user $chan]} continueif {[matchattr [nick2hand $user] fnmo|fnmo $chan]}} continueif {![string match -nocase $ban $user![getchanhost $user $chan]]} continuepushmode $chan -v $user}flushmode $chan}</code></pre></div>Edit: fixed a typo and pushed the host check last.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jul 20, 2020 6:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T04:58:23-04:00</updated>

		<published>2020-07-20T04:58:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108757#p108757</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108757#p108757"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108757#p108757"><![CDATA[
excellent that seems to do the trick flawlessly <br>thnx CrazyCat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 4:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-07-20T04:03:37-04:00</updated>

		<published>2020-07-20T04:03:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108756#p108756</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108756#p108756"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108756#p108756"><![CDATA[
the $ban string contains "m:", so it will never match.<br>You'll have to adapt the $ban string if needed:<div class="codebox"><p>Code: </p><pre><code>if { [string first ":" $ban] != -1 } {   set ban [lindex [split $ban ":"] 1]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Jul 20, 2020 4:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-07-20T02:19:38-04:00</updated>

		<published>2020-07-20T02:19:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108755#p108755</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108755#p108755"/>
		<title type="html"><![CDATA[devoice on ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108755#p108755"><![CDATA[
hey there i was using this to have it check if a banned user is voiced to devoice <br>in the case of a normal ban like +b nick!ident@host it works fine <br>but on some servers it has extended bans like  <br><br>muteban: +b ~q:nick!ident@host<br><br>or <br><br>muteban: +b m:nick!ident@host<br><br>is there a way to have it check for all these scenarios and devoice if banned nick has voice<br><br><br>using this at the moment:<br><br><div class="codebox"><p>Code: </p><pre><code>bind mode - "* +b" devoice-banproc devoice-ban {nick uhost hand chan mc ban} {  if {[isbotnick $nick] || ![botisop $chan]} { return } foreach n [chanlist $chan] {  if {[string match -nocase $ban $n![getchanhost $n $chan]]} { if {![botisop $chan]} { return 0 }    if {[isop $n $chan]} { return 0 }    if {[ishalfop $n $chan]} { return 0 }    if {[matchattr [nick2hand $n] fnmo|fnmo $chan]} { return 0 }    if {[isbotnick $n]} { return 0}   if {[isvoice $n $chan] &amp;&amp; ![isop $n $chan] &amp;&amp; ![ishalfop $n $chan] &amp;&amp; ![matchattr [nick2hand $n] fnmo|fnmo $chan]} { pushmode $chan -v $n }  } } flushmode $chan}</code></pre></div>heres an example of what happens:<br><br>this devoices as well:<br>09:20:44  +[simo]  Sets Mode on  #opers  to:  +b *!*@33.34.104.17 <br>09:20:45  @TCL-Tester  Sets Mode on  #opers  to:  -v Peachey <br><br>this doesnt devoice while nick is voiced<br>09:21:18  +[simo]  Sets Mode on  #opers  to:  +b m:*!*@33.34.104.17 <br><br>thnx in advance gents.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jul 20, 2020 2:19 am</p><hr />
]]></content>
	</entry>
	</feed>
