mIRC Home    About    Download    Register    News    Help

Print Thread
#210754 24/03/09 07:24 PM
Joined: Mar 2009
Posts: 3
J
JohanD Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Mar 2009
Posts: 3
Php Code:
; ––––––––––––––––––––––––––––––––––––––––
; Put your own scripts in here.
; ––––––––––––––––––––––––––––––––––––––––

alias tracker.txt {
  return tracker.txt
}

on !1:JOIN:#online-wedden: { 
  var %mask = $mask($fulladdress,2)
  var %nfname = $mask($fulladdress,0)

  ; get the previous nicks
  var %nicks = $readini(tracker.txt, %mask, nicks)

  ; get the pervious full names
  var %fname = $readini(tracker.txt, %mask, fullname)

  ; add the new nick ($addtok will take care of duplicates)
  var %nicks = $addtok(%nicks,$nick,32)

  ; add the new fname ($addtok will take care of duplicates)
  var %fname = $addtok(%fname,$ial(%mask).user,32)


  ; update the nicks
  writeini -n tracker.txt %mask nicks %nicks

  ; update the seen time
  writeini -n tracker.txt %mask seentime $date

  ; update the fullname
  writeini -n tracker.txt %mask fullname %fname

  ; echo -t @joins Begin $nick ------------------------------------------
  ; echo -t @joins ip %mask
  echo -t #online-wedden 4 $nick --->  $readini(tracker.txt, %mask, nicks)
  ; echo -t @joins full names:  $readini(tracker.txt, %mask, fullname) 
  ; echo -t @joins last seen on  $readini(tracker.txt, %mask, seentime) 
  ; echo -t @joins Spotted In: $chan	
  ; echo -t @joins End $nick ------------------------------------------
}

alias ntrack {
  var %mask = $address($1,2)
  var %nfname = $address($1,0)
  ; get the previous nicks
  var %nicks = $readini(tracker.txt, %mask, nicks)
  ; get the pervious full names
  var %fname = $readini(tracker.txt, %mask, fullname)
  ; add the new nick ($addtok will take care of duplicates)
  var %nicks = $addtok(%nicks,$nick,32)
  ; add the new fname ($addtok will take care of duplicates)
  var %fname = $addtok(%fname,$ial(%mask).user,32)
  echo -a 12 $1 on the ip %mask has used the nicks:  $readini(tracker.txt, %mask, nicks) and the full names:  $readini(tracker.txt, %mask, fullname)  and was last seen on  $readini(tracker.txt, %mask, seentime) 
}
menu nicklist {
  NickTrack:ntrack $$1
}


alias tracker.txt {
  return tracker.txt
}

on !1:nick: { 
  var %mask = $mask($fulladdress,2)
  var %nfname = $mask($fulladdress,0)

  ; get the previous nicks
  var %nicks = $readini(tracker.txt, %mask, nicks)

  ; get the pervious full names
  var %fname = $readini(tracker.txt, %mask, fullname)

  ; add the new nick ($addtok will take care of duplicates)
  var %nicks = $addtok(%nicks,$newnick,32)

  ; add the new fname ($addtok will take care of duplicates)
  var %fname = $addtok(%fname,$ial(%mask).user,32)


  ; update the nicks
  writeini -n tracker.txt %mask nicks %nicks

  ; update the seen time
  writeini -n tracker.txt %mask seentime $date

  ; update the fullname
  writeini -n tracker.txt %mask fullname %fname

  ; echo -t @joins Begin $nick ------------------------------------------
  ; echo -t @joins ip %mask
  echo # @joins altnicks:  $readini(tracker.txt, %mask, nicks)
  ; echo -t @joins full names:  $readini(tracker.txt, %mask, fullname) 
  ; echo -t @joins last seen on  $readini(tracker.txt, %mask, seentime) 
  ; echo -t @joins End $nick ------------------------------------------
}


; ––––––––––––––––––––––––––––––––––––––––
; End of file
; ––––––––––––––––––––––––––––––––––––––––
 


Hello.
The script aboves gives all the names the user have had at that server. If someone joins you can see what nicknames the user has used in the past.
I use this script at a webchat which gives users a standerd name when they join the channel (Chatter9128 or another number) They can change their nick to their normal nick.

19:41… Chatter has joined #online-wedden
19:41… Chatter ---> Chatter Chatter 12312 Ben

Now I want to display all the names they have had before except the names with "Chatter" in it.
How can I change the script so only the names without the text "Chatter" in it will be displayed?

I suppose I have to change:
echo -t #online-wedden 4 $nick ---> $readini(tracker.txt, %mask, nicks)
into something.
Thanks for the help.

Example:
19:41… Chatter has joined #online-wedden
19:41… Chatter ---> Chatter Chatter12312 Ben


has to be changed in
19:41… Chatter has joined #online-wedden
19:41… Chatter ---> Ben

Last edited by JohanD; 24/03/09 07:30 PM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Of course you could exclude these nicks in the display, but I suggest to exclude them from being added to your tracker.txt instead. Touching only the required parts of your current script:

1) in the on join event update data like seentime as usual, but don't add a Chatter?* nick
change:
Code:
  ; update the nicks
  writeini -n tracker.txt %mask nicks %nicks 
to:
Code:
  ; update the nicks if the nick doesn't match Chatter*
  if (Chatter?* !iswmcs $nick) { writeini -n tracker.txt %mask nicks %nicks }

2) In the on nick event, don't update any of the data if someone changes the nick to Chatter*
Code:
on !1:nick: { 
  if (Chatter?* !iswmcs $newnick) {
    ... rest of your code for "on nick"
  }
}
(alternatively, you could exclude only adding of the nick, like above)

3) To clean your current tracker.txt of Chatter* nicks already stored, run this alias once:
Code:
alias cleannicks {
  var %file = tracker.txt
  var %n = 1
  while ($ini(%file,%n)) {
    var %mask = $v1, %nicks
    if ($readini(%file,n,%mask,nicks)) {
      var %nicks = $v1
      while ($wildtokcs(%nicks,Chatter?*,1,32)) { var %nicks = $remtok(%nicks,$v1,32) }
      $iif(%nicks,writeini,remini) -n %file %mask nicks %nicks
    }
    inc %n
  }
}

untested...hope I didn't forget about something smile

Joined: Mar 2009
Posts: 3
J
JohanD Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Mar 2009
Posts: 3
Thanks for the answer.
I am now at my work, but in the evening I will try your solution.
Till later.

Joined: Mar 2009
Posts: 3
J
JohanD Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Mar 2009
Posts: 3
It works, I think!
Thanks.
I changes Chatter?* in Chatter* because the name can be "Chatter" or "Chatter1234". Now both options will work.
I will try it this evening. If I see some problems I will be back!
Thanks again.


Link Copied to Clipboard