Code:
 
on !*:join:*: {
  set %j $chan
  set %s $address($nick,2)
  set %s1 $right(%s,-4)
  set %s2 %s1 $+ : $+ 04 $+ $nick
  if ( %j == #channel ) && ( %s1 isin $read(blah.txt,w,%s1) ) { 
    set %s3 $readn + 1 
    echo #channel 04***** 12 %s2 01has entered before as 12 $read(blah.txt,%s3) 
    write -l $+ %s3 blah.txt %s2
    set %s4 $readn - 1
    write -l $+ %s4 blah.txt %s1
  }
  else { 
    if ( %j == #channel ) { write blah.txt %s1 | write blah.txt %s2 }
  }
}
 


it still has a few bugs but i am working them out smile i think my error is in the $rean - 1 bit i will let you know when it is worked out