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

	<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-12-05T11:24:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-12-05T11:24:00-04:00</updated>

		<published>2001-12-05T11:24:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2466#p2466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2466#p2466"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2466#p2466"><![CDATA[
I got up a little easrly today.<br><div class="codebox"><p>Code: </p><pre><code>if {[llength [split $arg]] &lt; 2} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Dec 05, 2001 11:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-05T10:54:00-04:00</updated>

		<published>2001-12-05T10:54:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2464#p2464</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2464#p2464"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2464#p2464"><![CDATA[
Err ppslim, it doesn't seems to work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"> I replaced the line to<br><blockquote class="uncited"><div>if {([llength [split $arg]] &gt; 2) || ([llength [split $arg]] &lt; 2)}</div></blockquote>which you recommended but it still doesn't work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"> I type !kick nickname out you go and it showed the Syntax <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><p>Statistics: Posted by Guest — Wed Dec 05, 2001 10:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-12-05T07:55:00-04:00</updated>

		<published>2001-12-05T07:55:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2455#p2455</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2455#p2455"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2455#p2455"><![CDATA[
<blockquote class="uncited"><div>if {[llength [split $arg]] &gt; 8} {</div></blockquote>This line here is causing the problems.<br><br>change it to<blockquote class="uncited"><div>if {([llength [split $arg]] &gt; 2) || ([llength [split $arg]] &lt; 2)} {</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Dec 05, 2001 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-05T05:05:00-04:00</updated>

		<published>2001-12-05T05:05:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2450#p2450</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2450#p2450"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2450#p2450"><![CDATA[
Ok ppslim, I'll look through that post. Next, I've got a problem. This is my first attempt in TCL programming and I'm not too sure about the spilt strings.<br><br>I've got this part of the script<blockquote class="uncited"><div>bind pub o "[rmschar]kick" pub:kick<br>proc pub:kick {nick uhost hand chan arg} {<br>  global botnick rmskick rmsquote<br>  set kuser [string tolower [lindex $arg 0]]<br>  set reason [lrange $arg 1 end]<br>  set chkuser [nick2hand $kuser $chan]<br>  if {[lindex $arg 0] == "-help"} {<br>     puthelp "NOTICE $nick :02[rmschar]KICK02"<br>     puthelp "NOTICE $nick :Flags...: o"<br>     puthelp "NOTICE $nick :Syntax..: [rmschar]Kick &lt;nick&gt; &lt;reason&gt;"<br>     puthelp "NOTICE $nick :0303"<br>     puthelp "NOTICE $nick :Info....: Kicks a user out of the channel"<br>     return 0<br>     }<br>  if {[llength [split $arg]] &gt; 8} {<br>     puthelp "NOTICE $nick :** Syntax: [rmschar]Kick &lt;nick&gt; &lt;reason&gt;"<br>     return 0<br>     }<br>  if {$kuser == [string tolower $botnick]} {<br>     puthelp "NOTICE $nick :Cannot kick myself"<br>     return 0<br>     }<br>  if {[matchattr $chkuser +m] == 1} {<br>     putserv "NOTICE $nick :Cannot kick +m flags"<br>     return 0<br>     }<br>  if {$reason == ""} {<br>     putserv "KICK $chan $kuser :$rmskick"<br>     putlog "&lt;$nick&gt; requested kick on $chan to $kuser with default reason"<br>     return 0<br>     }<br>  set rmsqt [lindex $rmsquote [rand [llength $rmsquote]]]<br>  putserv "KICK $chan $kuser :$reason"<br>  puthelp "NOTICE $nick :$rmsqt"<br>  putlog "&lt;$nick&gt; requested kick on $chan to $kuser for $reason"<br>}</div></blockquote>The previous OP script, I asked for how to add a if variable if the user types more than !op &lt;nick&gt;.<br><br>As for this script, I can't use that if variable. How do I add one such that if it's more than !kickban &lt;nick&gt; &lt;reason&gt;, it will trigger off a Syntax? I've tried using the previous if variable you recommended but it can't work because, if an oper reason exceed the length, it will trigger off the syntax. How do I use an if variable such that it doesn't trigger off no matter how long the &lt;reason&gt; is?<br><br>Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><p>Statistics: Posted by Guest — Wed Dec 05, 2001 5:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-12-04T11:16:00-04:00</updated>

		<published>2001-12-04T11:16:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2426#p2426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2426#p2426"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2426#p2426"><![CDATA[
<blockquote class="uncited"><div>On 2001-12-04 02:13, galaxyboy wrote:<br>Err ppslim, I've look through most of the script but it seems like I couldn't find any.</div></blockquote>Strange<blockquote class="uncited"><div>Could you just kindly give me some tips</div></blockquote>I allready did this int he first reply, use "split" on a string<blockquote class="uncited"><div>or show me what you are refering to? Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"></div></blockquote>Look in the "eggdrop" forum, for the post related to [] in nicknames. This is an example of bad programming, because the programmer failed to use the "split" and "list" commands.<br><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Dec 04, 2001 11:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-04T05:13:00-04:00</updated>

		<published>2001-12-04T05:13:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2415#p2415</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2415#p2415"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2415#p2415"><![CDATA[
Err ppslim, I've look through most of the script but it seems like I couldn't find any. Could you just kindly give me some tips or show me what you are refering to? Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><p>Statistics: Posted by Guest — Tue Dec 04, 2001 5:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-12-02T12:48:00-04:00</updated>

		<published>2001-12-02T12:48:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2324#p2324</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2324#p2324"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2324#p2324"><![CDATA[
Read 90% of the scripts in the egghelp.org archive, and you will see the proper use of it.<br><br>$arg comes from IRC as a string. And using a list command on a string in not the proper way (it's like trying to eat soup with a folk).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Dec 02, 2001 12:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-02T09:06:00-04:00</updated>

		<published>2001-12-02T09:06:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2318#p2318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2318#p2318"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2318#p2318"><![CDATA[
What's the security risk about? If I would to change it to your suggestion, can you show me a full example? Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><p>Statistics: Posted by Guest — Sun Dec 02, 2001 9:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-12-01T11:47:00-04:00</updated>

		<published>2001-12-01T11:47:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2284#p2284</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2284#p2284"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2284#p2284"><![CDATA[
<blockquote class="uncited"><div>if {[llength [split $arg]] &gt; 1} {</div></blockquote>Note, you are using strings on list commands in this script, which is a security risk and genraly bad progaming.<br><br>use [lindex [split $arg] IDX] instead.<br><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Dec 01, 2001 11:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-01T05:08:00-04:00</updated>

		<published>2001-12-01T05:08:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2281#p2281</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2281#p2281"/>
		<title type="html"><![CDATA[Adding a if variable?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2281#p2281"><![CDATA[
Ok, I've got this part of the script. It's working perfectly alright. Right now, I need to add a 'if' variable so that if someone types !op nick, it works. However, if the command is not !op nick (such that it contains other words like !op #chan nick etc,) the bot would give a Syntax: !op &lt;nick&gt;<br><br>Here's the code:<blockquote class="uncited"><div>bind pub o "[char]Op" pub:op<br>proc pub:op {user uhost hand chan arg} {<br>  if {[lindex $arg 0] == "-help"} {<br>     puthelp "NOTICE $user :02[char]OP02"<br>     puthelp "NOTICE $user :Flags...: O"<br>     puthelp "NOTICE $user :Syntax..: [cha]OP &lt;nick&gt;"<br>     puthelp "NOTICE $user :0303"<br>     puthelp "NOTICE $user :Info....: Give nick OP in #channel"<br>     puthelp "NOTICE $user :This allows user to kick/ban/setmodes user in channel"<br>     return 0<br>     }<br>  set opuser [lindex $arg 0]<br>  if {[onchan $opuser $chan] == 0} {<br>     puthelp "NOTICE $user :** Syntax: [char]OP &lt;nick&gt;"<br>     puthelp "NOTICE $user :** $user isn't on channel"<br>     return 0 <br>     }<br>  putserv "PRIVMSG Q :set $chan strictops off"<br>  puthelp "PRIVMSG $chan :eek:P for $opuser requested by $user"<br>  putserv "MODE $chan +o :$opuser"<br>  putserv "PRIVMSG Q :set $chan strictops on"<br>  putlog "&lt;$user&gt; requested Op for $opuser in $chan"<br>}</div></blockquote>Any ideas how do I add the 'if' variable? Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"><br><br>&lt;font size=-1&gt;[ This Message was edited by: galaxyboy on 2001-12-01 02:09 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Sat Dec 01, 2001 5:08 am</p><hr />
]]></content>
	</entry>
	</feed>
