mIRC Homepage
Posted By: Tarekhere On Join logging help - 16/04/14 07:40 AM
Ok I have this code, and it makes duplicate entries,

I want it to write and log joins in the room, and if it finds a person which joined with the same ip before doesnt add him again, but if he joins with the same nick and a different ip it adds a new entry with the new ip, is this possible ? here is the code

Code:
on *:join:*: {
  if ($read(users.txt,w,$+(*,$address,*))) halt
  elseif ($nick != $me) && (!$read(users.txt,w,* $+ $address($nick,1) $+ *)) { write Users.txt  $address($nick,2) $nick }
}
Posted By: blessing Re: On Join logging help - 16/04/14 11:53 AM
Maybe like this:

Code:
on *:join:#:{
  if $nick == $me { return }
  var %i 1, %s 0
  while $read(users.txt,w,$+($site,*),%i) {
    if $+(*,$nick) iswm $v1 { var %s 1 | break }
    var %i $calc($readn + 1)
  }
  if !%s { write users.txt $site $nick }
}

- not tested.
© mIRC Discussion Forums