mIRC Home    About    Download    Register    News    Help

Print Thread
#200310 02/06/08 08:42 AM
S
sigbin
sigbin
S
how can i make a script log all join events in a specified channel then in every 5 joins i will rejoin that channel

on every rejoin i make, it also logs the time i rejoined the channel...

anyone can help me?

Last edited by sigbin; 02/06/08 08:44 AM.
#200312 02/06/08 04:32 PM
L
Lpfix5
Lpfix5
L
im not sure if this is what you want

on *:JOIN:#specificchannel:{
if (%vc > 5) { hop | unset %vc }
else {
.write log.txt $nick Joined # | inc %vc
}
}

on ME:*:JOIN:#specificchannel:{ .write log.txt I have joined # at $time(HH:nn) }

#200317 02/06/08 11:48 PM
R
RusselB
RusselB
R
I'd recommend putting the ON ME:*:JOIN event before the ON *:JOIN event, since the format of the first event, according to Lpfix5's code will trigger no matter who joins, preventing the 2nd event from triggering if you join. Although switching them, without a re-code, also means that your join, due to the hop, would not be counted.

Additionally, please note that using the hop command quickly, as would be the case if a lot of people joined the channel in a very short amount of time (eg: due to a net split), can cause network/server problems by trying to have you rejoin the channel too quickly.

#200322 03/06/08 03:51 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
A little rewrite so it's a single on JOIN event and so that you won't have issues rejoining multiple times after a netsplit. Also adjusted the counter as it was going to rejoin every 6 times instead of 5.

Code:
on *:JOIN:#specificchannel:{ 
  if ($nick == $me) { .write log.txt I have joined $chan at $time(HH:nn) | return }
  if (%vc >= 5) { .timerReJoin 1 1 hop | unset %vc }
  else {
    .write log.txt $nick Joined $chan
    inc %vc
  }
}

Riamus2 #200331 03/06/08 12:36 PM
S
sigbin
sigbin
S
thankz everyone...

but how about if i want to save the log.txt in a certain folder and on the filename of the txt file ill include the date... like "mm/dd log.txt" filename and it will be saved in a folder within the mirc folder...

so meaning different log files for the different day... can it be posibble?

Last edited by sigbin; 03/06/08 12:43 PM.
#200332 03/06/08 01:00 PM
L
Lpfix5
Lpfix5
L
Originally Posted By: sigbin
thankz everyone...

but how about if i want to save the log.txt in a certain folder and on the filename of the txt file ill include the date... like "mm/dd log.txt" filename and it will be saved in a folder within the mirc folder...

so meaning different log files for the different day... can it be posibble?


.write $+($date(mm-dd),-,log.txt) data


Link Copied to Clipboard