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

	<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>2021-12-15T08:56:10-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-12-15T08:56:10-04:00</updated>

		<published>2021-12-15T08:56:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110648#p110648</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110648#p110648"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110648#p110648"><![CDATA[
Thanks CC that seems to work well<br><br>besided the missing } wich i added at :<br><br>regsub -all -- {[0-9\ ]} $text {} textbis<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Dec 15, 2021 8:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-12-15T08:41:49-04:00</updated>

		<published>2021-12-15T08:41:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110647#p110647</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110647#p110647"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110647#p110647"><![CDATA[
If you want to check if a line contains only digits and spaces:<div class="codebox"><p>Code: </p><pre><code>regsub -all -- {[0-9\ ] $text {} textbisif {$textbis eq ""} {   # do your stuff}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Dec 15, 2021 8:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-12-15T08:26:17-04:00</updated>

		<published>2021-12-15T08:26:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110646#p110646</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110646#p110646"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110646#p110646"><![CDATA[
i was wondering if we could have this code check if digits only in the sentence as we seem to get a lot of false positives especially with certain emoticons with digits in them<br><br><br>so for example trigger on only digits in sentence else ignore<br><br>so trigger on 12345<br>and not on 12345dfdf or kjskjs12345<br><br>ive messed with it to try and configure it that way but it seems no matter what i try i cant get it right<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Dec 15, 2021 8:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-08T13:00:13-04:00</updated>

		<published>2021-11-08T13:00:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110454#p110454</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110454#p110454"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110454#p110454"><![CDATA[
yes i tested using ur latest posted code spike^^ it fixed the previous issue but for some reason the latter mentioned issue i noticed as well<br><br>ive loaded it in an active channel ill monitor it and get back at ya thanks so far spike^^ and CC<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Nov 08, 2021 1:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-11-08T12:00:42-04:00</updated>

		<published>2021-11-08T12:00:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110452#p110452</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110452#p110452"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110452#p110452"><![CDATA[
simo : I don't notice any of that weirdness happening.<br><br>Load the full patched version of the script from above.<br>You already verified [lsearch -nocase -exact...  fixed that issue.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Nov 08, 2021 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-08T11:28:31-04:00</updated>

		<published>2021-11-08T11:28:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110451#p110451</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110451#p110451"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110451#p110451"><![CDATA[
i also noticed if a nick like [Guest]12345 types like:<br><br>[Guest]12345 [Guest]12344 [Guest]12345 [Guest]12344 12<br><br>gets counted and reaches threshold while both nicks [Guest]12345 [Guest]12344 are on channel<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Nov 08, 2021 11:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-08T11:23:48-04:00</updated>

		<published>2021-11-08T11:23:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110450#p110450</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110450#p110450"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110450#p110450"><![CDATA[
i noticed if a nick has like [Guest]12345 and types his nick it doesnt get removed as well<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Nov 08, 2021 11:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-11-08T11:11:07-04:00</updated>

		<published>2021-11-08T11:11:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110449#p110449</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110449#p110449"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110449#p110449"><![CDATA[
This is the complete updated code to this point...<div class="codebox"><p>Code: </p><pre><code>set whatsapp(maxlength) 5set whatsapp(unsettime) 20bind pubm - * 112345check:whatsappproc 112345check:whatsapp {nick host hand chan text} {   global whatsapp   set text [stripcodes c $text]   if {![string match {*[0-9]*} $text]} {  return 0  }   set nkls [chanlist $chan]   set tmptx ""   foreach word [split $text] {      set word [string trimright $word ":"]      if {[lsearch -nocase -exact $nkls $word] == -1} { append tmptx "$word " }   }    set digitcount [regexp -all {\d} $tmptx]   #putserv "PRIVMSG #test :$digitcount"   if {$digitcount == 0} {  return 0  }   if {[info exists whatsapp($chan:$nick)]} {  incr digitcount $whatsapp($chan:$nick)  }   if {($digitcount &gt;= $whatsapp(maxlength))} {      set chost [getchanhost $nick $chan]      set bmask m:[maskhost "$nick!$chost" 2]      pushmode $chan +b $bmask      after [expr {5*1000*1}] [list pushmode $chan -b $bmask]      #putserv "PRIVMSG $nick :you have been temporary mutebanned due to: excessive digits in your sentences"      putserv "NOTICE $nick :you have been temporary mutebanned due to: excessive digits in your sentences"      array unset whatsapp $chan:$nick      return 0   }   if {![info exists whatsapp($chan:$nick)]} {      utimer $whatsapp(unsettime) [list array unset whatsapp $chan:$nick]   }   set whatsapp($chan:$nick) $digitcount   return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Nov 08, 2021 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-08T10:22:11-04:00</updated>

		<published>2021-11-08T10:22:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110447#p110447</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110447#p110447"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110447#p110447"><![CDATA[
that seems to have fixed it thanks spike^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Nov 08, 2021 10:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-11-08T09:53:09-04:00</updated>

		<published>2021-11-08T09:53:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110446#p110446</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110446#p110446"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110446#p110446"><![CDATA[
Try replacing this line in the script...<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -nocase $nkls $word] == -1} { append tmptx "$word " }</code></pre></div>with this updated line...<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -nocase -exact $nkls $word] == -1} { append tmptx "$word " }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Nov 08, 2021 9:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-08T09:17:26-04:00</updated>

		<published>2021-11-08T09:17:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110445#p110445</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110445#p110445"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110445#p110445"><![CDATA[
i found another bug for example if a nick  [Guest]12345 is on channel  <br>and gets typed its not removed from $text and gets counted with the digits<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Nov 08, 2021 9:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-11-07T12:42:37-04:00</updated>

		<published>2021-11-07T12:42:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110444#p110444</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110444#p110444"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110444#p110444"><![CDATA[
Ooops.<br><br>Thanks for the fix CrazyCat and simo.<br><br>Edited the above post to reflect that fix...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Nov 07, 2021 12:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-07T12:18:33-04:00</updated>

		<published>2021-11-07T12:18:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110443#p110443</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110443#p110443"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110443#p110443"><![CDATA[
oh yea true didnt see that, that seemed to fix it thanks CC <br>and thanks spike^^ for the cleanup of the code<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Nov 07, 2021 12:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-11-07T12:05:30-04:00</updated>

		<published>2021-11-07T12:05:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110442#p110442</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110442#p110442"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110442#p110442"><![CDATA[
Little typo from SpiKe^^. It's <strong class="text-strong">\d</strong> and not <em class="text-italics">/d</em> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Nov 07, 2021 12:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-11-07T11:14:23-04:00</updated>

		<published>2021-11-07T11:14:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110441#p110441</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110441#p110441"/>
		<title type="html"><![CDATA[counting digits and if it exceeds threshold set mute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110441#p110441"><![CDATA[
when i replaced <br>   set digitcount [regexp -all {/d} $tmptx]<br><br><br>with : <br>   set digitcount [regsub -all {[[:digit:]]} $tmptx "" tmptx]<br><br>it seems working again<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Nov 07, 2021 11:14 am</p><hr />
]]></content>
	</entry>
	</feed>
