mIRC Home    About    Download    Register    News    Help

Print Thread
#245315 16/04/14 07:40 AM
T
Tarekhere
Tarekhere
T
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 }
}

#245325 16/04/14 11:53 AM
B
blessing
blessing
B
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.


Link Copied to Clipboard