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

	<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>2004-11-09T12:00:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-11-09T12:00:33-04:00</updated>

		<published>2004-11-09T12:00:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42611#p42611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42611#p42611"/>
		<title type="html"><![CDATA[help needed for my script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42611#p42611"><![CDATA[
<blockquote class="uncited"><div>Try to use this proc to clean it<br><div class="codebox"><p>Code: </p><pre><code>  proc clean {i} {    regsub -all -- \\\\ $i \\\\\\\\ i    regsub -all -- \\\[ $i \\\\\[ i    regsub -all -- \\\] $i \\\\\] i    regsub -all -- \\\} $i \\\\\} i    regsub -all -- \\\{ $i \\\\\{ i    return $i  }</code></pre></div></div></blockquote>this could work, but it's not the proper way to approach that common problem of inexperienced scripters; there's a nice article in the FAQ section explaining how to deal with that issue; in essence, you shouldn't use certain list operation on strings before splitting the string into a proper list - no need of "cleaning", just use [split] and [join] wisely<br><br>@seroal:<br>instead of building rather ugly-looking nested lindex/split constructs, use this to divide nick!user@host into variables:<div class="codebox"><p>Code: </p><pre><code>scan $who %\[^!\]!%\[^@\]@%s nick user host</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Nov 09, 2004 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2004-11-09T09:56:19-04:00</updated>

		<published>2004-11-09T09:56:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42607#p42607</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42607#p42607"/>
		<title type="html"><![CDATA[help needed for my script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42607#p42607"><![CDATA[
Try to use this proc to clean it<br><div class="codebox"><p>Code: </p><pre><code>  proc clean {i} {    regsub -all -- \\\\ $i \\\\\\\\ i    regsub -all -- \\\[ $i \\\\\[ i    regsub -all -- \\\] $i \\\\\] i    regsub -all -- \\\} $i \\\\\} i    regsub -all -- \\\{ $i \\\\\{ i    return $i  }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Tue Nov 09, 2004 9:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[seroal]]></name></author>
		<updated>2004-11-09T07:42:07-04:00</updated>

		<published>2004-11-09T07:42:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42605#p42605</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42605#p42605"/>
		<title type="html"><![CDATA[help needed for my script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42605#p42605"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !bans pub:banesproc pub:banes { nick uhost handle chan arg } {if { [isop $nick $chan] || [ishalfop $nick $chan] || [isvoice $nick $chan] } {set channel $chanif { $arg!="" } {set channel $arg}set banli [chanbans $channel]set banes 0foreach x $banli {set banner [lindex [split [split [lindex [split [lindex [split $x] 1] !] 0] \]] |] 0]if { [lsearch [lrange [split $banes] 1 end] $banner]==-1 } {set banes "$banes $banner"putlog [lrange [split $banes] 1 end]"set banarray($banner) 1} else {set banarray($banner) [expr $banarray($banner)+1]putlog "$banarray($banner)"}}set listabaneador [lrange [split $banes] 1 end]set textofin 0putlog "longitud de baneado [llength $listabaneador]"for { set i 0 } { $i&lt;[llength $listabaneador] } { incr i } {if { $i==[expr [llength $listabaneador]-1] } {set textofin "$textofin y $banarray([lindex $listabaneador $i]) son de [lindex $listabaneador $i]. " } else {set textofin "$textofin, $banarray([lindex $listabaneador $i]) son de [lindex $listabaneador $i]" putlog "$textofin"}}set final [lrange [split $textofin] 1 end]set text [join $final]putlog "$text"putserv "PRIVMSG $chan :There is [llength $banli] bans of 100 posible en in the channel $channel from which $text"}}</code></pre></div><br>This is one of the scripts i made to count the number of bans in a chan and sum the bans made by each op in that chan. The problem is when i have a nick with special chars. Normaly the [ ] chars. For exemple, if i have a nick like [test] , it'll return:<br>{\\\{\\\[test\\} {{}} and then ..<br><blockquote class="uncited"><div>Tcl error [pub:banes]: can't read "banarray(\{\[test)": no such element in array</div></blockquote>i've tried reading all posts but i still don't know how i could solve it.. sorry if this as already been treated in other post but i'de apreciate some help. thx for all <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (sorry for my bad scripting ..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5640">seroal</a> — Tue Nov 09, 2004 7:42 am</p><hr />
]]></content>
	</entry>
	</feed>
