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?
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) }
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.
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.
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
}
}
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?
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