<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/13590" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2010-11-23T16:11:40-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/13590</id>

		<entry>
		<author><name><![CDATA[Fraud]]></name></author>
		<updated>2010-11-23T16:11:40-04:00</updated>

		<published>2010-11-23T16:11:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95187#p95187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95187#p95187"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95187#p95187"><![CDATA[
well, this is quit an old thread, but could any do a recode for Quakenet?! Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9931">Fraud</a> — Tue Nov 23, 2010 4:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-14T08:33:03-04:00</updated>

		<published>2007-06-14T08:33:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73549#p73549</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73549#p73549"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73549#p73549"><![CDATA[
They're documented in the tcl-manual, under the keyword <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.htm" class="postlink">re_syntax</a>. You'll find them documented under "character class" under "bracket expressions".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Jun 14, 2007 8:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-14T05:32:06-04:00</updated>

		<published>2007-06-14T05:32:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73547#p73547</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73547#p73547"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73547#p73547"><![CDATA[
Thanks alot nml375, your script works exactly the way I want it to. It does detect split users correctly. Maybe because of my so many if statements with all those regexp's and string manipulation commands, your one regexp was sufficient to replace all of them with.<br><div class="codebox"><p>Code: </p><pre><code>if {![regexp -- {^([[:alnum:][:punct:]]+)[[:space:]]([[:alnum:][:punct:]]+)$} $arg _arg server1 server2]} {return 0} </code></pre></div>I am not even sure how this works, basically the match words.<br>[:alnum:] = alphanumeric characters?<br>[:punct:] = punctuation?<br>[:space:] = space<br><br>I can't even find these match words in the regexp TCL manual. Do you know any good website where I can refer to for more of these and how to use them properly in my scripts?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jun 14, 2007 5:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-13T10:59:54-04:00</updated>

		<published>2007-06-13T10:59:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73528#p73528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73528#p73528"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73528#p73528"><![CDATA[
Just tested, the raw binding works just fine for me on 1.6.17:<div class="codebox"><p>Code: </p><pre><code>&lt;NML_375&gt; .binds raw&lt;(bot&gt; [16:56] #NML_375# binds raw&lt;(bot&gt; Command bindings:&lt;(bot&gt;   TYPE FLGS     COMMAND              HITS BINDING (TCL)&lt;(bot&gt;   raw  -|-      QUIT                    5 dump</code></pre></div>Dump is a simple proc that just sends any and all parameters to my dcc session.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 13, 2007 10:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-13T10:08:32-04:00</updated>

		<published>2007-06-13T10:08:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73527#p73527</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73527#p73527"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73527#p73527"><![CDATA[
Perhaps considder something alot simpler, such as this?<div class="codebox"><p>Code: </p><pre><code>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] &amp;&amp; [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] }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 13, 2007 10:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-13T10:14:09-04:00</updated>

		<published>2007-06-13T09:25:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73523#p73523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73523#p73523"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73523#p73523"><![CDATA[
That is odd, as it really should..<br><br>Looking through the rest of the code, this caught my attention tho:<div class="codebox"><p>Code: </p><pre><code>     foreach chan [channels] {      putquick "NOTICE $chan :Netsplit detected: $server1 just split from $server2" -next      set netsplit_detected 1; utimer 20 [list do:netsplit:unlock]; return 1     } </code></pre></div>I'm not sure why you have a return-statement there, and especially not why you use the returncode 1 (this can seriously screw things up for you).<br><br>Perhaps considder something like this instead?<div class="codebox"><p>Code: </p><pre><code>     foreach chan [channels] {      putquick "NOTICE $chan :Netsplit detected: $server1 just split from $server2" -next     }     set netsplit_detected 1     utimer 20 [list do:netsplit:unlock]</code></pre></div>Also solves the issue of multiple timers...<br><br>Finally, your method for extracting the servernames from the textline seems... owerworked and way more complex than it has to be...<br>"string map {" " "."}" isn't really a good replacement for join..<br><br>Also, your notification will always say: "Netsplit detected: dal.net just splitted from dal.net", not sure if that's what you intended it todo.<br><br>You can also use "end offsets" with lrange (and the other list manipulation commands), such as "lrange $somelist end-2 end".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 13, 2007 9:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-13T04:01:44-04:00</updated>

		<published>2007-06-13T04:01:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73516#p73516</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73516#p73516"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73516#p73516"><![CDATA[
Weird, the proc doesn't fire on bind raw with keyword QUIT also. Heres the script I use:<br><div class="codebox"><p>Code: </p><pre><code>bind raw - QUIT detect:netsplitproc 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 }; set arg [split $arg]  if {([llength $arg] == "2") &amp;&amp; [regexp {^(.*) (.*)$} $arg] &amp;&amp; [string is lower [string map {"." "" " " ""} $arg]] &amp;&amp; ([regexp {[0-9]} $arg] == "0") &amp;&amp; ([string length [string map {"." "" " " ""} $arg]] == [regexp -all {[a-z]} $arg]) &amp;&amp; ([regexp -all {\.} [lindex $arg 0]] &gt;= 3) &amp;&amp; ([regexp -all {\.} [lindex $arg 1]] &gt;= 3)} {   set server1 [string map {" " "."} [lrange [split [lindex $arg 0] "."] [expr [llength [split [lindex $arg 0] "."]] - 2] end]]   set server2 [string map {" " "."} [lrange [split [lindex $arg 1] "."] [expr [llength [split [lindex $arg 1] "."]] - 2] end]]    if {[string equal "dal.net" $server1] &amp;&amp; [string equal "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]; return 1      }    }  }}proc do:netsplit:unlock {} { global netsplit_detected if {[info exists netsplit_detected]} {  unset netsplit_detected  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jun 13, 2007 4:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-06-12T05:30:44-04:00</updated>

		<published>2007-06-12T05:30:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73468#p73468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73468#p73468"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73468#p73468"><![CDATA[
Since the mIRC client displays splits as normal quits then my guess is that it is a raw QUIT.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Jun 12, 2007 5:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-12T05:25:47-04:00</updated>

		<published>2007-06-12T05:25:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73466#p73466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73466#p73466"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73466#p73466"><![CDATA[
Will the raw bind with keyword QUIT trigger for people who split from a channel?<br><br>If so, I could parse the reason in the argument to determine if a netsplit occured or not, that would be simple.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jun 12, 2007 5:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-06-12T05:20:11-04:00</updated>

		<published>2007-06-12T05:20:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73465#p73465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73465#p73465"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73465#p73465"><![CDATA[
How about a raw-bind to catch quits and do the parsing of the reason by yourself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Jun 12, 2007 5:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-11T22:02:37-04:00</updated>

		<published>2007-06-11T22:02:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73457#p73457</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73457#p73457"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73457#p73457"><![CDATA[
Yup.<br>One option might be to monitor &amp;servers for server notices, which might allow you to detect more netsplits.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 11, 2007 10:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-11T21:48:43-04:00</updated>

		<published>2007-06-11T21:48:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73455#p73455</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73455#p73455"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73455#p73455"><![CDATA[
However I see that, for bind split:<br><blockquote class="uncited"><div>SPLT (stackable)<br><br>bind splt &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;<br>procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;channel&gt;<br><br>Description: triggered when someone gets netsplit on the channel. Be aware that this may be a false alarm (it's easy to fake a netsplit signoff message on some networks); mask may contain wildcards and is matched against '#channel nick!user@host'. Anyone who is SPLT will trigger a REJN or SIGN within the next wait-split (defined in the config file) minutes.<br><br>Module: irc</div></blockquote>There are no parameters in the proc to display any text. So how would I be able to display which server split off from the network in that case? Any suggestions? Bind raw maybe, with a specific keyword?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jun 11, 2007 9:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-11T20:34:42-04:00</updated>

		<published>2007-06-11T20:34:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73451#p73451</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73451#p73451"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73451#p73451"><![CDATA[
Okay thanks, I will split my text into a list at the beginning of the proc.<br><br>Yes the binding does not fire, hence I thought that was the main problem, since the proc didn't execute at all, so I guess bind splt should be used here in this case. The global var detect_netsplit was intended since the bind will detect the netsplit message for all people who quit in the netsplit, hence the netsplit message should be only displayed once on the channel for everyone who splits (not for everyone individually who splits - causing a flood).<br><br>Anyway, thanks! I will try the splt binding and keep you upto date as to what happens.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jun 11, 2007 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-11T11:42:28-04:00</updated>

		<published>2007-06-11T11:42:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73422#p73422</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73422#p73422"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73422#p73422"><![CDATA[
First off, use lindex, llenght, and lrange on lists only...<br>One good way to keep track of lists and texts, is to split your text into a list, and store it in a separate variable, at the beginning of the proc (applies for those strings you intend to use list-commands on later on).<br><br>Also, the sign-binding should not trigger when a split occurs, as eggdrop has its own detection. In this case the splt-binding will trigger instead.<br>Checking wether the binding has been triggered might be a good start... (use .binds for this).<br><br>Also worth noting, your current proc will create one timer (to unset the globalspace variable detect_netsplit) for each channel it monitors.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 11, 2007 11:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-06-11T10:41:13-04:00</updated>

		<published>2007-06-11T10:41:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73419#p73419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73419#p73419"/>
		<title type="html"><![CDATA[Netsplit detection msg to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73419#p73419"><![CDATA[
Hi!<br><br>I am trying to accomplish this thing. Err well it works as detects users splitting with a quit message, and then it has to display on all channels the bot is on that a netsplit has occurred.<br><br>So this netsplit detection is for DALnet and it is detected by the quit message of the user. The netsplit cannot be faked. This is the message to detect a netsplit.<br><blockquote class="uncited"><div>* spliff (~<a href="mailto:spliff@adslfixo-b3-127-230.telepac.pt">spliff@adslfixo-b3-127-230.telepac.pt</a>) Quit (brain.hub.eu.dal.net hotspeed.sg.as.dal.net)<br>* ismokealo (~<a href="mailto:ismokealo@c-71-201-208-32.hsd1.il.comcast.net">ismokealo@c-71-201-208-32.hsd1.il.comcast.net</a>) Quit (brain.hub.eu.dal.net hotspeed.sg.as.dal.net)<br>* bamford6 (~<a href="mailto:bamford6@user-544487d3.lns5-c10.dsl.pol.co.uk">bamford6@user-544487d3.lns5-c10.dsl.pol.co.uk</a>) Quit (brain.hub.eu.dal.net hotspeed.sg.as.dal.net)</div></blockquote>This is the script which I came up with, but it doesn't seems to work or give any response whatsoever. Any suggestions?<br><div class="codebox"><p>Code: </p><pre><code>bind sign - "*" detect:netsplitproc detect:netsplit {nick uhost hand chan text} { global detect_netsplit if {[info exists detect_netsplit]} { return 0 } if {[string equal "Quit:" [string map {" " ""} [lindex $text 0]]]} { return 0 }  if {[string equal "2" [llength $text]] &amp;&amp; [regexp {^(.*) (.*)$} $text] &amp;&amp; [string is lower [string map {"." "" " " ""} $text]] &amp;&amp; ([regexp -all {[0-9]} $text]] == "0") &amp;&amp; ([regexp -all {\.} [lindex $text 0]] &gt;= 3) &amp;&amp; ([regexp -all {\.} [lindex $text 1]] &gt;= 3)} {   set server1 [string map {" " "."} [lrange [split [lindex $text 0] "."] [expr [llength [split [lindex $text 0] "."]] - 2] end]]   set server2 [string map {" " "."} [lrange [split [lindex $text 1] "."] [expr [llength [split [lindex $text 1] "."]] - 2] end]]    if {[string equal "dal.net" $server1] &amp;&amp; [string equal "dal.net" $server2]} {     foreach chan [channels] {      putquick "PRIVMSG $chan :Netsplit detected: $server1 just split from $server2" -next      set detect_netsplit 1; utimer 20 [list "unset detect_netsplit"]      }    }  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jun 11, 2007 10:41 am</p><hr />
]]></content>
	</entry>
	</feed>
