mIRC Home    About    Download    Register    News    Help

Print Thread
#3073 22/12/02 09:26 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
I want to logg everyone who joins my channel in a file.
on *:JOIN:#chan:{
if ( $readini users.ini Users [ $nick ] == $null ) {
/write chan.txt $nick
/writeini users.ini Users [ $nick ] listed
}
}

that one i got. but when a new one joins. i want to msg chan.sentral that a new user is in the chan. and how many that has been in the chan.. does anny one know how to do that..
And one other thing.
i have a bot that loggs individual ppl in the chan in nick.txt so is there any way to just type !log nick then it will say how many lines that person has written in the chan ?

#3074 22/12/02 11:20 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
using just the /writeini and $ini should give you what you want.
on *:join:#yourchannel:{
writeini chanlog.ini chanlog $nick $ctime
msg #yourchannel $ini(chanlog.ini,chanlog,0) Users have joined #yourchannel since count logging began.
}

I didn't test that, but it should add/update names as people join then msg the
channel with the total number on names in the topic [chanlog]
a more sophisticated way would be to add the nick if it doesn't exist with the count 1
and update the count each time they join.

#3075 23/12/02 12:27 AM
Joined: Dec 2002
Posts: 208
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
Code:
on 1:JON:#channame: {
  var %n = $readini(users.ini,$chan,$nick) | inc %n
  writeini users.ini $chan $nick %n
  if (%n > 1) { echo $chan *** User Info: $nick has joined %n times }
  else { echo $chan *** $nick is a new user! }
}


that what u were looking for? it will count how many times each person joins a channel .. if its the first time it will say they are a new user, else it will say how many times the user has joined. .. and it could be set up to work for more than one chan.

as far as your 2nd q .. answering that without seeing the source code as to how it works .. all i can tell u is to use $lines() to count how many lines are in a file.

Cobra^

#3076 23/12/02 02:11 AM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
on *:JOIN:#chan:{
if ( $readini users.ini Users [ $nick ] == $null ) {
/write chan.txt $nick
/writeini users.ini Users [ $nick ] listed
}
}

i use this one...
and than it comes how many times the user had been in the chan (after nick). But how do i just like !nick Oggabogga and it comes like Oggabogga has been in chan 2 times ?

#3077 23/12/02 02:53 AM
Joined: Dec 2002
Posts: 208
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
witht hat u cant

thats why i wrote u a new on join event

your not counting how many times he joins .. so u have no way of knowing

if u used the one i gave u hten it would be like htis

Code:
on 1:TEXT:*:#: {
  if ($1 == !nick) {
    var %n = $readini(users.ini,$chan,$$2)
    msg $chan *** $$2 has joined $iif(%n, %n, 0) times!
  }
}


Cobra^


Link Copied to Clipboard