<?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/2715" />

	<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>2002-10-16T21:31:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-16T21:31:04-04:00</updated>

		<published>2002-10-16T21:31:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12042#p12042</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12042#p12042"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12042#p12042"><![CDATA[
ok I have resolved thanks for the help  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Wed Oct 16, 2002 9:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-07T11:25:54-04:00</updated>

		<published>2002-10-07T11:25:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11783#p11783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11783#p11783"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11783#p11783"><![CDATA[
One tips his hat to you. Your right, I must be blind. Well, rather, I didn't even read the code, I never do when there is no forum formatting to it, due to the mess thats displayed.<br><br>In this situation, I would sugest that you mymatchattr, as the code formatting requires it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Oct 07, 2002 11:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2002-10-07T10:56:34-04:00</updated>

		<published>2002-10-07T10:56:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11773#p11773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11773#p11773"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11773#p11773"><![CDATA[
<blockquote class="uncited"><div>As is available where.<br><br>It doesn't come with eggdrop as standard.<br><br>As such, I made the comment based on this fact. If it was included, I wouldn't need to point it out.<br><br>Otherwise, it's just a whole new mess for him to locate.</div></blockquote> As is available in the code he initially posted. <br><br>*fixes your glasses*  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Oct 07, 2002 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-07T10:52:57-04:00</updated>

		<published>2002-10-07T10:52:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11771#p11771</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11771#p11771"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11771#p11771"><![CDATA[
As is available where.<br><br>It doesn't come with eggdrop as standard.<br><br>As such, I made the comment based on this fact. If it was included, I wouldn't need to point it out.<br><br>Otherwise, it's just a whole new mess for him to locate.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Oct 07, 2002 10:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2002-10-07T10:46:47-04:00</updated>

		<published>2002-10-07T10:46:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11769#p11769</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11769#p11769"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11769#p11769"><![CDATA[
The mymatchattr procedure provided is superior and also provides a standard matching attribute system for eggdrop versions 1.1.5 and higher.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Oct 07, 2002 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-10-01T15:49:07-04:00</updated>

		<published>2002-10-01T15:49:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11577#p11577</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11577#p11577"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11577#p11577"><![CDATA[
it is a proc in there called mymatchattr somewhere, but I would suggest u just forget about it and use the regular matchattr instead..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Tue Oct 01, 2002 3:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-01T15:45:11-04:00</updated>

		<published>2002-10-01T15:45:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11576#p11576</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11576#p11576"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11576#p11576"><![CDATA[
Note, you are using a command called mymatchattr.<br><br>This is not a standard eggdrop command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Oct 01, 2002 3:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-10-01T15:30:13-04:00</updated>

		<published>2002-10-01T15:30:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11573#p11573</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11573#p11573"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11573#p11573"><![CDATA[
hmm funneh coding...<br>anyway..<div class="codebox"><p>Code: </p><pre><code>bind pubm - * norepeats_pubm proc norepeats_pubm {nick uhost hand chan text} { global botnick norepeats if {![isop $botnick $chan] || [mymatchattr $hand f|#f $chan] || ([norepeats_rate $chan] == "0:0")} { return }</code></pre></div>if u want to protect just those who are op in a channel but without the o flag then just add<div class="codebox"><p>Code: </p><pre><code>[isop $nick $chan]</code></pre></div>so that it looks like this:<div class="codebox"><p>Code: </p><pre><code>if {![isop $botnick $chan] || [isop $nick $chan] || [mymatchattr $hand f|#f $chan] || ([norepeats_rate $chan] == "0:0")} { return }</code></pre></div>the f flag should already be matched, and if u want to add the o flag just make another [mymatcattr $hand.... just replace the f with o <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Tue Oct 01, 2002 3:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-01T11:54:02-04:00</updated>

		<published>2002-10-01T11:54:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11567#p11567</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11567#p11567"/>
		<title type="html"><![CDATA[problem with a norepeat tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11567#p11567"><![CDATA[
I have installed norepeat tcl but have problems for op and voice.The bot ban  also the op,t is possible to protect the +o and the +f flag?  <br>thanks<br><br><br><br><br><br><br>## CONFIGURATION ##<br><br><br># Default repeat rate flood<br># &lt;how many repeats&gt;:&lt;in how many seconds&gt;<br>set norepeats(default) 6:60<br><br># Ban on repeat? (1 = Yes , 0 = No)<br>set norepeats(banonrepeat) 1<br><br># If banning on repeat, how many minutes shall they be banned for?<br>set norepeats(bantime) 1<br><br># Kick/Ban Message to use upon repeat detection?<br>set norepeats(message) "no repeating allowed"<br><br><br>## END OF CONFIG ##<br><br><br><br>set norepeats(version) 1.1<br>set eggversion [string trimleft [lindex $version 1] 0]<br><br>if {$eggversion &lt; 1050000} {<br>  proc norepeats_load {} {<br>    global norepeats<br>    if {![file exists $norepeats(file)]} { return 0 }<br>    foreach item [array names norepeats *,rate] {<br>      catch {unset $norepeats($item)}<br>    }<br>    set infile [open "$norepeats(file)" r]<br>    while {![eof $infile]} {<br>      gets $infile dataline<br>      if {$dataline != ""} {<br>        set dchan [lindex [split $dataline] 0]<br>        set drate [lindex [split $dataline] 1]<br>        if {[validchan $dchan]} { set norepeats($dchan,rate) $drate }<br>      }<br>    }<br>    close $infile<br>    foreach chan [channels] {<br>      if {![info exists norepeats([string tolower $chan],rate)]} {<br>        set norepeats([string tolower $chan],rate) $norepeats(default)<br>      }<br>    }<br>    return 1<br>  }<br>  proc norepeats_save {} {<br>    global norepeats<br>    set outfile [open "$norepeats(file)" w]<br>    foreach chan [channels] {<br>      if {![info exists norepeats([string tolower $chan],rate)]} {<br>        set norepeats([string tolower $chan],rate) $norepeats(default)<br>      }<br>      puts $outfile "[string tolower $chan] $norepeats([string tolower $chan],rate)"<br>    }<br>    close $outfile<br>    return 1<br>  }<br>  set norepeats(file) "${nick}.rpd"<br>  regsub -all -- \\\| $norepeats(file) _ norepeats(file)<br>  regsub -all -- \\\[ $norepeats(file) _ norepeats(file)<br>  regsub -all -- \\\] $norepeats(file) _ norepeats(file)<br>  regsub -all -- \\\} $norepeats(file) _ norepeats(file)<br>  regsub -all -- \\\{ $norepeats(file) _ norepeats(file)<br>  regsub -all -- \\\' $norepeats(file) _ norepeats(file)<br>  if {![file exists $norepeats(file)]} {<br>    set outfile [open "$norepeats(file)" w]<br>    foreach chan [channels] {<br>      puts $outfile "[string tolower $chan] $norepeats(default)"<br>    }<br>    close $outfile<br>    catch {unset outfile}<br>    catch {unset chan}<br>  }<br>  bind time - "10 * * * *" norepeats_time_save<br>  proc norepeats_time_save {mi ho mo da yr} {<br>    putloglev o * "Saving norepeats data ..."<br>    norepeats_save<br>  }<br>  proc norepeats_rate {chan} {<br>    global norepeats<br>    if {![validchan $chan]} { return "0:0" }<br>    if {![info exists norepeats([string tolower $chan],rate)]} {<br>      set norepeats([string tolower $chan],rate) "$norepeats(default)"<br>    }<br>    return "$norepeats([string tolower $chan],rate)"<br>  }<br>  bind dcc n norepeats norepeats_dcc<br>  proc norepeats_dcc {hand idx text} {<br>    global norepeats<br>    set what [string tolower [lindex $text 0]]<br>    if {($what == "") || ![regexp set|mset|info $what]} {<br>      putdcc $idx "Usage: norepeats &lt;set|info&gt; &lt;channel&gt; \[value\]"<br>      return<br>    }<br>    switch $what {<br>      "set" {<br>        set chan [lindex $text 1]<br>        set rate [lindex $text 2]<br>        if {($chan == "") || ($rate == "") || ![string match "*:*" $rate]} {<br>          putdcc $idx "Usage: norepeats set &lt;channel&gt; &lt;repeats&gt;:&lt;seconds&gt;"<br>          return 0<br>        }<br>        if {![validchan $chan]} {<br>          putdcc $idx "Invalid channel $chan"<br>          return 0<br>        }<br>        set norepeats([string tolower $chan],rate) $rate<br>        putdcc $idx "Repeat rate for $chan is now $rate"<br>        norepeats_save<br>        return 1<br>      }<br>      "info" {<br>        set chan [string tolower [lindex $text 1]]<br>        if {![validchan $chan]} {<br>          putdcc $idx "Invalid channel $chan"<br>          return 0<br>        }<br>        if {![info exists norepeats($chan,rate)]} {<br>          set norepeats($chan,rate) $norepeats(default)<br>        }<br>        set num [lindex [split $norepeats($chan,rate) ":"] 0]<br>        set sec [lindex [split $norepeats($chan,rate) ":"] 1]<br>        putdcc $idx "Repeat rate for $chan: $num repeats in $sec seconds"<br>        return 1<br>      }<br>      default {<br>        putdcc $idx "Usage: norepeats &lt;set|info&gt; &lt;channel&gt;"<br>        return 0<br>      }<br>    }<br>  }<br>} else {<br>  setudef int repeat-lines<br>  setudef int repeat-time<br>  proc norepeats_rate {chan} {<br>    global norepeats<br>    if {![validchan $chan]} { return "0:0" }<br>    set chaninfo [channel info $chan]<br>    set res ""<br>    set res [lindex [lindex $chaninfo [lsearch $chaninfo "*repeat-lines*"]] 1]<br>    append res ":"<br>    append res [lindex [lindex $chaninfo [lsearch $chaninfo "*repeat-time*"]] 1]<br>    if {$res == ":"} {<br>      channel set $chan repeat-lines [lindex [split $norepeats(default) ":"] 0]<br>      channel set $chan repeat-time [lindex [split $norepeats(default) ":"] 1]<br>      set res $norepeats(default)<br>    }<br>    return "$res"<br>  }<br>}<br><br>proc handisop {hand chan} {<br>  return [expr {[validchan $chan] &amp;&amp; [isop [hand2nick $hand $chan] $chan]}]<br>}<br><br>if {($eggversion &gt;= 1030000)} {<br>  proc matchchanattr {handle flags channel} { return [matchattr $handle |$flags $channel] }<br>}<br><br>proc isoporvoice {nick chan} {<br>  return [expr {[validchan $chan] &amp;&amp; ([isop $nick $chan] || [isvoice $nick $chan])}]<br>}<br><br>proc handisoporvoice {hand chan} {<br>  return [expr {[validchan $chan] &amp;&amp; [isoporvoice [hand2nick $hand $chan] $chan]}]<br>}<br><br>proc mymatchattr {hand flags {chan ""}} {<br>  if {[regsub -all {[^&amp;|().a-zA-Z0-9@+#-]} $flags {} f]} {<br>    putloglev o * "error: (matchattr): illegal character in flags: $flags"<br>    return 0<br>  }<br>  regsub -all -- {[|&amp;]} $f {&amp;&amp;} f<br>  regsub -all -- {#-} $f {-#} f<br>  regsub -all -- {-} $f {!} f<br>  regsub -all -- {#?[a-zA-Z0-9]} $f {(&amp;)} f<br>  regsub -all -- {\(#([a-zA-Z0-9])\)} $f {[matchchanattr $hand \1 $chan]} f<br>  regsub -all -- {\(([a-zA-Z0-9])\)} $f {[matchattr $hand \1]} f<br>  regsub -all -- {\.} $f {1} f<br>  regsub -all -- {@} $f {[handisop $hand $chan]} f<br>  regsub -all -- {\+} $f {[handisoporvoice $hand $chan]} f<br>  return [expr $f]<br>}<br><br>proc norepeats_cleanqueue {chan} {<br>  global norepeats<br>  set chan [string tolower $chan]<br>  if {![info exists norepeats($chan,queue)]} { set norepeats($chan,queue) "" }<br>  set newqueue ""<br>  set rate [norepeats_rate $chan]<br>  set time [lindex [split $rate ":"] 1]<br>  foreach item $norepeats($chan,queue) {<br>    set when [lindex $item 3]<br>    if {[expr [clock seconds] - $when] &lt;= $time} {<br>      lappend newqueue $item<br>    }<br>  }<br>  set norepeats($chan,queue) $newqueue<br>}<br><br>proc norepeats_updatequeue {nick chan text} {<br>  global norepeats<br>  set nick [string tolower $nick]<br>  set chan [string tolower $chan]<br>  set text [string tolower $text]<br>  set rate [norepeats_rate $chan]<br>  if {$rate == "0:0"} { return }<br>  if {![info exists norepeats($chan,queue)]} { set norepeats($chan,queue) "" }<br>  set patt ""<br>  set pattt ""<br>  set nickt $nick<br>  regsub -all -- \\\\ $nickt \\\\\\\\ nickt<br>  regsub -all -- \\\[ $nickt \\\\\[ nickt<br>  regsub -all -- \\\] $nickt \\\\\] nickt<br>  regsub -all -- \\\} $nickt \\\\\} nickt<br>  regsub -all -- \\\{ $nickt \\\\\{ nickt<br>  lappend patt $nick<br>  lappend pattt $nickt<br>  lappend patt $text<br>  lappend pattt $text<br>  set fnd [lsearch $norepeats($chan,queue) "$pattt *"]<br>  if {$fnd == -1} {<br>    lappend patt "1"<br>    lappend patt "[clock seconds]"<br>    lappend norepeats($chan,queue) $patt<br>    norepeats_cleanqueue $chan<br>    return<br>  }<br>  set item [lindex $norepeats($chan,queue) $fnd]<br>  set times [lindex $item 2]<br>  incr times<br>  set first [lindex $item 3]<br>  lappend patt $times<br>  lappend patt $first<br>  set norepeats($chan,queue) [lreplace $norepeats($chan,queue) $fnd $fnd $patt]<br>  norepeats_cleanqueue $chan<br>  return<br>}<br><br># nick text times first<br>proc norepeats_checkqueue {nick chan text} {<br>  global norepeats<br>  set now [clock seconds]<br>  set nick [string tolower $nick]<br>  set chan [string tolower $chan]<br>  set text "[string tolower $text]"<br>  if {![info exists norepeats($chan,queue)]} { set norepeats($chan,queue) "" }<br>  set patt ""<br>  regsub -all -- \\\\ $nick \\\\\\\\ nick<br>  regsub -all -- \\\[ $nick \\\\\[ nick<br>  regsub -all -- \\\] $nick \\\\\] nick<br>  regsub -all -- \\\} $nick \\\\\} nick<br>  regsub -all -- \\\{ $nick \\\\\{ nick<br>  lappend patt $nick<br>  lappend patt $text<br>  set rate [norepeats_rate $chan]<br>  set num [lindex [split $rate ":"] 0]<br>  set time [lindex [split $rate ":"] 1]<br>  if {$rate == "0:0"} { return 0 }<br>  set fnd [lsearch $norepeats($chan,queue) "$patt *"]<br>  if {$fnd == -1} { return 0 }<br>  set item [lindex $norepeats($chan,queue) $fnd]<br>  set times [lindex $item 2]<br>  set first [lindex $item 3]<br>  if {$times &lt; $num} { return 0 }<br>  if {[expr $now - $first] &gt; $time} { return 0 }<br>  return 1<br>}<br><br>bind pubm - * norepeats_pubm<br>proc norepeats_pubm {nick uhost hand chan text} {<br>  global botnick norepeats<br>  if {![isop $botnick $chan] || [mymatchattr $hand f|#f $chan] || ([norepeats_rate $chan] == "0:0")} { return }<br>  norepeats_updatequeue $nick $chan "$text"<br>  if {[norepeats_checkqueue $nick $chan "$text"]} {<br>    if {$norepeats(banonrepeat)} {<br>      newchanban $chan "*!*@[lindex [split $uhost "@"] 1]" repeating $norepeats(message) $norepeats(bantime)<br>    }<br>    putserv "KICK $chan $nick :$norepeats(message)"<br>  }<br>  return<br>}<br><br>bind ctcp - ACTION norepeats_action<br>proc norepeats_action {nick uhost hand dest key text} {<br>  global norepeats botnick<br>  if {![validchan $dest] || ![isop $botnick $dest] || [mymatchattr $hand f|#f $dest] || ([norepeats_rate $dest] == "0:0")} {<br>    return<br>  }<br>  set chan $dest<br>  norepeats_updatequeue $nick $chan "$text"<br>  if {[norepeats_checkqueue $nick $chan "$text"]} {<br>    if {$norepeats(banonrepeat)} {<br>      newchanban $chan "*!*@[lindex [split $uhost "@"] 1]" repeating $norepeats(message) $norepeats(bantime)<br>    }<br>    putserv "KICK $chan $nick :$norepeats(message)"<br>  }<br>  return<br>}<br><br>bind time - "*5 * * * *" norepeats_cleanqueues<br>bind time - "*0 * * * *" norepeats_cleanqueues<br>proc norepeats_cleanqueues {mi ho da mo yr} {<br>  global norepeats<br>  foreach chan [channels] {<br>    set newqueue ""<br>    if {[info exists norepeats($chan,queue)]} {<br>      set chan [string tolower $chan]<br>      set rate [norepeats_rate $chan]<br>      set time [lindex [split $rate ":"] 1]<br>      foreach item $norepeats($chan,queue) {<br>        set when [lindex $item 3]<br>        if {[expr [clock seconds] - $when] &lt;= $time} {<br>          lappend newqueue $item<br>        }<br>      }<br>    set norepeats($chan,queue) $newqueue<br>    }<br>  }<br>}<br>if {$eggversion &lt; 1050000} {utimer 1 "norepeats_load"}<br><br>putlog "norepeats.tcl v$norepeats(version) by strikelight now loaded"<p>Statistics: Posted by Guest — Tue Oct 01, 2002 11:54 am</p><hr />
]]></content>
	</entry>
	</feed>
