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

	<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>2015-05-13T16:09:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-13T16:09:51-04:00</updated>

		<published>2015-05-13T16:09:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104091#p104091</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104091#p104091"/>
		<title type="html"><![CDATA[Re: Again doubts a braces in nick]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104091#p104091"><![CDATA[
<blockquote class="uncited"><div>        Try this:      set nickpro [lindex [split $text] 0]<br>p.s<br>The code you posted is missing :<br>set canal_admin $chan<br>too.</div></blockquote>I tried what you advised me, but it NOT worked.<blockquote class="uncited"><div>&lt;oper&gt; !notiadd {test}<br>&lt;bot&gt; test  has been added to the list of banned nicks.</div></blockquote>The code continues regardless nick braces.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"><br><br>EDIT: I fixed!<div class="codebox"><p>Code: </p><pre><code>set nickpro [lindex [split $arg { }] 0]</code></pre></div>Thanks <strong class="text-strong">willyw</strong>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Wed May 13, 2015 4:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-13T08:28:41-04:00</updated>

		<published>2015-05-13T08:28:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104085#p104085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104085#p104085"/>
		<title type="html"><![CDATA[Re: Again doubts a braces in nick]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104085#p104085"><![CDATA[
<blockquote class="uncited"><div>I wish the nick containing braces in file storage.  <br>...<br>example:<blockquote class="uncited"><div>!notiadd {juan}<br>Returns  first line of file (prohibidos.txt) {juan}<br>!notiadd pedro<br>Returns  second line of file (prohibidos.txt) pedro</div></blockquote><div class="codebox"><p>Code: </p><pre><code>bind pub at|n !notiadd notiaddproc notiadd {nick uhost handle chan text} {  set nickpro [lindex $text 0]...  </code></pre></div></div></blockquote><br>1.)  It would help a LOT if when you post code here, it was indented.  <br>      Indents and line spaces make code easier to read.<br><br>2.)  Go here:   <br><a href="http://web.archive.org/web/20070205113405/http://www.peterre.info/characters.html" class="postlink">http://web.archive.org/web/200702051134 ... cters.html</a><br><br>       and read.  Especially this section, "The first golden rule of Tcl for     eggdrop".<br><br>Bookmark that page, and refer back to it, until you master it.<br><br><br>3.)   Here is the problem:   set nickpro [lindex $text 0]<br><br>        lindex works on lists, not on strings.    $text is a string.<br>        You can "get away with it" sometimes.   Then you acquire a bad        habit, and one day it comes back to bite you.   <br>        Here we are.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>        Try this:      set nickpro [lindex [split $text] 0]<br><br><br><br>p.s<br>The code you posted is missing :<br><br>set canal_admin $chan<br><br>too.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed May 13, 2015 8:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-13T00:48:20-04:00</updated>

		<published>2015-05-13T00:48:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104078#p104078</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104078#p104078"/>
		<title type="html"><![CDATA[Again doubts a braces in nick]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104078#p104078"><![CDATA[
I wish the nick containing braces in file storage.  <br><br>Something explained me <strong class="text-strong">SpiKe^^</strong> in another post, but it was referred to a list, which added nicks.<br>Now is another case, I store every nick on a separate line of a file.<br><br>I don't know fix it for this particular case a file. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> <br><br>example:<blockquote class="uncited"><div>!notiadd {juan}<br>Returns  first line of file (prohibidos.txt) {juan}<br>!notiadd pedro<br>Returns  second line of file (prohibidos.txt) pedro</div></blockquote><div class="codebox"><p>Code: </p><pre><code>bind pub at|n !notiadd notiaddproc notiadd {nick uhost handle chan text} {  set nickpro [lindex $text 0]  if {![file exist prohibidos.txt]} {  set fs [open prohibidos.txt "w"]  puts $fs ""  close $fs}  else {set fname "prohibidos.txt"set fp [open $fname "r"]set data [read -nonewline $fp]close $fpset lines [split $data "\n"] set first [lindex $lines 0]if {$first == ""} {set lines [lreplace $lines 0 0] set fp [open $fname "w"]puts $fp [join $lines "\n"]close $fp}set fp [open $fname "r"]set data [read -nonewline $fp]close $fpset lines1 [split $data "\n"] if {([lsearch -exact [string tolower $lines1] [string tolower $nickpro]] == -1)} {set fp [open $fname "a"]puts $fp $nickproclose $fp   putmsg $canal_admin [encoding convertfrom utf-8 "\002$nickpro\002 has been added to the list of banned nicks."]   } else {  putmsg $canal_admin [encoding convertfrom utf-8 "$nickpro was already added!"]   return  }}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Wed May 13, 2015 12:48 am</p><hr />
]]></content>
	</entry>
	</feed>
