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

	<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-10-11T15:15:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-10-11T15:15:20-04:00</updated>

		<published>2003-10-11T15:15:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28292#p28292</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28292#p28292"/>
		<title type="html"><![CDATA[Memo System Problem....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28292#p28292"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set memo_userfile "scripts/memo.userfile"set memo_msgfile "scripts/memo.messages"set memo_botsname "botnick"bind join - * eggmemo_checkmsg proc eggmemo_checkmsg {nick host hand channel} {    global memo_msgfile    global memo_botsname    if {[get $nick $memo_msgfile]!=""} {putserv "NOTICE $nick :Sie haben neue Nachrichten"putserv "NOTICE $nick :/msg $memo_botsname .get &lt;password&gt;"    }}bind msgm - ".new*" eggmemo_newproc eggmemo_new {nick host hand text} {    # new mailbox    global memo_userfile    set password [lindex $text 1]    if {$password==""} {putserv "NOTICE $nick : No password given";    } else {if {[get $nick $memo_userfile] == ""} {    add $nick $password $memo_userfile} else {    putserv "NOTICE $nick : Ihre Mailbox ist bereits vorhanden!"}    }}bind msgm - ".get*" eggmemo_getproc eggmemo_get {nick host hand text} {    # get yer own messages    global memo_msgfile    global memo_userfile    global memo_botsname    set password [lindex $text 2]    set getnick [lindex $text 1]    if {$password == ""} {set password [lindex $text 1]set getnick $nick    }    if {[get $getnick $memo_userfile]==""} {putserv "NOTICE $nick :Sie haben keine Mailbox eingerichtet!"putserv "NOTICE $nick :/msg $memo_botsname .new &lt;password&gt; command zum installieren"    }    if {[get $getnick $memo_userfile]!=$password} {putserv "NOTICE $nick : Invalid password"    } else {set message [get $getnick $memo_msgfile]if {$message == "" } {    putserv "NOTICE $nick : Sie haben keine neue Nachrichten"} else {    putserv "NOTICE $nick : $message"    remove $getnick $memo_msgfile    set message [get $getnick $memo_msgfile]    while {$message != ""} {putserv "NOTICE $nick : $message"remove $getnick $memo_msgfile    }}    }}bind msg - .memohelp eggmemo_helpproc eggmemo_help {nick host hand text} {    global memo_botsname    set dest $nick    putserv "NOTICE $dest :MemoScript by #Easy.bnc &lt;apex&gt;";    putserv "NOTICE $dest :/msg $memo_botsname .send &lt;nick&gt; &lt;message&gt; to send a message"}bind msg - .send eggmemo_sendproc eggmemo_send {nick host hand text} {    global memo_msgfile    global memo_userfile    # send a message    set recipient [lindex $text 0]    set message "$nick says: [lrange $text 1 end]"    putserv "NOTICE $nick :Message sent"    putlog "message to $recipient: $message"    add $recipient $message $memo_msgfile}proc add {key value file} {    exec "touch" $file        set fh [open $file a+]    puts $fh "$key =&gt; $value"    close $fh}proc get {key file} {    exec "touch" $file    set fh [open $file r]    set returnword {}    while {![eof $fh]} {set stdin [string trim [gets $fh]]if {[eof $fh]} { break }set breaker [lsearch -exact $stdin "=&gt;"]set getkey [lrange $stdin 0 [expr $breaker - 1]] set getresult [lrange $stdin [expr $breaker + 1] end]if {[string tolower $getkey] == [string tolower $key]} { set returnword $getresult }    }    close $fh    return $returnword}proc remove {word file} {    exec "touch" $file    set fh [open $file r]    set return {}    set del 0    while {![eof $fh]} {set stdin [string trim [gets $fh]]if {[eof $fh]} { break }if {![regexp -nocase $word $stdin]} {    lappend return $stdin} {    incr del 1}    }    close $fh;    set fh [open $file w]    foreach a $return {puts $fh $a    }    close $fh    return $del}</code></pre></div>I have a little problem with these TCL script..<br>When a user wrote a sentence, then save the script this.<br>When another user ( ~5mins later ) which another sentence....<br>So Overwrite the Script the Last sentence in the memo.messages file...<br>And i don't know was the user write to me... Ohnly One Sentence was safed in the file and no more....<br><br>How Can i Change, that the Script safe all Sentences that post a user in a file with Date and Time...<br><br>so far.... thanks to help<p>Statistics: Posted by Guest — Sat Oct 11, 2003 3:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
