mIRC Home    About    Download    Register    News    Help

Print Thread
#245315 16/04/14 07:40 AM
Joined: Apr 2014
Posts: 13
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Apr 2014
Posts: 13
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 }
}

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
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