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

	<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>2005-11-01T12:35:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ache]]></name></author>
		<updated>2005-11-01T12:31:54-04:00</updated>

		<published>2005-11-01T12:31:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=56955#p56955</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=56955#p56955"/>
		<title type="html"><![CDATA[Help with read/write to file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=56955#p56955"><![CDATA[
Got a new problem.<br>this is the code so far (i know it ain´t much):<div class="codebox"><p>Code: </p><pre><code>proc pub:addgreet {nick greetnick greetchannel greettext} {  set greetdb "scripts/greets.db"  set greetdbtmp "scripts/greets.db.tmp"}</code></pre></div>Anyway. what i´m after is a process that searches a file (greets.db) for $greetchan $greetnick and if it finds it will replace it with $greetchan $greetnick $greettext. If it doesn´t find it it will just add the line at the bottom of the file.<br><br>I know this might be abit much to ask but i can´t seem to get anywhere with it.<br><br>thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6853">ache</a> — Tue Nov 01, 2005 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ache]]></name></author>
		<updated>2005-11-01T09:50:23-04:00</updated>

		<published>2005-11-01T09:50:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=56952#p56952</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=56952#p56952"/>
		<title type="html"><![CDATA[Help with read/write to file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=56952#p56952"><![CDATA[
Thanks Alchera<br>found the problem. <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=6853">ache</a> — Tue Nov 01, 2005 9:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-11-01T09:37:16-04:00</updated>

		<published>2005-11-01T09:37:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=56951#p56951</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=56951#p56951"/>
		<title type="html"><![CDATA[Help with read/write to file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=56951#p56951"><![CDATA[
<a href="http://www.tcl.tk/man/tcl8.4/TclCmd/string.htm#M9" class="postlink">Tcl Built-In Commands - string manual page</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Tue Nov 01, 2005 9:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ache]]></name></author>
		<updated>2005-11-01T09:15:59-04:00</updated>

		<published>2005-11-01T09:15:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=56950#p56950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=56950#p56950"/>
		<title type="html"><![CDATA[Help with read/write to file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=56950#p56950"><![CDATA[
Nevermind the last thing, sorted that one but got a new error.<br><br>new error:<div class="codebox"><p>Code: </p><pre><code>Tcl error [pub:checkgreet]: wrong # args: should be "string index string charIndex"</code></pre></div>new code:<div class="codebox"><p>Code: </p><pre><code>proc pub:checkgreet {nick uhost handle channel arguments } {  list arguments $arguments  set greetnick [lindex $arguments 0]  set greetchannel [lindex $arguments 1]  set greettext [lrange $arguments 2 end]  putlog "1 Greet nick: $greetnick Greet channel: $greetchannel Greet text: $greettext"     if {([string index $greetchannel]=="#")} {    [pub:addgreet $greetnick $greetchannel $greettext]}elseif {[string index $greetchannel]=="all"} {    [pub:addgreet $greetnick $greetchannel $greettext]  } else {    putquick "PRIVMSG $nick : Please state a channel to greet in. \026!chelp !addgreet\026 for more info."    return  }  putlog "2 Greet nick: $greetnick Greet channel: $greetchannel Greet text: $greettext"   }proc pub:addgreet {greetnick greetchannel greettext} {}proc pub:delgreet {nick uhost handle channel args } {}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6853">ache</a> — Tue Nov 01, 2005 9:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ache]]></name></author>
		<updated>2005-11-01T12:35:03-04:00</updated>

		<published>2005-11-01T08:55:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=56949#p56949</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=56949#p56949"/>
		<title type="html"><![CDATA[Help with read/write to file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=56949#p56949"><![CDATA[
I working on a simple greet script but have encountered some problems.<br><br>this is what the script looks like so far.<div class="codebox"><p>Code: </p><pre><code>proc pub:checkgreet {nick uhost handle channel arguments } {  list arguments $arguments  set greet.nick [lindex $arguments 0]  set greet.channel [lindex $arguments 1]  set greet.text [lrange $arguments 2 end]  putlog "1 Greet nick: $greet.nick Greet channel: $greet.channel Greet text: $greet.text"     if {([string index $greet.channel]=="#")} {    [pub:addgreet $greet.nick $greet.channel $greet.text]}elseif {($greet.channel=="all")} {    [pub:addgreet $greet.nick $greet.channel $greet.text]  } else {    putquick "PRIVMSG $nick : Please state a channel to greet in. \026!chelp !addgreet\026 for more info."    return  }  putlog "2 Greet nick: $greet.nick Greet channel: $greet.channel Greet text: $greet.text"   }proc pub:addgreet {greet.nick greet.channel greet.text} {}proc pub:delgreet {nick uhost handle channel args } {}</code></pre></div>the error i get is this<div class="codebox"><p>Code: </p><pre><code>Tcl error [pub:checkgreet]: syntax error in expression "($greet.channel=="all")": looking for close parenthesis</code></pre></div>I cant fingure out what the problem is..<br>any help would be greatly appreciated.<br><br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6853">ache</a> — Tue Nov 01, 2005 8:55 am</p><hr />
]]></content>
	</entry>
	</feed>
