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

	<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>2009-08-16T11:55:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T11:54:32-04:00</updated>

		<published>2009-08-16T11:54:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89914#p89914</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89914#p89914"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89914#p89914"><![CDATA[
Oops... Sorry.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> <br><br>Thanks hehehe<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-16T11:55:00-04:00</updated>

		<published>2009-08-16T11:46:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89913#p89913</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89913#p89913"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89913#p89913"><![CDATA[
<blockquote class="uncited"><div><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"> <br><br>Look, my mirc scripting code had a if, a elseif and a else. And your tcl script had just a if and a else.</div></blockquote>Check again charlie, all 3 of your conditions are there. And the style of code one uses to attain the same results can be dramatic. You've used horrible style, the tcl script doesn't....<br><div class="codebox"><p>Code: </p><pre><code>#create the bind for event handlingbind pub - !something something# create the bound procedure and headerproc something {nick uhost hand chan text} {  # grab the first word, in mirc this is $1  set firstword [lindex [split $text] 0]  # is *!*@* not found in the word?  if {![string match "*!*@*" $firstword]} {    # if there is no *!*@* in the word    # now we need to check them seperately    # *!* and *@*. if found, reply wrong format    if {[string match "*!*" $firstword] || [string match "*@*" $firstword]} {      putserv "privmsg $chan :Wrong format" ; return    }    # there is no *!*@*, no *!*, no *@*    putserv "privmsg $chan :It will be used as nickname"  } else {    # there is *!*@*    putserv "privmsg $chan :It will be used as hostname"  }}</code></pre></div>Commented it so you can see how this works.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Aug 16, 2009 11:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T11:45:34-04:00</updated>

		<published>2009-08-16T11:45:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89912#p89912</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89912#p89912"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89912#p89912"><![CDATA[
<img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"> <br><br>Look, my mirc scripting code had a if, a elseif and a else. And your tcl script had just a if and a else.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 11:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-16T11:41:34-04:00</updated>

		<published>2009-08-16T11:41:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89910#p89910</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89910#p89910"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89910#p89910"><![CDATA[
<blockquote class="uncited"><div>It works like arfer's script.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"></div></blockquote>Are you high? Perhaps not high enough? It's the same as your crap mIRC code...<br><br>Without knowing what-the-F you mean it's clear the blushing your doing indicates to me that any further help you will receive will fall on deaf ears. Good day sir.. <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=8138">speechles</a> — Sun Aug 16, 2009 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T11:36:36-04:00</updated>

		<published>2009-08-16T11:36:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89909#p89909</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89909#p89909"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89909#p89909"><![CDATA[
It works like arfer's script.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 11:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-16T11:28:44-04:00</updated>

		<published>2009-08-16T11:28:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89908#p89908</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89908#p89908"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89908#p89908"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !something somethingproc something {nick uhost hand chan text} {  set firstword [lindex [split $text] 0]  if {![string match "*!*@*" $firstword]} {    if {[string match "*!*" $firstword] || [string match "*@*" $firstword]} {      putserv "privmsg $chan :Wrong format" ; return    }    putserv "privmsg $chan :It will be used as nickname"  } else {    putserv "privmsg $chan :It will be used as hostname"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Aug 16, 2009 11:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T10:50:35-04:00</updated>

		<published>2009-08-16T10:50:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89907#p89907</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89907#p89907"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89907#p89907"><![CDATA[
lol<br><br>But how can i check if ! and @ there is no?<br><br>I dont know if you know mirc scripting, but i wanted something like:<br><div class="codebox"><p>Code: </p><pre><code>  if (! !isin $1 &amp;&amp; @ !isin $1) {    msg # It will be used as nickname  }  elseif (! isin $1 &amp;&amp; @ isin $1) {    msg # It will be used as hostname  }  else {    msg # Wrong format  }</code></pre></div>i am new in tcl.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 10:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-16T10:40:55-04:00</updated>

		<published>2009-08-16T10:40:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89906#p89906</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89906#p89906"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89906#p89906"><![CDATA[
From the information given so far, its time to try yourself<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Aug 16, 2009 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T10:31:28-04:00</updated>

		<published>2009-08-16T10:31:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89905#p89905</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89905#p89905"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89905#p89905"><![CDATA[
And how to check if there is no <strong class="text-strong">!</strong> and <strong class="text-strong">@</strong>? because it is for a nickname/hostname ban script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 10:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-16T10:15:37-04:00</updated>

		<published>2009-08-16T10:15:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89904#p89904</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89904#p89904"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89904#p89904"><![CDATA[
Be very careful with our use of variable names. That applies to both my code and that of TCL_no_TK.<br><br>TCL_no_TK code is exactly correct except that $uhost is frequently used in eggdrop scripts to represent user@host and not nick!user@host in which case it would never pass the string match test.<br><br>In my code I use the variable name nick in the scan command. This variable name is widely used in scripts, say for example passed to a proc by a PUB bind. You would therefore have to choose an alternative name if my code was used inside such a proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Aug 16, 2009 10:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-16T09:44:39-04:00</updated>

		<published>2009-08-16T09:44:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89902#p89902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89902#p89902"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89902#p89902"><![CDATA[
It would be easy enough to check if ! and @ were present in a string AND in the correct order using regexp or string match commands but my choice would be to generally use a scan command. This is because it can simultaneously seperate out the nick, user and host components for use later in the code. A regexp command could do the same but I prefer scan.<br><div class="codebox"><p>Code: </p><pre><code>if {[scan $hostname {%[^!]!%[^@]@%s} nick user host] == 3} {  # $hostname is in the format nick!user@host  # additionally $nick, $user and $host can be used here in any further code} else {  # $hostname is not in the format nick!user@host}</code></pre></div>Example :-<br><br>&lt;arfer&gt; % return [scan "arfer!<a href="mailto:peter@i.play.for.england.com">peter@i.play.for.england.com</a>" {%[^!]!%[^@]@%s} nick user host]<br>&lt;Baal&gt; 3<br>&lt;arfer&gt; % return $nick<br>&lt;Baal&gt; arfer<br>&lt;arfer&gt; % return $user<br>&lt;Baal&gt; peter<br>&lt;arfer&gt; % return $host<br>&lt;Baal&gt; i.play.for.england.com<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Aug 16, 2009 9:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2009-08-16T09:35:39-04:00</updated>

		<published>2009-08-16T09:35:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89901#p89901</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89901#p89901"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89901#p89901"><![CDATA[
Can use <div class="codebox"><p>Code: </p><pre><code> if {![string match "*!*@*.*" $uhost]} { #not a valid hostmask}</code></pre></div> <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=8130">TCL_no_TK</a> — Sun Aug 16, 2009 9:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T08:42:35-04:00</updated>

		<published>2009-08-16T08:42:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89900#p89900</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89900#p89900"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89900#p89900"><![CDATA[
Thanks  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br>And, how to check if <strong class="text-strong">!</strong> and <strong class="text-strong">@</strong> are in a word? This is to check if is a invalid hostname or no.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 8:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-16T06:22:32-04:00</updated>

		<published>2009-08-16T06:22:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89898#p89898</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89898#p89898"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89898#p89898"><![CDATA[
You could use a string command<br><div class="codebox"><p>Code: </p><pre><code>if {[string index $chan 0] == "#"} {  # code here}</code></pre></div>Or possibly two string commands<br><div class="codebox"><p>Code: </p><pre><code>if {[string equal [string index $chan 0] "#"]} {  # code here}</code></pre></div>Or a regexp<br><div class="codebox"><p>Code: </p><pre><code>if {[regexp -- {^#} $chan]} {  # code here}</code></pre></div>Or, if the intended channel is supposed to be one of the bot's channels, an eggdrop tcl command will check if this is true. Generally, all channel names begin with a hash so without the hash it could not be a valid bot channel.<br><div class="codebox"><p>Code: </p><pre><code>if {[validchan $chan]} {  # code here}</code></pre></div><br>All the above assume the value of the variable chan (referenced by $chan) is the channel name to be checked<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Aug 16, 2009 6:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[McMilan]]></name></author>
		<updated>2009-08-16T05:36:39-04:00</updated>

		<published>2009-08-16T05:36:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89897#p89897</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89897#p89897"/>
		<title type="html"><![CDATA[Check letters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89897#p89897"><![CDATA[
Hi.<br><br>How can i check what is the first letter of a word?<br><br>What i mean is how to check if a word is a channel. Checking if its first letter is a <strong class="text-strong">#</strong><br><br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10539">McMilan</a> — Sun Aug 16, 2009 5:36 am</p><hr />
]]></content>
	</entry>
	</feed>
