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

	<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>2017-04-02T23:24:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2017-04-02T23:24:42-04:00</updated>

		<published>2017-04-02T23:24:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106051#p106051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106051#p106051"/>
		<title type="html"><![CDATA[badwords by MadaliN exception individual words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106051#p106051"><![CDATA[
Work perfectly!<br>Thanks SpiKe^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sun Apr 02, 2017 11:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2017-04-02T20:58:09-04:00</updated>

		<published>2017-04-02T20:58:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106048#p106048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106048#p106048"/>
		<title type="html"><![CDATA[badwords by MadaliN exception individual words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106048#p106048"><![CDATA[
I find this sort of thing to work on some similar scripts.<br><br>Replace<div class="codebox"><p>Code: </p><pre><code>[string match -nocase "*[lindex [split $b ,] 1]*" $arg]</code></pre></div>with<div class="codebox"><p>Code: </p><pre><code>[string match -nocase "* [lindex [split $b ,] 1] *" " $arg "]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Apr 02, 2017 8:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2017-04-02T18:43:41-04:00</updated>

		<published>2017-04-02T18:43:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106047#p106047</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106047#p106047"/>
		<title type="html"><![CDATA[badwords by MadaliN exception individual words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106047#p106047"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#### ++++ Author: MadaliN &lt;madalinmen28@yahoo.com### ++++ Script name: Badwords## ++++ Version: 1.0 (2/9/2013)## Commands#      !badwords on/off#      !badwords ban-reason REASON#      !badwords ban-type 1/2/3/4 (!badwords ban-type 1)#      !badwords add WORD/PHRASE#      !badwords del WORD/PHRASE#      !badwords listsetudef flag badwordsbind PUB n !badwords badwords:pubbind PUBM - * badwords:pubmproc mh {nuhost type} {   set user [lindex [split $nuhost !] 0]   set host [lindex [split $nuhost !] 1]   switch $type {      1 {return $nuhost}      2 {return *!*@$host}      3 {return *!*$user@$host}      4 {return *!*$user@*}   }}proc badwords:pubm {nick uhost hand chan arg} {   global badwords tempbw   if {[channel get $chan badwords]} {      foreach b [array names badwords $chan,*] {         if {[string match -nocase "*[lindex [split $b ,] 1]*" $arg] &amp;&amp; ![matchattr $hand n] &amp;&amp; ![isop $nick $chan]} {            if {![info exists tempbw($chan,ban-type)]} { set tempbw($chan,ban-type) 2 }            if {![info exists tempbw($chan,reason)]} { set tempbw($chan,reason) "Hit the door ya ;" }            newchanban $chan [mh $nick!$uhost $tempbw($chan,ban-type)] $nick $tempbw($chan,reason) 0            putserv "KICK $chan $nick :$tempbw($chan,reason)"         }      }   }}proc badwords:pub {nick uhost hand chan arg} {   global badwords tempbw   set what [join [lrange [split $arg] 1 end]]   switch -exact -- [lindex [split $arg] 0] {      ban-type -      -ban-type {         if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify ban-type (1/2/3/4)"; return }         if {![regexp {^(1|2|3|4)$} [lindex [split $arg] 1]]} { putserv "PRIVMSG $chan :\002$nick\002 valid types are 1/2/3 or 4 (!badwords ban-type 2)"; return }         set tempbw($chan,ban-type) $what         badwords:save         putserv "PRIVMSG $chan :\002$nick\002 - 'ban-type' has been SET"      }      -r -      -reason {         if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify ban-reason"; return }         set tempbw($chan,reason) $what         badwords:save         putserv "PRIVMSG $chan :\002$nick\002 - 'ban-reason' has been SET"      }      on -      -on {         channel set $chan +badwords         putserv "PRIVMSG $chan :\002$nick\002 - Succesfully activated \00303badwords\003 script on this channel"      }      off -      -off {         channel set $chan -badwords         putserv "PRIVMSG $chan :\002$nick\002 - Succesfully deactivated \00303badwords\003 script on this channel"      }      add -      -add {         if {[info exists badwords($chan,$what)]} {            putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' already exists in the database."            return         } else {            set badwords($chan,$what) "[unixtime]"            badwords:save            putserv "PRIVMSG $chan :\002$nick\002 - Succesfully added '\00312$what\003' into the database."            return         }      }      del -      -del {         if {![info exists badwords($chan,$what)]} {            putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' was not found in the database."            return         } else {            unset -nocomplain badwords($chan,$what)            badwords:save            putserv "PRIVMSG $chan :\002$nick\002 - Succesfully removed '\00312$what\003' from the database."            return         }      }      list -      -list {         set temp(list) ""         foreach b [array names badwords $chan,*] { lappend temp(list) [lindex [split $b ,] 1] }         if {$temp(list) == ""} { putserv "PRIVMSG $chan :\002$nick\002 - Badwords database for \00303$chan\003 is \002empty\002"; return }         putserv "PRIVMSG $chan :\002$nick\002 - Badwords: [join $temp(list) ", "]"      }      reset -      -reset {         foreach b [array names badwords $chan,*] {            unset -nocomplain badwords($chan,[lindex [split $b ,] 1])         }         badwords:save         putserv "PRIVMSG $chan :\002$nick\002 - Succesfully RESET badwords"      }   }}proc badwords:save {} {   global badwords tempbw   set ofile [open badwords w]   puts $ofile "array set badwords [list [array get badwords]]"   puts $ofile "array set tempbw [list [array get tempbw]]"   close $ofile}catch {source badwords}putlog "++++ Succesfully loaded: \00312Badwords TCL Script"</code></pre></div>I need certain words to be excepted by the code.<br>I have succeeded, but only partially.<br>Example:<br>Badwords == <span style="color:red">puta</span>, sexo, porno, ....more words....<br>If someone writes the word "di<span style="color:red">puta</span>da", containing the pattern "<span style="color:red">puta</span>", the bot penalizes.<br><span style="text-decoration:underline"><span style="color:red">Partial solution</span></span>:<blockquote class="uncited"><div>proc badwords:pubm {nick uhost hand chan arg} {<br>   global badwords tempbw<br><br>   if {[channel get $chan badwords]} {<br>      foreach b [array names badwords $chan,*] {<br>        <span style="color:red"> if {[string match -nocase "*diputada*" $arg]} { continue }</span><br>         if {[string match -nocase "*[lindex [split $b ,] 1]*" $arg] &amp;&amp; ![matchattr $hand n] &amp;&amp; ![isop $nick $chan]} {<br>........................................more stuff..................................</div></blockquote><span style="text-decoration:underline"><span style="color:red">Why partial?</span></span><br>If someone writes the phrase "la mejor diputada del mundo"<br>Work perfect! The boT does not penalize the user for writing "diputada".<br><br>but.................<br><br>If someone writes the phrase "a la diputada le gusta el sexo duro"<br>The bot does not penalize the word "sexo".<br><br>Any solution for the exception of individual words in a sentence, without the bot ceasing to control all other words?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sun Apr 02, 2017 6:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
