This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

memo tcl

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

memo tcl

Post by EEggy »

Hi, does any one know working memo tcl for all users??


advance thanks
EEggy
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

thanks, but i need for all users, memo1.1 is close, but the problem is, everything shows in the partyline and there is no limits for memos and flood protection ...


thanks
EEggy
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

Hi, i am using memo1.1, but i get this error
[02:00] Writing user file...
[02:00] Writing channel file...
[02:03] Tcl error [eggmemo_checkmsg]: couldn't create output pipe for command: file table overflow
[03:00] Last message repeated 395 time(s). and then bot gets disconnect and don't come back online, and in box i can see the process is running.
codes:
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 :You have new messages"
putserv "NOTICE $nick :/msg $memo_botsname !get <password> to retrieve"
}
}

and get procedure is the following

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 "=>"]
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
}

Thanks a lot.
EEggy
s
sQuiZZ

Post by sQuiZZ »

Hi

I am trying to use the script memo1.1.tcl.
It starts with no errors.

I can add users just fine, its a little vierd that i allso can add the same user more than ones and with different password.

I can send messages with no trouble.

But i cant get them and i dont get the mesage that should come on join.
When i try and get the message i get this message.

{15|55|01} -|TpE-cs|- You have not setup a mailbox.
{15|55|02} -|TpE-cs|- /msg |TpE-cs| !new <password> to setup
{15|55|03} -|TpE-cs|- Invalid password

Allso how do i make the memo work on one channel only.
Allso i would like to make is so, that i can write !get <password and !send <TO> <message> in the channel i think the /msg <botnick> !send <TO> <message> is a little to long.

Your help is greaty apriciated.

I have included the intire memo script.

Thanks
Casper

Code: Select all

# MemoScript v1.0
#  This script saves memos from user to user
#  Onjoin - script checks for messages
#
# Syntax (msg):
# !send nick message                 send a message to nick
# !get [nickname] password           get messages using [nickname] or current nickname and password
# !new password                      new mailbox with password
#
#############

set memo_userfile "scripts/memo.userfile"
set memo_msgfile "scripts/memo.messages"
set memo_botsname "|TpE-cs|"

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 :You have new messages"
	putserv "NOTICE $nick :/msg $memo_botsname !get <password> to retrieve"
    }
}

bind msgm - "!new*" eggmemo_new
proc 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
          putserv "NOTICE $nick : Your mailbox has been created"
	} else {
	    putserv "NOTICE $nick : Your mailbox already exists"
	}
    }
}

bind msgm - "!get*" eggmemo_get
proc 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 :You have not setup a mailbox."
	putserv "NOTICE $nick :/msg $memo_botsname !new <password> to setup"
    }

    if {[get $getnick $memo_userfile]!=$password} {
	putserv "NOTICE $nick : Invalid password"
    } else {
	set message [get $getnick $memo_msgfile]
	if {$message == "" } {
	    putserv "NOTICE $nick : You have no messages"
	} 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_help
proc eggmemo_help {nick host hand text} {
    global memo_botsname

    set dest $nick

    putserv "NOTICE $dest :MemoScript by Krystar <yruan4@uic.edu>";
    putserv "NOTICE $dest :/msg $memo_botsname !new <password> to setup mailbox under current nickname"
    putserv "NOTICE $dest :/msg $memo_botsname !send <recipient> <message> to send a message"
    putserv "NOTICE $dest :/msg $memo_botsname !get \133<nickname>\135 <password> to retrieve messages.  optional nickname parameter"
}

bind msg - !send eggmemo_send
proc 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 => $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 "=>"]
	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
}
s
sQuiZZ

Post by sQuiZZ »

Hi

I can't be true that there is nobody who can help me with this script.

I can see that there is alot of extremly competent users out there.

Please help me :D
sQuiZZ
Locked