Why not make the value of the variable the ctime instead of trying to include ctime in the variable name?

set $+(%,Join.,$cid,.,$chan,.,$nick) $ctime

Simple sample script
Code:
on *:join:#:{
  set $+(%,Join.,$cid,.,$chan,.,$nick) $ctime
}
on *:part:#:{
  var %ts = $eval($+(%,Join.,$cid,.,$chan,.,$nick),2)
  if (%ts) {
    echo 2 $chan $nick spent $duration($calc($ctime - %ts)) in the channel
    unset $+(%,Join.,$cid,.,$chan,.,$nick)
  }
}
To make it work you will have to put in an ON NICK event to handle when people switch nicks. You will need an ON QUIT event to handle quits (note: there is no $chan in ON QUIT. You have to loop through $comchan). Your script will also have to wipe out variables when you quit, part, and disconnect.

*EDIT*
You'll also need on ON KICK event.

Last edited by Jerk; 19/05/03 07:44 PM.