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

	<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>2023-06-17T18:38:49-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2023-06-17T18:38:49-04:00</updated>

		<published>2023-06-17T18:38:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112006#p112006</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112006#p112006"/>
		<title type="html"><![CDATA[blacklisted channel with cron]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112006#p112006"><![CDATA[
we have been using this tcl for a while and noticed  the lappend part ( in proc Xbc_whoisX ) doesnt actually stack the nicks that are found on a blacklisted channel as intented then i took a closer look and it seems the bind raw 319 goes thru the nicks one by one so i was wondering if there would be a way to stack the nicks to send away to the kick poc <br> BadchanStackKicks<br><br>here is the code we work with hopefully someone knows a way to achieve what we desired with it:<br><div class="codebox"><p>Code: </p><pre><code>namespace eval whois {  bind cron - {*/5 * * * *} [namespace current]::whois:cron  setudef flag stackedwhois  proc whois:cron {min hour day month weekday} {    foreach channel [channels] {      if {![channel get $channel stackedwhois]} continue      if {![botisop $channel]} continue      foreach member [chanlist $channel] {        if {[isbotnick $member]} continue        if {[isop $member $channel] || [ishalfop $member $channel] || [matchattr [nick2hand $member] fon|fon $channel]} continue        lappend userList $member      }      if {[info exists userList]} { Stack:WHois $channel $userList }    }  }  proc Stack:WHois {chan userList {max 20}} {    set ::chanxer $chan    set userList [lsort -unique $userList]    set count [llength $userList]    set counter 0    while {$count &gt; 0} {      if {$count &gt; $max} {        set users [join [lrange $userList 0 [expr {$max - 1}]] ","]        set userList [lreplace $userList 0 [expr {$max -1}]]        incr count -$max      } else {        set users [join $userList ","]        set count 0      }      incr counter 1      after [expr {$counter*5000}] [list  putserv "Whois :$users"]     }  }  bind raw - 319 [namespace current]::Xbc_whoisX  proc whoisXUnbind {from key arg} {    unbind raw - 319 [namespace current]::Xbc_whoisX  }  proc Xbc_whoisX {from key arg} {    set BadChanList [list]    set arg [split $arg]    set nick [lindex $arg 1]    set chost [getchanhost $nick $::chanxer]    regsub -all -- ~ $chost "" chost    set listchans [lrange $arg 2 end]    regexp -- {^:?(.*)$} [join $listchans] -&gt; text    set text [split $text]    set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]    if {[regexp -nocase {gay|[sf]uck|cam|incest|sex|cum|teenwankin|jackinchat|bdsm|wtf|kcuf|TestChan} $text]} {       lappend BadChanList $nick      if {[string match -nocase "*@*irccloud*" $chost]} {         set ident  [lindex [split $chost @] 0]        set xbmaskx [string map {sid id uid id} $ident]        set bmask  *!*[string tolower $xbmaskx ]@*        if {![ischanban $bmask $::chanxer]} { pushmode $::chanxer +b $bmask }      } elseif {![string match -nocase "*@*irccloud*" $chost] &amp;&amp; ![ischanban [maskhost $nick!$chost 2] $::chanxer]} {        set bmask [maskhost $nick!$chost 2]        if {![ischanban $bmask $::chanxer]} { pushmode $::chanxer +b $bmask }      }    }    if {[info exists BadChanList]} {[namespace current]::BadchanStackKicks $::chanxer $BadChanList }  }  proc BadchanStackKicks {chan kicklist {max 4}} {    set count [llength $kicklist]    set counter 0    while {$count &gt; 0} {      if {$count &gt; $max} {        set users [join [lrange $kicklist 0 [expr {$max - 1}]] ","]        set kicklist [lrange $kicklist $max end]        incr count -$max      } else {        set users [join $kicklist ","]        set count 0      }      incr counter 1      after [expr {$counter*5000}] [list  putnow "KICK $chan $users :BlackListed CHANNEL DETECTED"]            }  }}</code></pre></div><br>Much appreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Jun 17, 2023 6:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
