I've taken some ideas, and bits and pieces of script that I've found around, and made myself a script to hold some info, when a user parts the channel.
Like this:
Code: Select all
set array_name([string tolower $nick],$chan) "$nick $uhost $chan [unixtime]"
When the user returns to the channel, script has bot say something like, "Welcome back nick, it has been xx minutes(seconds, whatever) since you were last here".
Code: Select all
foreach item [array names array_name] {
(here, compare hostmask stored in array, to current $host ... if it matches, then announce, etc.)
At this point, I want the script to unset the saved info. To get rid of it.
Code: Select all
array unset array_name $item
Usually, $item would be something like: somenick,#chan and it works.
However, if the user had a nick with brackets in it:
[s]omenick,#chan - then it doesn't work.
I've played around with [split $item] and [join [split $item]] in the script.
No luck.
Next, I tried doing it "by hand", in partyline with .tcl array unset. I can't get it to unset with:
.tcl unset array unset [s]omenick,#chan and it errors with unknown command of course.
Next I tried, .tcl array unset {[s]omenick,#chan} and it didn't error... but it didn't unset it either.
So far, the only way I've been able to do it from the partyline command line is: .tcl array unset {\[s\]omenick,#chan}
Using the backslash to escape the brackets does work.
I thought that if I could manipulate my varname and element such that the element was enclosed in curly braces, I'd be ok.
( http://www.peterre.info/characters.html )
Apparently, I'm overlooking something.
I hope I've made no confusing typos in this post... I've looked at the script so much and tried so many things now, that it is almost all a blur.
It is really bugging me now.

If someone could explain to me how to do it, and what my mistake is, I would like that very much.
Thanks