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

	<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>2010-04-26T12:35:19-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-04-26T12:35:19-04:00</updated>

		<published>2010-04-26T12:35:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92919#p92919</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92919#p92919"/>
		<title type="html"><![CDATA[!zline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92919#p92919"><![CDATA[
First off,<br>Your use of lindex is improper at best; this command expect the first input to be a list, just like lrange. Further, lrange returns a list, not a string, so you'll want to convert it back into a string using join.<br><br>Next, you'll need to add a test to see whether the user supplied both arguments or not. You could either do this by testing if either $nick or $reason is the empty string, or test the number of elements in $arguments - after you've converted it into a list; if this is less than 2, atleast one argument is missing:<br><div class="codebox"><p>Code: </p><pre><code>bind pub n !zline zlineproc zline {nickname hostname handle channel arguments} {  set items [split $arguments]  if {[llength $items] &lt; 2} {    puthelp "PRIVMSG $channel :Sorry, can't find a reason to zline with."    return  }  set nick [lindex $items 0]  set reason [join [lrange $items 1 end]]  putquick "GZLINE $nick :$reason"  puthelp "PRIVMSG $channel :Added a \002Global Zline\002 for $nick with the reason $reason"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Apr 26, 2010 12:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lolwutxd]]></name></author>
		<updated>2010-04-26T01:09:19-04:00</updated>

		<published>2010-04-26T01:09:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92915#p92915</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92915#p92915"/>
		<title type="html"><![CDATA[!zline]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92915#p92915"><![CDATA[
Hello, <br><br>I have the following code but I want to add to it<br><br>bind pub n !zline zline<br>proc zline { nickname hostname handle channel arguments } {<br>set nick [string tolower [lindex $arguments 0]]<br>set reason [lrange [split $arguments] 1 end]<br>putquick "gzline $nick :$reason"<br>putquick "privmsg $channel :Added a \002Global Zline\002 for $nick With The Reason $reason"<br>}<br><br>At the moment I can just enter !zline and it will reply back with<br><br>"&lt;BotNick&gt; Added a Global Zline for With The Reason"<br><br>I want to make it so you need to either provide a IP address OR a nickname AND with a reason or it will back with a error message like <br><br>"Sorry can't I didnt find a reason to zline with."<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11160">lolwutxd</a> — Mon Apr 26, 2010 1:09 am</p><hr />
]]></content>
	</entry>
	</feed>
