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

	<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>2003-12-01T11:25:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-12-01T11:25:37-04:00</updated>

		<published>2003-12-01T11:25:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30937#p30937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30937#p30937"/>
		<title type="html"><![CDATA[reverse script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30937#p30937"><![CDATA[
sorry <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Tzion just want <em class="text-italics">directions</em>, so I just type a quick-comin idea <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Dec 01, 2003 11:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Souperman]]></name></author>
		<updated>2003-12-01T06:23:10-04:00</updated>

		<published>2003-12-01T06:23:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30926#p30926</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30926#p30926"/>
		<title type="html"><![CDATA[reverse script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30926#p30926"><![CDATA[
<blockquote class="uncited"><div>use string functions:<div class="codebox"><p>Code: </p><pre><code>bind pub - "!reverse" reverseproc reverse {nick uhost handle chan args} {   if {[string length $args] == 0} { return 0 }   set new ""   for { set len 0} {$len &lt; [string length $args]} {incr len} {      set pos {[string length $args] - $len}      append new [string range $pos 1]   }   putserv "PRIVMSG $chan :$new"}</code></pre></div>Not verified, but might be near of the solution</div></blockquote>Please be careful of using string and list commands.  Do not use string commands on lists or vice versa.  Read <a href="http://www.peterre.com/characters.html" class="postlink">http://www.peterre.com/characters.html</a> for more info on this.<br><br>In case you didn't know:<blockquote class="uncited"><div>If the last formal argument has the name args, then a call to the procedure may contain more actual arguments than the procedure has formals. In this case, all of the actual arguments starting at the one that would be assigned to args are combined into a list (as if the list command had been used); this combined value is assigned to the local variable args.</div></blockquote>So, in your example, you are using the Tcl "string" command on $args, which is actually a list.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!reverse" reverseproc reverse {nick uhost hand chan args} {        if {[llength $args] == 0} { return }        # join converts a list to a string        set in [join $args]        set out ""        # loop through the given text backwards, appending each        # character to $out.        for {set x [expr [string length $in] - 1]} {$x &gt;= 0} {incr x -1} {                append out [string index $in $x]        }        # say the reversed string on channel        puthelp "PRIVMSG $chan :$out"}</code></pre></div> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=801">Souperman</a> — Mon Dec 01, 2003 6:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-12-01T04:38:37-04:00</updated>

		<published>2003-12-01T04:38:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30924#p30924</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30924#p30924"/>
		<title type="html"><![CDATA[reverse script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30924#p30924"><![CDATA[
use string functions:<div class="codebox"><p>Code: </p><pre><code>bind pub - "!reverse" reverseproc reverse {nick uhost handle chan args} {   if {[string length $args] == 0} { return 0 }   set new ""   for { set len 0} {$len &lt; [string length $args]} {incr len} {      set pos {[string length $args] - $len}      append new [string range $pos 1]   }   putserv "PRIVMSG $chan :$new"}</code></pre></div>Not verified, but might be near of the solution<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Dec 01, 2003 4:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-30T19:24:51-04:00</updated>

		<published>2003-11-30T19:24:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30916#p30916</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30916#p30916"/>
		<title type="html"><![CDATA[reverse script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30916#p30916"><![CDATA[
hi guys.<br>i'm new to eggdrop tcl. i have a script in mirc scripting that is reversing the word... like: hello--&gt;olleh.<br>can you give me direction on how to build script like that in eggdrop tcl, i think it's loops, but can you give example on that? <br>thanks.<p>Statistics: Posted by Guest — Sun Nov 30, 2003 7:24 pm</p><hr />
]]></content>
	</entry>
	</feed>
