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

	<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>2022-09-11T06:59:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-11T06:59:53-04:00</updated>

		<published>2022-09-11T06:59:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111395#p111395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111395#p111395"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111395#p111395"><![CDATA[
for those that might need this as well not sure if its properly constructed but it seems to work well.<br><br><br><div class="codebox"><p>Code: </p><pre><code># to enable on channel via partyline Syntax: .chanset #channel +badnickchecker# or to enable in channel !badnick on / offbind PUB -|- !badnick badnick:checker  bind PUB n !badnick badnick:checker proc badnick:checker {nick uhost hand chan arg} {  switch -nocase -- [lindex [split $arg] 0] {    on {      if {[channel get $chan badnickchecker]} {        putserv "NOTICE $nick :badnickchecker is already enabled on $chan."      } else {        channel set $chan +badnickchecker        putserv "NOTICE $nick :badnickchecker is now enabled."}    }    off {      if {![channel get $chan badnickchecker]} {        putserv "NOTICE $nick :badnickchecker is already disabled on $chan."      } else {        channel set $chan -badnickchecker        putserv "NOTICE $nick :badnickchecker is now disabled."     }    }     }}setudef flag badnickchecker set bnick {    "SomeVeryLongBadNick"    "SomeVeryLongBadNick"    "SomeVeryLongBadNick"    "SomeVeryLongBadNick"    "SomeVeryLongBadNick"    "SomeVeryLongBadNick"    "SomeVeryLongBadNick" }bind join - * join:badnickbind nick - * nick:badnickproc nick:badnick {nick uhost hand chan newnick} {   join:badnick $newnick $uhost $hand $chan}proc join:badnick {nick uhost hand chan} {    if {![channel get $chan badnickchecker]} { return }   global bnick temp   set temp 0   foreach xix [string tolower $bnick] {   if {[string match "[bn2reg $xix]" [string tolower $nick]]} {         set bdpart [bn2reg $xix]          regsub -all {\*{1,}} $bdpart "*" bdpartxc         set badpart $bdpartxc         set temp 1         break      }   }   if {$temp} {        set chost [getchanhost $nick $chan]        set masxs [maskhost $nick!$chost 2]        pushmode $chan +b $badpart!*@*   }}proc bn2reg {text} {   set sep {*}   set reg $sep   for {set i 0} {$i&lt;=[string length $text]} {incr i} {      append reg [string index $text $i]$sep   }   return $reg}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Sep 11, 2022 6:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-11T04:36:28-04:00</updated>

		<published>2022-09-11T04:36:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111393#p111393</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111393#p111393"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111393#p111393"><![CDATA[
Thanks ceasar<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Sep 11, 2022 4:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2022-09-11T03:56:48-04:00</updated>

		<published>2022-09-11T03:56:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111392#p111392</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111392#p111392"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111392#p111392"><![CDATA[
Would be a good idea to stop the loop once you found a match, cos that's the intended purpose, right? I mean after:<div class="codebox"><p>Code: </p><pre><code>set temp 1</code></pre></div>just add a 'break' to stop the loop. Also you don't need the <em class="text-italics">if .. else</em> part in this:<div class="codebox"><p>Code: </p><pre><code> if {!$temp} { return } {      pushmode $chan +b *$badpart*!*@*   } </code></pre></div>just go directly with <em class="text-italics">if</em>:<div class="codebox"><p>Code: </p><pre><code> if {$temp} {      pushmode $chan +b *$badpart*!*@*   }</code></pre></div>Oh, and you could optimize this and add a 'reahsh' bind where you build the regexp only <em class="text-italics">once</em> into a different variable and use it from there, no point on building it every time a user joins the channel. This should save you some time/resources.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Sep 11, 2022 3:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T13:16:28-04:00</updated>

		<published>2022-09-10T13:16:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111389#p111389</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111389#p111389"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111389#p111389"><![CDATA[
thanks CrazyCat i got it to work as i wanted to<br><br>Apreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-09-10T13:02:29-04:00</updated>

		<published>2022-09-10T13:02:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111388#p111388</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111388#p111388"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111388#p111388"><![CDATA[
Try to explain simply what you want to do if you really want help. I'm fed up with reading between lines or wait for another post to decrypt what you try to do.<br><br>You now have all the leads you need to do your script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sat Sep 10, 2022 1:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T11:14:27-04:00</updated>

		<published>2022-09-10T11:14:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111386#p111386</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111386#p111386"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111386#p111386"><![CDATA[
this is what  i have so far <br><br><br><div class="codebox"><p>Code: </p><pre><code>set bnick {     "badnick"   "someverylongbadword"   "somewordthatsbad"   "veryabussivelongword"}bind join - * join:badnickbind nick - * nick:badnickproc nick:badnick {nick uhost hand chan newnick} {   join:badnick $newnick $uhost $hand $chan}proc join:badnick {nick uhost hand chan} {   global bnick temp   regsub -all -- {(.)\1+} $nick {\1} nick2x2   set temp 0   foreach i [string tolower $bnick] {      if {[regexp -- {[bn2reg $i]} [string tolower $nick2x2]]} {         set badpart $i         set temp 1      }   }   if {!$temp} { return } {      pushmode $chan +b *$badpart*!*@*   }}proc bn2reg {text} {   set sep {[^\s]*}   set reg $sep   for {set i 0} {$i&lt;=[string length $text]} {incr i} {      append reg [string index $text $i]$sep   }   return $reg}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 11:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T11:26:32-04:00</updated>

		<published>2022-09-10T11:09:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111385#p111385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111385#p111385"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111385#p111385"><![CDATA[
ive changed to : <br><br><br>      if {[regexp -- {[bn2reg $i]} [string tolower $nick2x2]]} {<br><br><br>but now it sets weird bans<br><br><br>17:13:25    Joins :    sfbdfadnicksdjh    [ident: Mibbit]     *!*@32.158.124.74 <br>17:13:25  @Hawk  Sets Mode on  #test  to:  +b *veryabussivelongword*!*@*<br><br>i guess what we were looking  is +b *b*a*d*n*i*c*k*!*@*<br><br>to set wild mask ban on the detected bad part of nick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 11:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T11:07:34-04:00</updated>

		<published>2022-09-10T11:07:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111384#p111384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111384#p111384"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111384#p111384"><![CDATA[
after trial i get :<br><blockquote class="uncited"><div>couldn't compile regular expression pattern: quantifier operand invalid</div></blockquote><br>i used :<br><div class="codebox"><p>Code: </p><pre><code>      if {[regexp [bn2reg $i] [string tolower $nick2x2]]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 11:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T11:00:43-04:00</updated>

		<published>2022-09-10T11:00:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111383#p111383</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111383#p111383"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111383#p111383"><![CDATA[
thanks CrazyCat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 11:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-09-10T09:20:49-04:00</updated>

		<published>2022-09-10T09:20:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111382#p111382</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111382#p111382"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111382#p111382"><![CDATA[
Just replace<div class="codebox"><p>Code: </p><pre><code>if {[string match *$i* [string tolower $nick2x2]]} </code></pre></div>with<div class="codebox"><p>Code: </p><pre><code>if {[regexp [bn2reg $i] [string tolower $nick2x2]]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sat Sep 10, 2022 9:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-09-10T05:32:29-04:00</updated>

		<published>2022-09-10T05:32:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111381#p111381</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111381#p111381"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111381#p111381"><![CDATA[
Sorry for the late reply, i wanted to try your last posted code crazycat but im not sure how to test it with the current badnick checker i have in use the one i posted above<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 10, 2022 5:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-08-31T04:10:05-04:00</updated>

		<published>2022-08-31T04:10:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111324#p111324</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111324#p111324"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111324#p111324"><![CDATA[
thanks CrazyCat let me try that<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Aug 31, 2022 4:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-08-30T18:43:59-04:00</updated>

		<published>2022-08-30T18:43:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111323#p111323</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111323#p111323"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111323#p111323"><![CDATA[
...<br>I said you that you can create a proc to transform your badnicks into regexp:<div class="codebox"><p>Code: </p><pre><code>proc bn2reg {text} {   set sep {[^\s]*}   set reg $sep   for {set i 0} {$i&lt;=[string length $text]} {incr i} {      append reg [string index $text $i]$sep   }   return $reg}</code></pre></div>Test in tclsh:<div class="codebox"><p>Code: </p><pre><code>% proc bn2reg {text} {   set sep {[^\s]*}   set reg $sep   for {set i 0} {$i&lt;=[string length $text]} {incr i} {      append reg [string index $text $i]$sep   }   return $reg}% bn2reg badnick[^\s]*b[^\s]*a[^\s]*d[^\s]*n[^\s]*i[^\s]*c[^\s]*k[^\s]*</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Aug 30, 2022 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-08-30T17:59:40-04:00</updated>

		<published>2022-08-30T17:59:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111322#p111322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111322#p111322"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111322#p111322"><![CDATA[
Thanks crazycat Yes i checked it it has a lot of * i wanted to prevent that to add a zillion * for each bad word to check for<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Tue Aug 30, 2022 5:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-08-29T18:33:20-04:00</updated>

		<published>2022-08-29T18:33:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111316#p111316</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111316#p111316"/>
		<title type="html"><![CDATA[detect bad word hidden in long nicks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111316#p111316"><![CDATA[
Did you check my regex101.com link before answering ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Aug 29, 2022 6:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
