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

	<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>2007-06-28T22:17:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-06-28T22:17:48-04:00</updated>

		<published>2007-06-28T22:17:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73998#p73998</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73998#p73998"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73998#p73998"><![CDATA[
<blockquote class="uncited"><div>&lt;|EGG&gt; Currently:    if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {</div></blockquote>The eggdrop is telling you the offending line here, you haven't closed this conditional before closing the procedure. Just change the last part of the s:day proc like this:<div class="codebox"><p>Code: </p><pre><code>          return 0          }        }    }    }}</code></pre></div>Indentation done to match position of your double stacked if statements that start the procedure.<blockquote class="uncited"><div>ok, sorry for that I was just asking, didn`t know what that string will do. </div></blockquote>Sorry for what? That the advice I gave you was in a tone that led you to believe your question upset me?...hahah..  It's just that remedial questions (questions easily solved just by reading tcl commands docs) usually get sterner answers than something truly complex.  So figured I would chime in to explain that you were incorrect in your interpretation of the logic behind that code nml375 gave you, before I explained your other issues.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jun 28, 2007 10:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-28T21:59:02-04:00</updated>

		<published>2007-06-28T21:59:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73997#p73997</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73997#p73997"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73997#p73997"><![CDATA[
ok, sorry for that I was just asking, didn`t know what that string will do.<br>so, I`ve made the changes like you suggested and now I`m getting this error wen I`m trying to load the script:<br><blockquote class="uncited"><div>&lt;me&gt; .tcl source scripts/lol.tcl<br>&lt;@|EGG&gt; Error: missing close-brace: possible unbalanced brace in comment - 41.84 ms</div></blockquote>and on the dcc-chat:<blockquote class="uncited"><div>&lt;me&gt; .set errorInfo<br>&lt;|EGG&gt; Currently: missing close-brace: possible unbalanced brace in comment<br>&lt;|EGG&gt; Currently:     while executing<br>&lt;|EGG&gt; Currently: "proc s:day {nick uhost hand chan text} {<br>&lt;|EGG&gt; Currently:  global botnick dj<br>&lt;|EGG&gt; Currently:    if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {<br>&lt;|EGG&gt; Currently:    if {[matchattr $hand n|MASD..."<br>&lt;|EGG&gt; Currently:     (file "scripts/lol.tcl" line <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><br>&lt;|EGG&gt; Currently:     invoked from within<br>&lt;|EGG&gt; Currently: "source scripts/lol.tcl"<br>&lt;|EGG&gt; Currently:     ("eval" body line 1)<br>&lt;|EGG&gt; Currently:     invoked from within<br>&lt;|EGG&gt; Currently: "eval $args"</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Thu Jun 28, 2007 9:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-06-28T20:25:26-04:00</updated>

		<published>2007-06-28T20:25:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73995#p73995</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73995#p73995"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73995#p73995"><![CDATA[
It's so obviously simple how to do this.  Your missing minor logic first and need to look back..<blockquote class="uncited"><div>if {![string is -strict integer $target] || $target &gt;= 15 || $target &lt;= 0} {</div></blockquote>You said, "doesn`t than mean number form 0 to 15 ?"  Quite the opposite, it means string not an integer -or- the value is less than or equal to 0 -or- the value is larger than or equal to 15. This is where you would write your standard error message checks to explain to that user what they did wrong, too long, too short, not a number, etc.. it's simple input sanitizing, and in this situation simple is best.<br><br>...and about your error, since the bind isn't calling your s:day:ban proc directly and your invoking it within an already bound proc, you can pass it added parameters easily, meaning.. you can just shove them into passing calls.. like below.. just modify your s:day proc like so:<div class="codebox"><p>Code: </p><pre><code>             # the line below should replace the regexp line presently used             # if {[string is -strict integer $item] || $item &lt;= 14 || $item &gt;= 1} {             # if you insist on using that dirty regexp, remove the line above or you will get unbalanced brace error             if {![regexp "\[^0-14\]" $item]} {              # the set line below can be removed, and change $days to $item in the s:day:ban call              set days $item              s:day:ban $nick $uhost $hand $chan $days $text              .. rest is here..</code></pre></div>then, your s:day:ban proc needs to be changed like this:<div class="codebox"><p>Code: </p><pre><code>proc s:day:ban {nick uhost hand chan days text} {.. rest continues the same ... </code></pre></div>It's easier to understand code if your able to understand it's logic as well. You should follow nml375's advice, as your regexp's are not having their intended purpose in your script and are highly exploitable by lower level ops.<br><br>and finally, just as a ps.. heh, type <strong class="text-strong">.echo off</strong> on your partyline so you don't get those #echo# messages after everything..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jun 28, 2007 8:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-28T20:03:05-04:00</updated>

		<published>2007-06-28T20:03:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73994#p73994</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73994#p73994"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73994#p73994"><![CDATA[
Later UPDATE:<div class="codebox"><p>Code: </p><pre><code>set dj(br) "Banned!"set dj(xb) 1bind pub n|MASDTO !d s:daysetudef flag djtoolsproc s:day {nick uhost hand chan text} { global botnick dj   if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {   if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {     set target [lindex [split $text] 0]        if {![botisop $chan]} {        puthelp "NOTICE $nick :Error I don't have OP!"        return 0        } elseif {[matchattr $hand -|T $chan]} {          if {$target == ""} {          puthelp "NOTICE $nick :SYNTAX:\002 !d &lt;1-14&gt; &lt;nick|*!*@host&gt; \[reason\] \002"          return 0          }          } else {          foreach not $target {              if {![string is -strict integer $target] || $target &gt;= 15 || $target &lt;= 0} {              puthelp "NOTICE $nick :Error max allowed 1-14 days for Test OP Access Users"              return 0              }            }          }          set options $target          foreach item $options {          if {![regexp "\[^0-14\]" $item]} {            set days $item            s:day:ban $nick $uhost $hand $chan $text          return 0          }        }        } elseif {[matchattr $hand -|O $chan]} {          if {$target == ""} {          puthelp "NOTICE $nick :SYNTAX:\002 !d &lt;1-7&gt; &lt;nick|*!*@host&gt; \[reason\] \002"          return 0          }          } else {          foreach not $target {              if {![string is -strict integer $target] || $target &gt;= 8 || $target &lt;= 0} {              puthelp "NOTICE $nick :Error max allowed 1-7 days for OP Access Users"              return 0              }            }          }          set options $target          foreach item $options {          if {![regexp "\[^0-7\]" $item]} {            set days $item            s:day:ban $nick $uhost $hand $chan $text          return 0          }        }    }}proc s:day:ban {nick uhost hand chan text} { global botnick dj   if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {        set type [lindex [split $text] 1]        set dtype [nick2hand $type]        set reason [join [lrange [split $text] 3 end]]          if {$reason == ""} {          set reason $dj(br)          }          if {[string match *!*@* $type]} {          set dhost $type          } else {          set dhost "*!*@[lindex [split [getchanhost $type] @] 2]"          }          if {![matchattr $dtype n|MASDTOVU $chan] &amp;&amp; ![isop $type $chan] &amp;&amp; ![isvoice $type $chan] &amp;&amp; ![matchattr $dtype b]} {            newchanban $chan $dhost days "($hand) $reason" [expr $days * 1440]            putquick "MODE $chan +b $dhost"            putquick "KICK $chan $type :($hand) $reason"            if {$dj(xb) == 1} {            putquick "PRIVMSG X :ban $chan $dhost 1 100 ($hand) $reason" -next            }            newignore $dhost days "($hand) $reason"          return 0        }    }}</code></pre></div>I`ve made some changes and reorder the script and I`m getting this error on dcc-chat:<br><blockquote class="uncited"><div>&lt;|EGG&gt; [01:01] Tcl error [s:day]: can't read "days": no such variable</div></blockquote><blockquote class="uncited"><div>&lt;me&gt; .set errorInfo<br>&lt;|EGG&gt; [01:02] #me# set errorInfo<br>&lt;|EGG&gt; Currently: can't read "days": no such variable<br>&lt;|EGG&gt; Currently:     while executing<br>&lt;|EGG&gt; Currently: "expr $days * 1440"<br>&lt;|EGG&gt; Currently:     (procedure "s:day:ban" line 16)<br>&lt;|EGG&gt; Currently:     invoked from within<br>&lt;|EGG&gt; Currently: "s:day:ban $nick $uhost $hand $chan $text"<br>&lt;|EGG&gt; Currently:     (procedure "s:day" line 26)<br>&lt;|EGG&gt; Currently:     invoked from within<br>&lt;|EGG&gt; Currently: "s:day $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"</div></blockquote>How to I make the second proc to recognize a variable form the first proc ?!<br>In this case, this one : <br><div class="codebox"><p>Code: </p><pre><code>proc s:day {nick uhost hand chan text} {(...)          set days $item          s:day:ban $nick $uhost $hand $chan $text          return 0(...)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Thu Jun 28, 2007 8:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-28T19:30:40-04:00</updated>

		<published>2007-06-28T19:30:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73993#p73993</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73993#p73993"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73993#p73993"><![CDATA[
<blockquote class="uncited"><div>I would probably use something like this:<div class="codebox"><p>Code: </p><pre><code>if {![string is -strict integer $target] || $target &gt;= 15 || $target &lt;= 0} {</code></pre></div></div></blockquote>good idea, but... it didn`t work  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br>I`ve used that code, and there is no reaction if the number is higher than 7 ( for user with OP Access) and 14 ( for user with Test OP Access) .... the user didn`t get the warning notice.<br>I`ve also tested the script with this ( the first pieces of codes):<br><div class="codebox"><p>Code: </p><pre><code>if {![regexp "\[^8-99999\]" $target} {</code></pre></div> <br>and<div class="codebox"><p>Code: </p><pre><code>if {![regexp "\[^15-99999\]" $target} {</code></pre></div>  <br><br>...still no reaction from the bot ( no notice )<blockquote class="uncited"><div>&lt;@OP&gt; !d<br>-|EGG- SYNTAX: !d &lt;1-7&gt; &lt;nick|*!*@host&gt; [reason] <br>&lt;@OP&gt; !d 8 *!*@*.test.ro<br>&lt;@OP&gt; !d 7 *!*@*.test.ro<br>* |EGG sets mode: +b *!*@*.test.ro<br>&lt;me&gt; .tcl killchanban #chan *!*@*.test.ro<br>&lt;@|EGG&gt; OK: 1 - 0.246 ms<br>* |EGG sets mode: -b *!*@*.test.ro</div></blockquote>and the same thing happends for a nother user with a higher access flag to the bot <blockquote class="uncited"><div>&lt;@TestOP&gt; !d<br>-|EGG- SYNTAX: !d &lt;1-14&gt; &lt;nick|*!*@host&gt; [reason] <br>&lt;@TestOP&gt; !d 15 *!*@*.test.ro<br>&lt;@TestOP&gt; !d 100 *!*@*.test.ro<br>&lt;@TestOP&gt; !d 14 *!*@*.test.ro<br>* |EGG sets mode: +b *!*@*.test.ro<br>&lt;me&gt; .tcl killchanban #chan *!*@*.test.ro<br>&lt;@|EGG&gt; OK: 1 - 0.246 ms<br>* |EGG sets mode: -b *!*@*.test.ro</div></blockquote>btw nm375, this piece of code:<br><div class="codebox"><p>Code: </p><pre><code>if {![string is -strict integer $target] || $target &gt;= 15 || $target &lt;= 0} {</code></pre></div>doesn`t than mean number form 0 to 15 ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_exclaim.gif" width="15" height="15" alt=":!:" title="Exclamation"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Thu Jun 28, 2007 7:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-27T16:04:03-04:00</updated>

		<published>2007-06-27T16:04:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73944#p73944</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73944#p73944"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73944#p73944"><![CDATA[
I would probably use something like this:<div class="codebox"><p>Code: </p><pre><code>if {![string is -strict integer $target] || $target &gt;= 15 || $target &lt;= 0} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 27, 2007 4:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-28T14:07:02-04:00</updated>

		<published>2007-06-27T13:44:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73940#p73940</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73940#p73940"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73940#p73940"><![CDATA[
<blockquote class="uncited"><div>In my opinion, the number of spaces/tabs per level is'nt that important, what is however, is using the same fashion all through the script, ie. add one space/tab for each level you descend, as illustrated by rosc.<br><br>Also, I'm not sure those regular expressions you're using actually does what you intended, ie:<div class="codebox"><p>Code: </p><pre><code>if {![regexp "\[^15-99999\]" $target} {</code></pre></div>This will match anything starting with the number 1, 5, 6, 7, 8, 9 (such as 1, 10, 19, 91, but not 20). Probably not what you intended.</div></blockquote>Ok, thanks for the ie, but if this code <br><div class="codebox"><p>Code: </p><pre><code>if {![regexp "\[^15-99999\]" $target]} {</code></pre></div>doesn`t except the numbers between 1 to 14 ( that ar the numbers that a specifyed user level will use with the !day command ), what should I use to except numbers form 1 to 14 and for the rest of the numbers to give that notice to the user ( in hope that the user will type the correct number based on his access level )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Wed Jun 27, 2007 1:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-27T11:52:32-04:00</updated>

		<published>2007-06-27T11:52:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73935#p73935</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73935#p73935"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73935#p73935"><![CDATA[
In my opinion, the number of spaces/tabs per level is'nt that important, what is however, is using the same fashion all through the script, ie. add one space/tab for each level you descend, as illustrated by rosc.<br><br>Also, I'm not sure those regular expressions you're using actually does what you intended, ie:<div class="codebox"><p>Code: </p><pre><code>if {![regexp "\[^15-99999\]" $target} {</code></pre></div>This will match anything starting with the number 1, 5, 6, 7, 8, 9 (such as 1, 10, 19, 91, but not 20). Probably not what you intended.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 27, 2007 11:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-06-27T10:06:59-04:00</updated>

		<published>2007-06-27T10:06:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73927#p73927</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73927#p73927"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73927#p73927"><![CDATA[
Here's a huge bit of help: Properly TABINATE your scripts...  Then you'd be able to see where missing junk is:<div class="codebox"><p>Code: </p><pre><code>if {this is my first test} {        #tab} else {        if {this is my 2nd test} {                 # tab tab        } else {                  if {this makes it much easier to figure things out} {                             # tab tab tab                 }        }}</code></pre></div>Yes I know tabs are a matter of style, but if you're having that much difficulty as a beginner, then learn good coding habits, which begin with TABS (and using small fonts/wider screens so you can read 300+ char length lines because of deeply nested if's/tabs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">  And if your editor allows you to configure tab stops, set it to 4 spaces, not 2, which also makes it easier to read..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed Jun 27, 2007 10:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-27T08:09:59-04:00</updated>

		<published>2007-06-27T08:09:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73924#p73924</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73924#p73924"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73924#p73924"><![CDATA[
This time you're lacking some brackets ([]), check this line again:<div class="codebox"><p>Code: </p><pre><code>     if {![regexp "\[^15-99999\]" $target} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 27, 2007 8:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-26T20:12:44-04:00</updated>

		<published>2007-06-26T20:12:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73918#p73918</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73918#p73918"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73918#p73918"><![CDATA[
UPDATE:<br><br>I`ve closed the missing " <strong class="text-strong">}</strong> " form the foreach-loop and simplifyed the script for only 1 access flags... to make it a little easy for the script to work...<br><br>so here is the code ( simplifyed ):<br><div class="codebox"><p>Code: </p><pre><code>set dj(br) "Banned!"set dj(xp) 1bind pub n|MASDTO !day s:bansetudef flag djtoolsproc s:ban {nick uhost hand chan text} { global botnick dj   if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {   if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {     set target [lindex [split $text] 0]        if {![botisop $chan]} {        puthelp "NOTICE $nick :Error I don't have OP!"        return 0        } elseif {[matchattr $hand -|T $chan]} {          if {$target == ""} {          puthelp "NOTICE $nick :SYNTAX:\002 .d &lt;1-14&gt; &lt;nick|*!*@host&gt; \[reason\] \002"          return 0          }          } else {          foreach not $target {              if {![regexp "\[^15-99999\]" $target} {              puthelp "NOTICE $nick :Error max allowed 1-14 days for Test DJ Access Users"              return 0              }            }          }          set options $target             foreach item $options {             if {![regexp "\[^0-14\]" $item]} {             set days $item             set type [lindex [split $text] 1]             set dtype [nick2hand $type]             set reason [join [lrange [split $text] 3 end]]               if {$reason == ""} {               set reason $dj(br)               }             if {[string match *!*@* $type]} {             set dhost $type             } else {             set dhost "*!*@[lindex [split [getchanhost $type] @] 2]"             }             if {![matchattr $dtype n|MASDTOVU $chan] &amp;&amp; ![isop $type $chan] &amp;&amp; ![isvoice $type $chan] &amp;&amp; ![matchattr $dtype b]} {             newchanban $chan $dhost days "($hand) $reason" [expr $days * 1440]             putquick "MODE $chan +b $dhost"             putquick "KICK $chan $type :($hand) $reason"             if {$dj(xb) == 1} {             putquick "PRIVMSG X :ban $chan $dhost 1 100 ($hand) $reason" -next             }             newignore $dhost days "($hand) $reason"            return 0            }        }      }    }  }}</code></pre></div>and I`m still getting this error on dcc ..<br><blockquote class="uncited"><div>&lt;|EGG&gt; [01:35] Tcl error [s:ban]: missing close-bracket</div></blockquote>and on the .set errorInfo I get this<br><blockquote class="uncited"><div>&lt;me&gt; .set errorInfo<br>&lt;|EGG&gt; [01:35] #me# set errorInfo<br>&lt;|EGG&gt; Currently: missing close-bracket<br>&lt;|EGG&gt; Currently:     ("if" test expression)<br>&lt;|EGG&gt; Currently:     while compiling<br>&lt;|EGG&gt; Currently: "if {![regexp "\[^15-99999\]" $target} {<br>&lt;|EGG&gt; Currently:               puthelp "NOTICE $nick :Error max allowed 1-14 days for Test DJ Access Users"<br>&lt;|EGG&gt; Currently:               retur..."<br>&lt;|EGG&gt; Currently:     ("foreach" body line 2)<br>&lt;|EGG&gt; Currently:     while compiling<br>&lt;|EGG&gt; Currently: "foreach not $target {<br>&lt;|EGG&gt; Currently:               if {![regexp "\[^15-99999\]" $target} {<br>&lt;|EGG&gt; Currently:               puthelp "NOTICE $nick :Error max allowed 1-14 days for Test ..."<br>&lt;|EGG&gt; Currently:     ("if" else script line 2)<br>&lt;|EGG&gt; Currently:     while compiling<br>&lt;|EGG&gt; Currently: "if {![botisop $chan]} {<br>&lt;|EGG&gt; Currently:         puthelp "NOTICE $nick :Error I don't have OP!"<br>&lt;|EGG&gt; Currently:         return 0<br>&lt;|EGG&gt; Currently:         } elseif {[matchattr $hand -|T $chan]} {<br>&lt;|EGG&gt; Currently:      ..."<br>&lt;|EGG&gt; Currently:     ("if" then script line 3)<br>&lt;|EGG&gt; Currently:     while compiling<br>&lt;|EGG&gt; Currently: "if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {<br>&lt;|EGG&gt; Currently:      set target [lindex [split $text] 0]<br>&lt;|EGG&gt; Currently:         if {![botisop $chan]} {<br>&lt;|EGG&gt; Currently:         put..."<br>&lt;|EGG&gt; Currently:     ("if" then script line 2)<br>&lt;|EGG&gt; Currently:     while compiling<br>&lt;|EGG&gt; Currently: "if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {<br>&lt;|EGG&gt; Currently:    if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {<br>&lt;|EGG&gt; Currently:      set target [lindex ..."<br>&lt;|EGG&gt; Currently:     (compiling body of proc "s:ban", line 3)<br>&lt;|EGG&gt; Currently:     invoked from within<br>&lt;|EGG&gt; Currently: "s:ban $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"</div></blockquote>I`m suppose that my code is a little more complicated and has a lot of if-elseif-else commands in it and maybe that`s why it makes it hard to solve, and I`ll really appreciate is someone helps me to make this script a little more simple than... and also to make it work...<br><br>I`ve pointed that I want this script to do something like this:<br><blockquote class="uncited"><div>For OP access user ( +O flag )<br><br>&lt;OP&gt; !day 7 *!*@*.test.ro<br>* |EGG sets mode: +b *!*@*.test.ro<br><br>How it works:<br>- sets a chan ban for 1 or 7 days on the banmask with a default ban reason; <br>- if the OP will type a number higher than 7, like 8 or 9 or 100, the BOT will <span style="color:red"><strong class="text-strong">NOT</strong></span> do the chan ban and will give the specific notice (puthelp "NOTICE $nick :Error <span style="color:red">max allowed 1-7 days</span> for OP Access Users");<br><br>For Test OPs access user ( +T flag )<br><br>&lt;TestOP&gt; !day 14 *!*@*.test.ro<br>* |EGG sets mode: +b *!*@*.test.ro<br>How it works:<br>- sets a chan ban for 1 or 14 days on the banmask with a default ban reason; <br>- if the OP will type a number higher than 14, like 15 or 16 or 100, the BOT will <span style="color:red"><strong class="text-strong">NOT</strong></span> do the chan ban and will give the specific notice (puthelp "NOTICE $nick :Error <span style="color:red">max allowed 1-14 days</span> for Test OP Access Users");<br><br>(...)</div></blockquote>and so on for the other flags... the higher the access flag, the more day's you can add to the banmask <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><br><br>It`s a complicated code I`m trying to make... at least I`m trying <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> ( my tcl knowledge are at the beginning <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"> ) ...so any help will be appreciated. Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Tue Jun 26, 2007 8:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-26T19:07:16-04:00</updated>

		<published>2007-06-26T19:07:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73916#p73916</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73916#p73916"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73916#p73916"><![CDATA[
You've got a missing } after that foreach-loop, you only closed the if-conditional inside and not the foreach-loop itself.<br><br>It would also seem this is the case on several other locations.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jun 26, 2007 7:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-26T19:00:56-04:00</updated>

		<published>2007-06-26T19:00:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73915#p73915</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73915#p73915"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73915#p73915"><![CDATA[
ok, removed the "unbind`s".. now I`m getting this error..<br><div class="codebox"><p>Code: </p><pre><code>(01:57:38) &lt;me&gt; .set errorInfo(01:57:38) &lt;|EGG&gt; [00:39] #me# set errorInfo(01:57:38) &lt;|EGG&gt; Currently: wrong # args: should be "foreach varList list ?varList list ...? command"(01:57:38) &lt;|EGG&gt; Currently:     while compiling(01:57:38) &lt;|EGG&gt; Currently: "foreach not $target {(01:57:38) &lt;|EGG&gt; Currently:            if {![regexp "\[^101-99999\]" $target} {(01:57:38) &lt;|EGG&gt; Currently:            puthelp "NOTICE $nick :Error max allowed 1-100 days for Administr..."(01:57:38) &lt;|EGG&gt; Currently:     ("if" else script line 2)(01:57:38) &lt;|EGG&gt; Currently:     while compiling(01:57:38) &lt;|EGG&gt; Currently: "if {$target == ""} {(01:57:38) &lt;|EGG&gt; Currently:          puthelp "NOTICE $nick :SYNTAX:\002 .d &lt;1-100&gt; &lt;nick|*!*@host&gt; \[reason\] \002"(01:57:38) &lt;|EGG&gt; Currently:          return 0(01:57:38) &lt;|EGG&gt; Currently:          } else {(01:57:38) &lt;|EGG&gt; Currently:      ..."(01:57:38) &lt;|EGG&gt; Currently:     ("if" then script line 2)(01:57:38) &lt;|EGG&gt; Currently:     while compiling(01:57:38) &lt;|EGG&gt; Currently: "if {![botisop $chan]} {(01:57:38) &lt;|EGG&gt; Currently:         puthelp "NOTICE $nick :Error I don't have OP!"(01:57:38) &lt;|EGG&gt; Currently:         } elseif {[matchattr $hand n|-]} {(01:57:38) &lt;|EGG&gt; Currently:         if {$target == ""} {..."(01:57:38) &lt;|EGG&gt; Currently:     ("if" then script line 3)(01:57:38) &lt;|EGG&gt; Currently:     while compiling(01:57:38) &lt;|EGG&gt; Currently: "if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {(01:57:38) &lt;|EGG&gt; Currently:      set target [lindex [split $text] 0](01:57:38) &lt;|EGG&gt; Currently:         if {![botisop $chan]} {(01:57:38) &lt;|EGG&gt; Currently:         put..."(01:57:38) &lt;|EGG&gt; Currently:     ("if" then script line 2)(01:57:38) &lt;|EGG&gt; Currently:     while compiling(01:57:38) &lt;|EGG&gt; Currently: "if {[channel get $chan djtools] &amp;&amp; ![isbotnick $nick]} {(01:57:38) &lt;|EGG&gt; Currently:    if {[matchattr $hand n|MASDTO $chan] || [string tolower $chan]} {(01:57:38) &lt;|EGG&gt; Currently:      set target [lindex ..."(01:57:38) &lt;|EGG&gt; Currently:     (compiling body of proc "s:ban", line 3)(01:57:38) &lt;|EGG&gt; Currently:     invoked from within(01:57:38) &lt;|EGG&gt; Currently: "s:ban $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"(01:58:25) &lt;|EGG&gt; [00:40] @#¹¾ (+stn) : [m/8 o/8 h/0 v/0 n/0 b/0 e/- I/-]</code></pre></div>Suggestions ?!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Tue Jun 26, 2007 7:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-06-23T21:34:27-04:00</updated>

		<published>2007-06-23T21:34:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73850#p73850</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73850#p73850"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73850#p73850"><![CDATA[
Try reading eggdrop.conf. Sir_Fz said to use '.set errorInfo' not run another script.<blockquote class="uncited"><div># Comment these two lines if you wish to enable the .tcl and .set commands.<br># If you select your owners wisely, you should be okay enabling these.<br>unbind dcc n tcl *dcc:tcl<br>unbind dcc n set *dcc:set</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sat Jun 23, 2007 9:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-06-23T21:04:06-04:00</updated>

		<published>2007-06-23T21:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73849#p73849</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73849#p73849"/>
		<title type="html"><![CDATA[Help with a command code (!day):]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73849#p73849"><![CDATA[
<blockquote class="uncited"><div>.set errorInfo?</div></blockquote><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_exclaim.gif" width="15" height="15" alt=":!:" title="Exclamation"><br><br>do you mean if I use this script ?! <br><div class="codebox"><p>Code: </p><pre><code># .load scriptname.tclbind dcc n|- load script:loadproc script:load { handle idx text } {   if { [catch { uplevel #0 [list source scripts/$text] } error] } {      putlog "0,4Error while loading $text -- Errormsg: $error"      putlog "script: $text -- ::errorInfo: $::errorInfo"      return   }   putlog "script: $text -- loaded without errors."   return}</code></pre></div>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Sat Jun 23, 2007 9:04 pm</p><hr />
]]></content>
	</entry>
	</feed>
