egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Netsplit Detector [SOLVED]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
jlp09550
Voice


Joined: 08 Dec 2007
Posts: 6

PostPosted: Tue Jan 01, 2008 8:49 am    Post subject: Netsplit Detector [SOLVED] Reply with quote

Well, if anyone knows of one that works on networks other than DAL, then tell me.

I was hoping for a script that will announce a netsplit when one occurs on other networks besides DALNet.

Hopefully someone can make one.

Thanks,
Jared


Last edited by jlp09550 on Tue Jan 01, 2008 8:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jan 01, 2008 9:19 am    Post subject: Reply with quote

It's simple, just change *.dal.net to whatever your network displays.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Jan 01, 2008 7:08 pm    Post subject: Reply with quote

Code:
bind raw - QUIT detect:netsplit

proc detect:netsplit {from key arg} {
 global netsplit_detected

 if {[info exists netsplit_detected]} { return 0 }

 set arg [string trimleft [stripcodes bcruag $arg] :]
 if {[string equal "Quit:" [string range $arg 0 4]]} {return 0}

 if {![regexp -- {^([[:alnum:][:punct:]]+)[[:space:]]([[:alnum:][:punct:]]+)$} $arg _arg server1 server2]} {return 0}

 if {[string match "*.dal.net" $server1] && [string match "*.dal.net" $server2]} {
  foreach chan [channels] {
   putquick "NOTICE $chan :Netsplit detected: $server1 just split from $server2" -next
  }
  set netsplit_detected 1
  utimer 20 [list do:netsplit:unlock]
 }
}

proc do:netsplit:unlock {} {
 global netsplit_detected
 if {[info exists netsplit_detected]} {
  unset netsplit_detected
  }
}

And do as Sir_Fz stated.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
jlp09550
Voice


Joined: 08 Dec 2007
Posts: 6

PostPosted: Tue Jan 01, 2008 8:41 pm    Post subject: Reply with quote

Sir_Fz wrote:
It's simple, just change *.dal.net to whatever your network displays.


Wow, never noticed that. Should of though.
Thanks anyways!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber