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

	<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>2016-10-29T20:16:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-10-29T20:16:43-04:00</updated>

		<published>2016-10-29T20:16:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105529#p105529</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105529#p105529"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105529#p105529"><![CDATA[
Ok, thank you.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sat Oct 29, 2016 8:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-10-29T04:02:58-04:00</updated>

		<published>2016-10-29T04:02:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105527#p105527</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105527#p105527"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105527#p105527"><![CDATA[
The scan will create the $num, $niv and $user variables and use the ones you need.<div class="codebox"><p>Code: </p><pre><code>bind msgm - * acces:listproc acces:list {nick uhost hand text} {if {[string match -nocase "*Access denied*" $text]} returnif {[scan $text {%d%d%s} num niv user] != 3} returnset fs [open "database" a]puts $fs "$user"close $fs}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Oct 29, 2016 4:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-10-28T15:13:11-04:00</updated>

		<published>2016-10-28T15:13:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105525#p105525</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105525#p105525"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105525#p105525"><![CDATA[
Ok.<br>I did not understand how the data nicks (% s) is taken.<br>It would be like this?:<blockquote class="uncited"><div>bind msgm - * acces:list<br><br>proc acces:list {nick CHaN!-@- hand text} {<br>if {[string match -nocase "*Access denied*" $text]} { return<br>} else {<br>if {[scan $text {%d%d%s} num niv user] != 3} return <br>set fs [open "database" a]<br>puts $fs <strong class="text-strong">"<span style="color:red">%s</span>"</strong><br>close $fs<br>}<br>}</div></blockquote>Anyway, after you create the nicks database, to cross it with a <span style="color:blue">WHILE</span> I have to except the words "off" and "nick" of titles, with the command <span style="color:blue">CONTINUE</span>.<br>I think there is no other way ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Fri Oct 28, 2016 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-10-28T07:18:15-04:00</updated>

		<published>2016-10-28T07:18:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105524#p105524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105524#p105524"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105524#p105524"><![CDATA[
In this case a<div class="codebox"><p>Code: </p><pre><code>scan $text {%d%d%s} num niv user</code></pre></div>will do what you want.<br><br>You can even use it like:<div class="codebox"><p>Code: </p><pre><code>if {[scan $text {%d%d%s} num niv user] != 3} return</code></pre></div>to make sure the input matches exactly what is expected.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Oct 28, 2016 7:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-10-27T14:02:44-04:00</updated>

		<published>2016-10-27T14:02:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105522#p105522</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105522#p105522"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105522#p105522"><![CDATA[
<blockquote class="uncited"><div>You don't want to filter numbers, you want to select the 3rd element in that list (especially since nicknames may contain numbers and other characters).<br><div class="codebox"><p>Code: </p><pre><code>set nick [lindex [split $text] 2]</code></pre></div></div></blockquote>Actually, I had made that way, and then when you invite removes the words that are not nick (with command <span style="color:blue">continue</span>), because this way takes the words "of" and "nick" that are part of the titles.<blockquote class="uncited"><div>Access List <span style="color:red">of</span> #mychannel: <br>Num Niv <span style="color:red">Nick</span> </div></blockquote>Work, work ... although I saw little technical ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Thu Oct 27, 2016 2:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2016-10-27T09:15:59-04:00</updated>

		<published>2016-10-27T09:15:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105521#p105521</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105521#p105521"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105521#p105521"><![CDATA[
You don't want to filter numbers, you want to select the 3rd element in that list (especially since nicknames may contain numbers and other characters).<br><div class="codebox"><p>Code: </p><pre><code>set nick [lindex [split $text] 2]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Oct 27, 2016 9:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-10-26T14:57:21-04:00</updated>

		<published>2016-10-26T14:57:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105520#p105520</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105520#p105520"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105520#p105520"><![CDATA[
<blockquote class="uncited"><div>As for what juanamores is looking for needs a different approach that depends on how he receives the result. Is that a notice? If you have a mIRC client type in status /debug @raw then do that /msg chan #mychannel access list command and copy/paste here the result you see in the @raw window.</div></blockquote><blockquote class="uncited"><div>&lt;- :CHaN!-@- PRIVMSG juanam :Access List of #mychannel:<br>&lt;- :CHaN!-@- PRIVMSG juanam :  Num   Niv  Nick<br>&lt;- :CHaN!-@- PRIVMSG juanam :    1   300  KoRn<br>&lt;- :CHaN!-@- PRIVMSG juanam :    2   450  Guerrero<br>&lt;- :CHaN!-@- PRIVMSG juanam :    3   300  deseo2<br>&lt;- :CHaN!-@- PRIVMSG juanam :    4   300  mia123</div></blockquote>Is a PRIVMSG not notice.<br><blockquote class="uncited"><div>bind msgm - * acces:list<br><br> proc acces:list {nick CHaN!-@- hand text} {<br>  if {[string match -nocase "*Access denied*" $text]} { return<br>  } else {<br>set fs [open "database" a]<br><strong class="text-strong">###Here filtering numbers, and retrieve only the 3rd word ([lindex $text 2])are the nicks##</strong><br>puts $fs [lindex $text 2]<br>close $fs<br>}<br>}</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Wed Oct 26, 2016 2:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2016-10-25T04:53:51-04:00</updated>

		<published>2016-10-25T04:53:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105519#p105519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105519#p105519"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105519#p105519"><![CDATA[
<blockquote class="uncited"><div>Why not go with a more direct approach with <em class="text-italics">string is digit</em> instead of a regexp, cos is a lot faster?</div></blockquote>I've actually never used or heard of that function, caesar, but now that I have it does seem much more efficient. Thanks for bringing it to my attention.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6204">Get_A_Fix</a> — Tue Oct 25, 2016 4:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-10-25T03:27:20-04:00</updated>

		<published>2016-10-25T03:27:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105518#p105518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105518#p105518"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105518#p105518"><![CDATA[
Why not go with a more direct approach with <em class="text-italics">string is digit</em> instead of a regexp, cos is a lot faster?<div class="codebox"><p>Code: </p><pre><code>if {![string is digit $number]} { # do whatever}</code></pre></div>Proof:<div class="codebox"><p>Code: </p><pre><code>proc test1 {} {    for {set i 0} {$i &lt; 1000} {incr i} {        string is digit $i    }}proc test2 {} {    for {set i 0} {$i &lt; 1000} {incr i} {        regexp {^-?\d+(\.\d+)?$} $i    }}</code></pre></div>result:<div class="codebox"><p>Code: </p><pre><code>% time test1699 microseconds per iteration% time test21162 microseconds per iteration</code></pre></div>As for what juanamores is looking for needs a different approach that depends on how he receives the result. Is that a notice? If you have a mIRC client type in status <em class="text-italics">/debug @raw</em> then do that<em class="text-italics"> /msg chan #mychannel access list</em> command and copy/paste here the result you see in the @raw window.<br><br>I would be inclined to use scan like:<div class="codebox"><p>Code: </p><pre><code>scan $line {%d%d%s} num niv nick</code></pre></div>executed for each line of text the server replies that would create num, niv and nick variables he could later use to do whatever.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Oct 25, 2016 3:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2016-10-24T23:12:18-04:00</updated>

		<published>2016-10-24T23:12:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105517#p105517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105517#p105517"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105517#p105517"><![CDATA[
You could use something like..<br><div class="codebox"><p>Code: </p><pre><code>proc isnum {string} {  if {[regexp {^-?\d+(\.\d+)?$} $string]} {    return 1;  }  return 0;}</code></pre></div>Then just ..<div class="codebox"><p>Code: </p><pre><code>if {![isnum $arg]} {</code></pre></div>Maybe throw in a string match too<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6204">Get_A_Fix</a> — Mon Oct 24, 2016 11:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-10-24T21:34:58-04:00</updated>

		<published>2016-10-24T21:34:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105516#p105516</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105516#p105516"/>
		<title type="html"><![CDATA[string match ONLY LETTER (no number)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105516#p105516"><![CDATA[
I want to make a comparison that ignores the numbers and compare the text only in letters.<br><br>When I look at the access list for a channel, the bot ChanServ (Bot officer of IRCu network) displays a list with 3 items:<br>a) ordinal number<br>b) access level<br>c) nick<br>Thus:<br>Command: <blockquote class="uncited"><div>/msg chan #mychannel access list</div></blockquote>Result:<blockquote class="uncited"><div>Access List of #mychannel:<br>Num Niv Nick<br> 1 300 Michael<br> 2 450 The_warrior<br> 3 100 BLueRiGhT<br> 4 300 mia25<br> 5 300 Anais</div></blockquote>How do I retrieve only nicks (words), ignoring the numbers?<br><br><strong class="text-strong">What I want the bot retrieve the channel access list and perform a database with nicks  that are at the time of executing the command?</strong><br><br>The list may be changing as nicks are added or removed from the channel.<br>For this reason, when you run the command to retrieve the bot list, you read it and only list the nicks you find in it.<br><br><span style="text-decoration:underline">REASON</span>: Perform a tcl to invite only nicks which have ChanServ access level on a given channel at the time of executing the invite command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Mon Oct 24, 2016 9:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
