mIRC Homepage
Posted By: sigbin onjoin script - 02/06/08 08:42 AM
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?
Posted By: Lpfix5 Re: onjoin script - 02/06/08 04:32 PM
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) }
Posted By: RusselB Re: onjoin script - 02/06/08 11:48 PM
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.
Posted By: Riamus2 Re: onjoin script - 03/06/08 03:51 AM
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
  }
}
Posted By: sigbin Re: onjoin script - 03/06/08 12:36 PM
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?
Posted By: Lpfix5 Re: onjoin script - 03/06/08 01:00 PM
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
© mIRC Discussion Forums