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

	<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>2008-03-15T02:33:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-15T02:33:09-04:00</updated>

		<published>2008-03-15T02:33:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81767#p81767</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81767#p81767"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81767#p81767"><![CDATA[
I think <a href="http://shell-net.net/index.php?action=downloads;sa=view;id=5" class="postlink"><span style="text-decoration:underline">this script</span></a> will do what you want. If it doesn't, let me know.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Sat Mar 15, 2008 2:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-14T23:22:37-04:00</updated>

		<published>2008-03-14T23:22:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81762#p81762</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81762#p81762"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81762#p81762"><![CDATA[
You want the message to go to the channel that the script is called from, or do you want the message to go to a specific channel regardless of where it's called from?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Mar 14, 2008 11:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CyberWar]]></name></author>
		<updated>2008-03-14T16:25:40-04:00</updated>

		<published>2008-03-14T16:25:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81749#p81749</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81749#p81749"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81749#p81749"><![CDATA[
This script does not work. My script version works fine, but he dont make a msg to the channel when i make a gline. i want that my script make a msg to the channel when i maked a gline.<br><br>e.g.: BotNick: Requested by $nick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9685">CyberWar</a> — Fri Mar 14, 2008 4:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2008-03-14T16:13:40-04:00</updated>

		<published>2008-03-14T16:13:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81748#p81748</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81748#p81748"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81748#p81748"><![CDATA[
Hopefully this is what your after:<br><div class="codebox"><p>Code: </p><pre><code>bind pub G|G !gline pub:glineproc pub:gline {nick host hand chan text} {    global lastbind    if {[set who [lindex [split $text] 0]] == ""} {        putserv "NOTICE $nick :Syntax: $lastbind &lt;nick|host&gt; ?bantime? ?reason?."    } else {        if {![regexp {[\d]{1,}(m|h|d|w|y)} [lindex [split $text] 1]]} {            set bantime "360m"        }        if {[set reason [lrange $text [expr {[regexp {[\d]{1,}(m|h|d|w|y)} [lindex [split $text] 1]] ? "2" : "1"}] end]]} {            set reason "Requested by $nick"        }        set time [strftime %d-%m-%Y/%H:%M:%S]        putquick "GLINE $who $bantime :$reason ($time)"        putserv "PRIVMSG $chan :Requested by $nick"    }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Fri Mar 14, 2008 4:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CyberWar]]></name></author>
		<updated>2008-03-14T15:27:29-04:00</updated>

		<published>2008-03-14T15:27:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81744#p81744</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81744#p81744"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81744#p81744"><![CDATA[
Hi guys i have a script where works fine<br><br>One question when i make a gline i want that the bot write: Requested by $nick<br><br>this is my script<br><br>set eggver 1<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !gline holm-pub_glineproc holm-pub_gline {nick uhost hand chan text} {  set bantime "360m"  set knick [lindex $text 0]  set reason [lrange $text 1 end]  if ![matchattr $hand G|G $chan] {  putserv "NOTICE $nick :Access Denied"  return 0  }  if {$knick == ""} {     putserv "notice $nick :Usage: !gline &lt;nick&gt; &lt;reason&gt;"     return 0  } else {          putserv "gline $knick $bantime :$reason ([strftime %d-%m-%Y/%H:%M:%S])"          return 0  if {$reason == ""} {     putserv "PRIVMSG $chan :Requested by $nick"}  } }</code></pre></div>Look at the line: putserv "PRIVMSG $chan :Requested by $nick" <br>whats wrong?<br><br>i want the follow result e.g.<blockquote class="uncited"><div> [ ° ] Quits: root ( <a href="mailto:root@ps-C2EA4D2A.server4you.de">root@ps-C2EA4D2A.server4you.de</a> ) has left irc [ User has been banned from blanet (test (14-03-2008/20:23:09)) ]<br><br>« Area51 » Requested by $nick</div></blockquote>the Bot write atm nothing about: Requested by $nick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9685">CyberWar</a> — Fri Mar 14, 2008 3:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CyberWar]]></name></author>
		<updated>2008-03-14T03:05:48-04:00</updated>

		<published>2008-03-14T03:05:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81721#p81721</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81721#p81721"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81721#p81721"><![CDATA[
Ok DragnLord<br><br>Well thank you to all here nice support now i know more about scripts and errors etc.<br><br>i will test it the script from DragnLord i think it works fine  <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=9685">CyberWar</a> — Fri Mar 14, 2008 3:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-13T17:13:15-04:00</updated>

		<published>2008-03-13T17:13:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81697#p81697</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81697#p81697"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81697#p81697"><![CDATA[
This has strayed far enough off topic.<br>As I have stated more then once in this topic already, coding before coffee is bad.<br>The entire idea behind this script is bad.<br>I never said the script was perfect, nothing ever is (or eggdrop and TCL would have both stopped at version 1.0).<br>I simply stated the script worked in my testing (at least I tested it).<br><br>While nicknames may contain braces (and/or other special characters), IP addresses may NOT contain those. And my script allows for using *@IP as a fall back target for nicknames with odd characters. <br><br>The "proper" answer to the original issue should be;<br>"If you trust your abuse team 100%, give them operator status that restricts them to banning commands (kline. gline, etc.). This can be done easily enough by creating a single oper and having the abuse team all use that single oper. Remember to carefully set exemptions."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Thu Mar 13, 2008 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-03-13T16:41:31-04:00</updated>

		<published>2008-03-13T16:41:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81695#p81695</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81695#p81695"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81695#p81695"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Splitting a second time?<br>I think you are abit confused 'bout splitting...<br>Split converts a string to a list, $t is a string since it originates from the binding. Hence it should (must) be splitted prior being used with any commands expecting a list as a parameter. Using your code with a "reason" such as "evil user typing {" would illustrate how your script was broken, and how split is necessary.<br><br>A bad habit, in my opinion, is not bothering to keep track whether the content of a variable is a string or a list (always considder user input to be a string, never a list).</div></blockquote>you seem a bit confused about how lrange works<br>[lrange $x 0 end] may be used to force x to have list (as opposed to string) representation - this enhances performance in some situations.</div></blockquote>I considder myself quite well-versed when it comes to list operations, and would call the above a very ugly hack, that will only work with specially crafted strings. And even in this case, the output would be similar to <em class="text-italics">split</em>. split however, expects the input to be a string, and can handle any case, such as the one below:<div class="codebox"><p>Code: </p><pre><code>% set string "ad {dwer fva{ aer"ad {dwer fva{ aer% lrange $string 0 endunmatched open brace in list% lindex $string 2unmatched open brace in list% split $stringad \{dwer fva\{ aer%</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Mar 13, 2008 4:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-03-13T16:21:50-04:00</updated>

		<published>2008-03-13T16:21:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81692#p81692</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81692#p81692"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81692#p81692"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Splitting a second time?<br>I think you are abit confused 'bout splitting...<br>Split converts a string to a list, $t is a string since it originates from the binding. Hence it should (must) be splitted prior being used with any commands expecting a list as a parameter. Using your code with a "reason" such as "evil user typing {" would illustrate how your script was broken, and how split is necessary.<br><br>A bad habit, in my opinion, is not bothering to keep track whether the content of a variable is a string or a list (always considder user input to be a string, never a list).</div></blockquote>you seem a bit confused about how lrange works<br>[lrange $x 0 end] may be used to force x to have list (as opposed to string) representation - this enhances performance in some situations.</div></blockquote><blockquote class="uncited"><div>NAME<br>lrange - Return one or more adjacent elements from a list<br>SYNOPSIS<br>lrange list first last<br>DESCRIPTION<br>List must be a valid Tcl list. This command will return a new list consisting of elements first through last, inclusive. First or last may be end (or any abbreviation of it) to refer to the last element of the list. If first is less than zero, it is treated as if it were zero. If last is greater than or equal to the number of elements in the list, then it is treated as if it were end. If first is greater than last then an empty string is returned. Note: ``lrange list first first'' does not always produce the same result as ``lindex list first'' (although it often does for simple fields that aren't enclosed in braces); it does, however, produce exactly the same results as ``list [lindex list first]''</div></blockquote>just so we are clear here, both lrange and lindex work with lists, and want to have lists given to them, hence they begin with l.<br><br>Now, the difference between a string and a list is what is at issue here more than the commands. Because sure, anyone can use list commands on strings and string commands on lists. The problem is this isn't natural to do, so unexpected problems always arise, and must be compensated for.<br><br>Keep in mind, lists use curly bracing to denote list elements and fields. Strings do not. So any time you mistakenly give a list command a string with any curly braces in it, expect dilemma. Instead use [split $string] (this will protect the curly braces within the string from being interpreted as list elements or fields).<br><br>Instead of being arrogant and refusing to see that while your way is faster (not needing to split, indeed you save clock cycles). You need to see that it introduces more work later, extraneous filters and work arounds...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Mar 13, 2008 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-13T16:12:53-04:00</updated>

		<published>2008-03-13T16:12:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81691#p81691</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81691#p81691"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81691#p81691"><![CDATA[
<blockquote class="uncited"><div>Splitting a second time?<br>I think you are abit confused 'bout splitting...<br>Split converts a string to a list, $t is a string since it originates from the binding. Hence it should (must) be splitted prior being used with any commands expecting a list as a parameter. Using your code with a "reason" such as "evil user typing {" would illustrate how your script was broken, and how split is necessary.<br><br>A bad habit, in my opinion, is not bothering to keep track whether the content of a variable is a string or a list (always considder user input to be a string, never a list).</div></blockquote>you seem a bit confused about how lrange works<br>[lrange $x 0 end] may be used to force x to have list (as opposed to string) representation - this enhances performance in some situations.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Thu Mar 13, 2008 4:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CyberWar]]></name></author>
		<updated>2008-03-13T16:09:38-04:00</updated>

		<published>2008-03-13T16:09:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81690#p81690</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81690#p81690"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81690#p81690"><![CDATA[
My problem at the moment is not yet resolved?<br>this scripts does not work?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9685">CyberWar</a> — Thu Mar 13, 2008 4:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-13T16:04:24-04:00</updated>

		<published>2008-03-13T16:04:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81689#p81689</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81689#p81689"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81689#p81689"><![CDATA[
<blockquote class="uncited"><div>Your forgetting your using unsanitized user input . I can use {[]} (nicknames allow these, don't they?) in my input and I've just broken your script (splitting would've kept this from happening).... these are the unexpected consequences that I mentioed happening with tcl special characters.</div></blockquote>true enough, special characters may present issues, although on my tests with nicknames that included braces it still worked<br>as I said earlier, coding before coffee is baaaad<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Thu Mar 13, 2008 4:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-03-13T15:50:47-04:00</updated>

		<published>2008-03-13T15:50:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81688#p81688</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81688#p81688"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81688#p81688"><![CDATA[
Splitting a second time?<br>I think you are abit confused 'bout splitting...<br>Split converts a string to a list, $t is a string since it originates from the binding. Hence it should (must) be splitted prior being used with any commands expecting a list as a parameter. Using your code with a "reason" such as "evil user typing {" would illustrate how your script was broken, and how split is necessary.<br><br>A bad habit, in my opinion, is not bothering to keep track whether the content of a variable is a string or a list (always considder user input to be a string, never a list).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Mar 13, 2008 3:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-03-13T15:47:40-04:00</updated>

		<published>2008-03-13T15:47:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81687#p81687</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81687#p81687"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81687#p81687"><![CDATA[
<blockquote class="uncited"><div>splitting $t a second time is quite unneeded as it is already separated by spaces, no need to use split here (TCL already defaults to using the spaces as separators)<br>it's more of a "bad habit" to do unneeded things, at least in my opinion<br><br>thank you for pointing out the global variable error, my ircd configuration uses 1440 as default, so I didn't catch that one</div></blockquote>Your forgetting your using unsanitized user input . I can use {[]} (nicknames allow these, don't they?) in my input and I've just broken your script (splitting would've kept this from happening).... these are the unexpected consequences that I mentioned happening with tcl special characters.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Mar 13, 2008 3:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-13T15:44:32-04:00</updated>

		<published>2008-03-13T15:44:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81686#p81686</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81686#p81686"/>
		<title type="html"><![CDATA[Help with Command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81686#p81686"><![CDATA[
splitting $t a second time is quite unneeded as it is already separated by spaces, no need to use split here (TCL already defaults to using the spaces as separators)<br>it's more of a "bad habit" to do unneeded things, at least in my opinion<br><br>thank you for pointing out the global variable error, my ircd configuration uses 1440 as default, so I didn't catch that one<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Thu Mar 13, 2008 3:44 pm</p><hr />
]]></content>
	</entry>
	</feed>
