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

	<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>2001-11-22T23:13:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2001-11-22T23:13:00-04:00</updated>

		<published>2001-11-22T23:13:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1922#p1922</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1922#p1922"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1922#p1922"><![CDATA[
actually that last one should be<br><div class="codebox"><p>Code: </p><pre><code>if {![botisop $chan]} { puthelp "NOTICE $nick :Sorry, i'm not op in $chan." return 0 } </code></pre></div>for slightly better cpu efficiency<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Thu Nov 22, 2001 11:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-11-22T22:07:00-04:00</updated>

		<published>2001-11-22T22:07:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1917#p1917</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1917#p1917"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1917#p1917"><![CDATA[
This is a much better version, but there are 1 or 2 oversights<br><div class="codebox"><p>Code: </p><pre><code>if {[lindex [split $arg] 0]==""} { if {[lindex [split $arg] 1]==""} { if {[lindex [split $arg] 0]==""} { puthelp "NOTICE $nick :Syntax: /msg $botnick KICK &lt;password&gt; &lt;channel&gt; &lt;nickname&gt; &lt;reason&gt;" return 0 }}} </code></pre></div>You do not need all these "if" statments, you should only need to do one if of<div class="codebox"><p>Code: </p><pre><code>if {$knick == ""} {</code></pre></div>Your use of "passwdok" is still incorect. If you read through tcl-commands.doc, you will find that you need to tell it the password the user is trying to send (this is common sence to. How can it tell that the password is correct, if you didn't give it the password.<br><br>Somthing like<div class="codebox"><p>Code: </p><pre><code>if {(![passwdok $hand $pass]) || (![passwdok $hand ""])} {</code></pre></div>This will check the users password is correct, and check if it is a blank password, if it's  balnk password, you tell them it's wrong, else you could have trouble on your hands.<br><br>change<div class="codebox"><p>Code: </p><pre><code>if {[strlwr $knick] == [strlwr $botnick]} { </code></pre></div>with<div class="codebox"><p>Code: </p><pre><code>if {[isbotnick $knick]} { </code></pre></div>for speed, and it's simpler.<br><div class="codebox"><p>Code: </p><pre><code>if {[botonchan $chan]==0} { puthelp "NOTICE $nick :Sorry, i'm not op in $chan." return 0 } </code></pre></div>Should actualy be<div class="codebox"><p>Code: </p><pre><code>if {[botisop $chan]==0} { puthelp "NOTICE $nick :Sorry, i'm not op in $chan." return 0 } </code></pre></div>Hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Nov 22, 2001 10:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blood_x]]></name></author>
		<updated>2001-11-22T14:46:00-04:00</updated>

		<published>2001-11-22T14:46:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1910#p1910</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1910#p1910"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1910#p1910"><![CDATA[
Dear PPSLIM,<br><br>I have made several changes in this script using your advice. The new script as belows;<br><br>bind msg o|o kick msg:kick<br><br>proc msg:kick {nick host hand chan arg} {<br>     global botnick<br>     set pass [lindex [split $arg] 0] <br>     set chan [lindex [split $arg] 1]<br>     set knick [lindex [split $arg] 2]<br>     set kreason [lrange [split $arg] 3 end]<br>     if {[lindex [split $arg] 0]==""} {<br>     if {[lindex [split $arg] 1]==""} {<br>     if {[lindex [split $arg] 0]==""} {<br>     puthelp "NOTICE $nick :Syntax: /msg $botnick KICK &lt;password&gt; &lt;channel&gt; &lt;nickname&gt; &lt;reason&gt;"<br>     return 0<br>     }}}<br>     if {[passwdok $hand]==""} {<br>     puthelp "NOTICE $nick :Sorry, Invalid Password"<br>     return 0<br>     }<br>     if {[validchan $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, I'm not monitoring $chan"<br>     return 0<br>     }<br>     if {[onchan $knick $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, I don't see $knick in $chan"<br>     return 0<br>     }<br>     if {[strlwr $knick] == [strlwr $botnick]} {<br>     puthelp "NOTICE $nick :Yeah right, u can't kick me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">"<br>     return 0<br>     }<br>     if {[matchattr [nick2hand $knick $chan] b]==1} {<br>     puthelp "NOTICE $nick :Sorry, u can't kick channel bot."<br>     return 0<br>     }<br>     if {[botonchan $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, i'm not op in $chan."<br>     return 0<br>     }<br>     else {<br>     if {$kreason == ""} {set kreason "requested by $nick} {<br>     putserv "KICK $chan $knick $kreason"<br>     puthelp "NOTICE $nick :You have kicked out by $nick"<br>     return 1<br>     }}<br>     }<br><br>putlog "Kick Message TCL by blood_x loaded"<br><br>Can u check it for me to finalize this script.<br><br>Thanks.<br><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=402">blood_x</a> — Thu Nov 22, 2001 2:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-11-22T12:50:00-04:00</updated>

		<published>2001-11-22T12:50:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1904#p1904</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1904#p1904"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1904#p1904"><![CDATA[
Just follow the advice pointed out in my previous post, and the script should work fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Nov 22, 2001 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blood_x]]></name></author>
		<updated>2001-11-22T12:20:00-04:00</updated>

		<published>2001-11-22T12:20:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1903#p1903</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1903#p1903"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1903#p1903"><![CDATA[
Thanks PPSLIm for the advice. <br>Can you help me to alter this script to be more secured with less bugs..<br><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=402">blood_x</a> — Thu Nov 22, 2001 12:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-11-22T09:40:00-04:00</updated>

		<published>2001-11-22T09:40:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1892#p1892</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1892#p1892"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1892#p1892"><![CDATA[
Yes,<br>if {[strlwr $knick == [strlwr $botnick]} { <br>should be<br>if {[strlwr $knick] == [strlwr $botnick]} { <br><br>Note, this script is full fo bugs.<br><br>in the proc declaration<br>proc msg:kick {nick host hand chan arg} { <br>you have the "chan" var defined, when there is no channel is a message.<br><br>You use "lindex" all the time on strings, when you should only do "lindex" on lists. To convert a string to a list, use the "split" command. This means<br>set pass [lindex $arg 0] <br>should be <br>set pass [lindex [split $arg] 0]<br><br>Note your use of the "passwdok" command.<br>if {[passwdok $hand]==0} { <br>You are passing it a hand but no password, thus it is not actualy checking anything. Note, if checking passwords, you need to do 2 passwdok checks. One to check if the password is blank, and another to check if a password is OK. This will prevent backdoors to the script.<br><br>Note your use of<br>if {[matchattr $hand o|o $chan]==0} { <br>This is not needed, as eggdrop checks for the required flag in the "bind" command<br>bind msg o|o kick msg:kick<br>Thus, the message it is set to output will never display.<br><div class="codebox"><p>Code: </p><pre><code>if {[matchattr $hand o|o $chan]==1} { if {[passwdok $hand]==1} { if {[validchan $chan]==1} { if {[onchan $knick]==1} { if {[botonchan $chan]==1} { if {$kreason == ""} {set reason "requested by $nick} putserv "KICK $chan $knick $kreason" puthelp "NOTICE $nick :You have kicked out by $nick" return 1 }}}} </code></pre></div>This block of code is just a waste of CPU time. You have done all these checks above, and thus all of these would pass, and is not required. Even this has bugs in.<br><br>You are using $kreason to for the kick reason, yet if it is blank, you try to set it to somthing. The name using in this somthing is "reason", which lookslike it's missing it's "k".<br><br>Second the command that sends a notice to a user saying he was kicked<br>puthelp "NOTICE $nick :You have kicked out by $nick"<br>This is actualy send a message to the person that told the bot to do the kick, and tell him he kicked himself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Nov 22, 2001 9:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-22T09:23:00-04:00</updated>

		<published>2001-11-22T09:23:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1891#p1891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1891#p1891"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1891#p1891"><![CDATA[
locate this line<br>if {[strlwr $knick == [strlwr $botnick]} { <br><br>it's missing a ] (closing-bracket)<br><p>Statistics: Posted by Guest — Thu Nov 22, 2001 9:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blood_x]]></name></author>
		<updated>2001-11-22T08:36:00-04:00</updated>

		<published>2001-11-22T08:36:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1890#p1890</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1890#p1890"/>
		<title type="html"><![CDATA[Kick Message TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1890#p1890"><![CDATA[
Hi there,<br><br>Yesterday I have wrote kick message tcl as belows;<br><br>bind msg o|o kick msg:kick<br><br>proc msg:kick {nick host hand chan arg} {<br>     global botnick<br>     set pass [lindex $arg 0]<br>     set chan [lindex $arg 1]<br>     set knick [lindex $arg 2]<br>     set kreason [lrange $arg 3 end]<br>     if {[lindex $arg 0]==""} {<br>     if {[lindex $arg 1]==""} {<br>     if {[lindex $arg 2]==""} {<br>     puthelp "NOTICE $nick :Syntax: /msg $botnick KICK &lt;password&gt; &lt;channel&gt; &lt;nickname&gt; &lt;reason&gt;"<br>     return 0<br>     }}}<br>     if {[passwdok $hand]==0} {<br>     puthelp "NOTICE $nick :Sorry, Invalid Password"<br>     return 0<br>     }<br>     if {[matchattr $hand o|o $chan]==0} {<br>     puthelp "NOTICE $nick :You don't have access to perform this command."<br>     return 0<br>     }<br>     if {[validchan $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, I'm not monitoring $chan"<br>     return 0<br>     }<br>     if {[onchan $knick $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, I don't see $knick in $chan"<br>     return 0<br>     }<br>     if {[strlwr $knick == [strlwr $botnick]} {<br>     puthelp "NOTICE $nick :Yeah right, u can't kick me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile">"<br>     return 0<br>     }<br>     if {[matchattr [nick2hand $knick $chan] b]==1} {<br>     puthelp "NOTICE $nick :Sorry, u can't kick channel bot."<br>     return 0<br>     }<br>     if {[botonchan $chan]==0} {<br>     puthelp "NOTICE $nick :Sorry, i'm not op in $chan."<br>     return 0<br>     }<br>     if {[matchattr $hand o|o $chan]==1} {<br>     if {[passwdok $hand]==1} {<br>     if {[validchan $chan]==1} {<br>     if {[onchan $knick]==1} {<br>     if {[botonchan $chan]==1} {<br>     if {$kreason == ""} {set reason "requested by $nick}<br>     putserv "KICK $chan $knick $kreason"<br>     puthelp "NOTICE $nick :You have kicked out by $nick"<br>     return 1<br>     }}}}<br>     }<br><br>putlog "Kick Message TCL by blood_x loaded"<br><br>Then, when I'm trying to run it this message appears 'TCL error [msg:kick]: missing close-bracket'. Can someone help me to figure out this script?<br><br>Thanks.<br><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=402">blood_x</a> — Thu Nov 22, 2001 8:36 am</p><hr />
]]></content>
	</entry>
	</feed>
