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.

defining $var for users to put in

Old posts that have not been replied to for several years.
Locked
S
SIYB
Voice
Posts: 13
Joined: Sun Dec 19, 2004 5:45 pm

defining $var for users to put in

Post by SIYB »

i am working on my first tcl script, basically another "notes" script(pseudobnc). the scripts worked alright when i only had one mailbox runnuing. i now added a command so that anyone can create a mailbox with password. for each user, a seperate msg file is created. all passwords and usernames are stored in one file. that also works with no probs.

i now want to add a command so that people can sent msgs to specified users.

bind pub - ${pbchar}${pbstorecommand} storetext

how do i create a variable which users have to define after the storecommand? something like:

($user = user the msg should go to)
($msg = message)

.pbstore <$user> <$msg>

(i tried out some stuff with lindex, but couldn't get it work...)

i also want to use the $user var, to define the file the message is stored in...
set addmsg [open $pbsource$user a+]


Sorry if that question is answered elsewhere. there where too many matches when i searched for tcl ver variable etc...i looked through loads of scripts to get an idea how this might work...plz help me


siyb
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you are searching for something like

Code: Select all

set text [split $text]
set user [lindex $text 0]
set msg [join [lrange $text 1 end]]
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked