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

	<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>2025-10-07T06:25:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2025-10-07T06:25:13-04:00</updated>

		<published>2025-10-07T06:25:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113369#p113369</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113369#p113369"/>
		<title type="html"><![CDATA[Banmask proc for dalnet]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113369#p113369"><![CDATA[
Proper banmask setting for dalnet  in 1 proc for all your ban settings in your scripts<br>And you can use this when u need to set a ban on someone in a proc<br><br>Example:<div class="codebox"><p>Code: </p><pre><code>############################ Proc for the banmask ############################proc BanMsk {uhost} {     if {[string match -nocase "*@*.irccloud.com" $uhost]} {                       return "*!*[string map {sid id uid id} [string trimleft [lindex [split $uhost @] 0] "~"]]@*"                  }  else { return "*!*@[lindex [split $uhost "@"] 1]" }}####################################### Proc for checking access levels #######################################proc AccessChker {nick chan} {  if {[matchattr [nick2hand $nick] o|o $chan]} { return 1 }; foreach type {op halfop} { if {[is$type $nick $chan]} { return 1 } }; return 0 }proc NOAccessChker {nick chan} {  if {[matchattr [nick2hand $nick] of|of $chan]} { return 1 }; foreach type {op halfop} { if {[is$type $nick $chan]} { return 1 } }; return 0 }####################### Proc for kickban ######################bind pub -|- !kb Pub:Kbanproc  Pub:Kban {nick uhost hand chan text} {  if {![AccessChker $nick $chan]} { return 0 }       set text [split [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]]     set target [string trimright [string trimleft [lindex [split $text] 0] "@%+"] ":"]     set reason [join [lrange [split $text] 1 end]]     if {![llength $text]} { putserv "Notice $nick :Syntax is !KB \&lt;nick\&gt; \&lt;reason\&gt;" ; return 0 }     if {[NOAccessChker $target $chan]} { return 0 }   if {$reason eq ""} {  set reason "Kicked By\: $nick --- Reason\: Requested."      } else { set reason "Kicked By\: $nick --- Reason\: $reason" }      if {[AccessChker $target $chan]} { return 0 }     set lastChar [string index $reason end]    if {$lastChar ni {\. ! ?}} { append reason "." }     if {![onchan $target $chan]} {                            putserv "Notice $nick :$target is not on channel $chan"                                  } else {                      if {![ischanban [BanMsk $chost] $chan]} { putserv "mode $chan +b [BanMsk $chost]" }                         putserv "kick $chan $target :$reason"    }}  #################### Proc for kick ################### bind pub -|- !k Pub:Kickerproc  Pub:Kicker {nick uhost hand chan text} {  if {![AccessChker $nick $chan]} { return 0 }       set text [split [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]]     set target [string trimright [string trimleft [lindex [split $text] 0] "@%+"] ":"]     set reason [join [lrange [split $text] 1 end]]     if {![llength $text]} { putserv "Notice $nick :Syntax is !K \&lt;nick\&gt; \&lt;reason\&gt;" ; return 0 }     if {[NOAccessChker $target $chan]} { return 0 }        if {$reason eq ""} {  set reason "Kicked By\: $nick --- Reason\: Requested."      } else { set reason "Kicked By\: $nick --- Reason\: $reason" }     if {[AccessChker $target $chan]} { return 0 }     set lastChar [string index $reason end]    if {$lastChar ni {\. ! ?}} { append reason "." }     if {![onchan $target $chan]} {                  putserv "Notice $nick :$target is not on channel $chan"                                  } else { putserv "kick $chan $target :$reason" }} ########################## Proc for Nick ban  ##########################  bind pub -|- !nb pub:BadNickBannerbind pub -|- !n pub:BadNickBannerbind pub -|- .n pub:BadNickBannerbind pub -|- .nb pub:BadNickBanner   proc pub:BadNickBanner {nick host hand chan text} {  if {![AccessChker $nick $chan]} { return 0 }   global botnick     set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]      set bannedmasksxSZ [list]        set nicktarget [string trimright [string trimleft [lindex [split $text] 0] "@%+"] ":"]       if {![llength $nicktarget]} {  putserv "Notice $nick :Syntax is !n \&lt;nick\/banmask\&gt; "  ;  return 0 }      if {[NOAccessChker $nicktarget $chan] || [string match -nocase "*${botnick}*" $nicktarget]} { return 0 }            set nicktarget2 [string trim [regsub -nocase -all {[\?\*|a|i|e|u|o|x|0-9|\{\}\[\]\|\\\\`\-\_\`\^]+} $nicktarget ""] ""]        set targetnick3 [string trim [regsub -nocase -all {[0-9|\{\}\[\]\|\\\\`\-\_\`\^]+} $nicktarget ""] ""]        set nicktarget4 [string trim [regsub -nocase -all {[^a|i|e|u|o|x|0-9|\{\}\[\]\|\\\\`\-\_\`\^]+} $nicktarget ""] ""]        set nicktarget5 "[string trim [regsub -nocase -all {[\?|a|i|e|u|o|x|0-9|\{\}\[\]\|\\\\`\-\_\`\^]+} $nicktarget "*"] ""]"        set Badcharsz "[string length [regsub -all {\ } $nicktarget4 ""]]"        set Goodcharsz "[string length [regsub -all {\ } $nicktarget2 ""]]"        regsub -all -- {(.)\1+} $nicktarget2 {\1*} nicktarget2        regsub -all -- {(.)\1+} $nicktarget2 {\1*} nicktarget3        regsub -all -- {(.)\1+} $targetnick3 {\1*} targetnick3        regsub -all -- {(.)\1+} $nicktarget5 {\1*} nicktarget5        regsub -all -- {(((.)\3)\3+)} $nicktarget {\2*} nicktarget6        set nicktarget7 [string trim [regsub -nocase -all {[0-9|\{\}\[\]\|\\\\`\-\_\`\^]+} $nicktarget6 "*"] ""]      set length2 [string length [regsub -all {\ } $nicktarget2 ""]]      set length3 [string length [regsub -all {\ } $nicktarget ""]]      if {[string match -nocase "*Guest*" $nicktarget]} { return 0 }     set kickreason  "[join [lrange [split $text] 1 end]]"     set lastChar [string index $kickreason end]    if {$lastChar ni {\. ! ?}} { append kickreason "." }   if {[join [lrange [split $text] 1 end]] eq ""} { set kickreason2 "\00312,00 Kick-Banned by: \00306 \002$nick\002 \00312 - Reason:"   }  else { set kickreason2  "\00312,00 Kick-Banned by: \00306 \002$nick\002 \00312 - Reason: \00305  \002$kickreason\002 - " }  if {![onchan $nicktarget $chan]} {     if {($length2 &lt; 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} *$nicktarget7*!*@* {*}] }     if {($length2 == 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} *$nicktarget5*!*@* {*}]       } elseif {($length2 &gt; 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} [wildcard $nicktarget2]!*@* {*}] }           } else {               putnow "kick $chan $nicktarget :$kickreason2 \00312,00 \002«-Inappropriate-NICK-»\002"         if {($length2 &lt; 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} *$nicktarget7*!*@* {*}] }      if {($length2 == 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} *$nicktarget5*!*@* {*}]        } elseif {($length2 &gt; 5)} { lappend bannedmasksxSZ [regsub -all -- {\*{2,}} [wildcard $nicktarget2]!*@* {*}] }                    set chost [getchanhost $nicktarget $chan]           if {![ischanban [BanMsk $chost] $chan]} { lappend bannedmasksxSZ [BanMsk $chost] } } if {[llength $bannedmasksxSZ]} {      putnow "mode $chan +bb $bannedmasksxSZ"  }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Tue Oct 07, 2025 6:25 am</p><hr />
]]></content>
	</entry>
	</feed>
