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

	<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>2022-03-26T16:40:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-03-22T06:05:06-04:00</updated>

		<published>2022-03-22T06:05:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111033#p111033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111033#p111033"/>
		<title type="html"><![CDATA[BadNicks added and removed with pub command more effiecient]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111033#p111033"><![CDATA[
Thanks CC i will try and work with that<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Tue Mar 22, 2022 6:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-03-21T05:10:45-04:00</updated>

		<published>2022-03-21T05:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111032#p111032</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111032#p111032"/>
		<title type="html"><![CDATA[BadNicks added and removed with pub command more effiecient]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111032#p111032"><![CDATA[
As I said before, I think that storing bans in eggdrop (built-in list) is better than in any external source.<br>As you want to use masks (with wildcards), other solutions will require a loop to check if the user matches or not because lsearch doesn't work when the list contains masks.<br>You can use a database but you'll require a package (mysql or sqlite) and queries won't work with wildcards (same as lsearch).<br><br>So, with external storage, the only way is to use it to recreate the tcl list, and loop on this list.<br><br>Example with a text file:<div class="codebox"><p>Code: </p><pre><code>set kbnicks {}set dbfile "kbnicks.db"# proc to load the file in $kbnicks variableproc kbinit {} {   if {![file exists $::dbfile]} {      set fo [open $::dbfile w]      close $fo   }   set fi [open $::dbfile r]   set ::kbnicks [split [read -nonewline $fi] "\n"]   close $fi}# add a ban in variablebind pub -|n !kbaddproc kbadd {nick uhost handle chan text} {   # I don't do the tests and all features needed, just adding   lappend ::kbnicks $text   kbrewrite}# remove a ban in variablebind pub -|n !kbremproc kbrem {nick uhost handle chan text} {   # do your checks   lreplace $::kbnicks [lsearch $::kbnicks $text] [lsearch $::kbnicks $text]   kbrewrite}# rewrite the fileproc kbrewrite {} {   set fo [open $::dbfile w]   foreach n $::kbnicks {      puts $fo $n   }   close $fo}# call to init on load / startupkbinit</code></pre></div>With this code, you can store your base in a file and keep the actual way your script work (loop on $::kbnicks)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Mar 21, 2022 5:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-03-21T04:12:14-04:00</updated>

		<published>2022-03-21T04:12:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111031#p111031</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111031#p111031"/>
		<title type="html"><![CDATA[BadNicks added and removed with pub command more effiecient]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111031#p111031"><![CDATA[
Thanks for your reply cc the comparison part is fine i just was wondering if there would be a more efficient way of storing the list of bad nicks rather than a txt file unless it doesn't compromise performance having to loop through the text file on each join in channel<br><br>And of course the part that allows adding and removing bad nicks on the go with public command<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Mar 21, 2022 4:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2022-03-20T11:11:01-04:00</updated>

		<published>2022-03-20T11:11:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111030#p111030</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111030#p111030"/>
		<title type="html"><![CDATA[BadNicks added and removed with pub command more effiecient]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111030#p111030"><![CDATA[
Well, I'm not sure I understand your questions.<br>You can easily store the nicks (or masks) in a file and have it loaded only when eggdrop starts (or script is loaded), the file will just be a memory to let you manage the list easily.<br><br>If you want to use masks rather than nicks, you'll have to compare ${nick}!${uhost} with the stored values, probably with a little check to know if you've stored a nick or an host.<br><br>And peharps the simplest way could be to create permanent bans in the eggdrop, so you don't care about the storage and the optimization:<div class="codebox"><p>Code: </p><pre><code>foreach b $::bnickxero {   if {![string match *!*@* $b]} {      # $b is a nick, creating a host      set b $b!*@*   }   newban $b $::botnick "bad nick" 0   # you can also use newchanban if you don't want global ban}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Mar 20, 2022 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-03-26T16:40:44-04:00</updated>

		<published>2022-03-20T06:00:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111029#p111029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111029#p111029"/>
		<title type="html"><![CDATA[BadNicks added and removed with pub command more effiecient]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111029#p111029"><![CDATA[
i was wondering if and how this tcl i got from RANA USMAN wich stores the badnicks in a var in the tcl itself could be changed to store more effiecient like mircs hash tables does and not in a text file wich most if not all tcls seem to have in tcls i come across<br><br> <div class="codebox"><p>Code: </p><pre><code>set bnickxero {"all4m""a||4m""aII4m""banger""suicide""siucide""hotter""h0tter""s*exy""needgirl""ne3dgirl""n3edglrl""n33dglrl""n3edg|rl""o-r-a-l""l3sbl""l3sbl""lesb|""l3sb|""lesbian""l3sbian""lesbion""l3sbion""f2f""f2f""niple""merried""meried""hotcam""bedroom""gentlebiter""bedro0m""bedr00m""bedr0om""naked""nudist""0inch""1inch""2inch""3inch""4inch""5inch""6inch""7inch""8inch""9inch""prostitut""HOMO""h0mo""hom0""gay""assho""pussy""[censored]""animal""cam2cam""cock""romantic""webcam""ugly""hotgirl""dick""suck""[censored]""tits""boob""sex""terror""pedo""whore""slut""hotmale""hotfemale""hotgirl""hotwoman""hotwomen""hotman""hotmen""skype""whatsapp""maried""Shortclips""want""btm""kuzz""phudd""phudi""phuud""lulla""kanj*r""randi""choot""madarchod""chodu""kuss""wife""died""b2b""onlyboy""moth*r""shalwar""madarlun""husband""breast""breasst""69""h*tb*y""chikna"}set kickreasonxero "choose a more apropriate nick thank you"bind join - * join:RanaUsmanxerobind nick - * nick:tvrshxeroproc nick:tvrshxero {nick uhost hand chan newnick} {join:RanaUsman $newnick $uhost $hand $chan}proc join:RanaUsmanxero {nick uhost hand chan} {global bnickxero  kickreasonxero tempregsub -all -- {(.)\1+} $nick {\1} nick2x2if {($nick != $::botnick)} {set temp 0foreach ixo [string tolower $bnickxero] {if {[string match *$ixo* [string tolower $nick]] &amp;&amp; ![string match -nocase *guest* $nick]} {set badpart $ixoset temp 1}}}if {!$temp} { return } {pushmode $chan +b *$badpart*!*@*putserv "kick $chan $nick :$kickreasonxero"}}</code></pre></div>other similar tcls i came across seem to have a lot of extra bells and whistles <br>like setting bans on host and ident and such  while we wanted to store and check on join with *nick*!*@* to see if any bad parts match<br><br>also lot of similar tcls that have pub command to add and del badnicks have <br> stored bad nicks in a text file so it would need to loop the file on each joining nick wich isnt effiecient when  the list is potentially  large.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Mar 20, 2022 6:00 am</p><hr />
]]></content>
	</entry>
	</feed>
