Hi,
I am trying to make a netsplit bot with IRCnet support. On IRCnet you join a channel &servers and there are all server notices (server joins and quits), so I made this script:
on *:notice:*:&servers:{
if (*Received SQUIT* iswm $1-) {
msg %split.chan Netsplit detected: $gettok($1-,3,32)
write split.txt $gettok($1-,3,32) $ctime
}
elseif (*Received SERVER* iswm $1-) {
msg %split.chan Reconnect detected: $gettok($1-,3,32)
; Now here is that script to remove the line?
}
}
Notice on split comes like this:
[01:08] -irc.triera.si:&SERVERS- Received SQUIT *.realroot.be from *.nl (Ping timeout)
And on reconnect:
[01:26] -irc.triera.si:&SERVERS- Received SERVER *.realroot.be from *.nl (6 RealROOT Belgium)
So, every split and split time is saved in .txt file. Now when server reconnects it should say:
Reconnect detected: irc.server.com (time in minutes server has been in split)
I don't know how to $calc the time server was splited and how to remove it from splits.txt when it gets back.
And one more question: I would like to add a public command !splits so the bot will list all current splited servers and time they are being splited.
<User> !splits
<Bot> irc1.server.com (30min)
<Bot> irc2.server.com (25min)
...
Thx a lot;)