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

	<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>2007-09-24T15:34:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[jeremie]]></name></author>
		<updated>2007-09-24T15:34:22-04:00</updated>

		<published>2007-09-24T15:34:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76213#p76213</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76213#p76213"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76213#p76213"><![CDATA[
Thank you Sir_Fz I tried it and it works.<br><br> <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=9266">jeremie</a> — Mon Sep 24, 2007 3:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-09-24T15:17:44-04:00</updated>

		<published>2007-09-24T15:17:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76210#p76210</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76210#p76210"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76210#p76210"><![CDATA[
Yes, that line replaces your code (the foreach-statement). Give it a try.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Sep 24, 2007 3:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jeremie]]></name></author>
		<updated>2007-09-24T15:12:25-04:00</updated>

		<published>2007-09-24T15:12:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76209#p76209</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76209#p76209"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76209#p76209"><![CDATA[
Yes sorry Sir_Fz I was testing so many different pieces of code and this is what I am using.<br><div class="codebox"><p>Code: </p><pre><code>foreach user [split [chanlist $chan] " "] {    set found [string match -nocase *$user* $text]    if {$found} {      regsub -all -nocase -- $user $text "" text    } }</code></pre></div>If I used your sugestion of the regsub would it work better?<br><div class="codebox"><p>Code: </p><pre><code>regsub -nocase -all [list [join [chanlist $chan] |]] $text {} text</code></pre></div> <br><br>Would I just replace mine with yours or does your one line replace all my code?<br><br>Sorry if that's a dumb question but I am still learning.<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9266">jeremie</a> — Mon Sep 24, 2007 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-09-24T13:40:35-04:00</updated>

		<published>2007-09-24T13:40:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76205#p76205</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76205#p76205"/>
		<title type="html"><![CDATA[Re: banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76205#p76205"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>foreach user [split [chanlist $chan] " "] {    set found [string match -nocase *$user* $text]    if {$found} {      regsub -all -nocase -- $user $text [string tolower $user] text    }</code></pre></div></div></blockquote>This does not strip the nicknames from the message, instead it replaces the nicknames with their lower-case form. Not sure if that was your intention.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Sep 24, 2007 1:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jeremie]]></name></author>
		<updated>2007-09-24T07:54:03-04:00</updated>

		<published>2007-09-24T07:54:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76199#p76199</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76199#p76199"/>
		<title type="html"><![CDATA[Solved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76199#p76199"><![CDATA[
Thank you Sir_Fz for your suggestion.<br><br>Thank you awyeah for the help you have given about strings I'm sure that will be very useful for future projects.<br><br>After thinking about the problem and remebering what I said in my first post about the code working in my normal pubm proc, the solution I have come up with is to just filter the action text in my action proc and then push it through to my pubm proc.<br><br>I have done a quick test on my script and it now seems to work correctly, I will test it with all the different variables then make it live on my bots.<br><br>Once again thank you both  <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=9266">jeremie</a> — Mon Sep 24, 2007 7:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-09-24T13:14:11-04:00</updated>

		<published>2007-09-24T01:02:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76197#p76197</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76197#p76197"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76197#p76197"><![CDATA[
Just some piece of advice:<br><div class="codebox"><p>Code: </p><pre><code>set text [string trim [string range $text $nick+1 e]]set text [string trim $text {$nick+1} e]set text [string trim $text [expr $nick+1] e]</code></pre></div>You cannot perform mathematrical operations on a string which is NOT AN INTEGER, such as $nick. Since IRCd's restrict nicks to be alphanumeric.<br><br>Hence you can only perform mathematical operations such as add, sub, mul, div etc on strings which are integers.<br><br>Example:<div class="codebox"><p>Code: </p><pre><code>if {[string is integer $mydata]} { set newtext [string range $text [expr $mydata+1] end]}</code></pre></div>And by bad index it refers, this should be:<div class="codebox"><p>Code: </p><pre><code>set text [string trim $text [expr $nick+1] e]this:set text [string range $text [expr $nick+1] end]#orset text [string range $text [expr $nick+1] end-1]set text [string range $text [expr $nick+1] end-2]#andset text [string trim $text e]set text [string trimright $nick a]set text [string trimleft $ident ~]#etc</code></pre></div>String trim is only for trimming certain words in a string, it cannot be used with indexes. See the tcl manual for string range for more help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Sep 24, 2007 1:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-09-23T19:26:22-04:00</updated>

		<published>2007-09-23T19:26:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76173#p76173</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76173#p76173"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76173#p76173"><![CDATA[
Try<div class="codebox"><p>Code: </p><pre><code>regsub -nocase -all [list [join [chanlist $chan] |]] $text {} text</code></pre></div>Edit: Added -all switch.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Sep 23, 2007 7:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jeremie]]></name></author>
		<updated>2007-09-24T11:09:00-04:00</updated>

		<published>2007-09-23T18:39:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=76171#p76171</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=76171#p76171"/>
		<title type="html"><![CDATA[banned words script [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=76171#p76171"><![CDATA[
I am amending my script to check for the banned words on actions.<br><br>I want to strip out the users name from the text and just check the rest of the text.<br><br>I tried using this :-<br><div class="codebox"><p>Code: </p><pre><code>foreach user [split [chanlist $chan] " "] {    set found [string match -nocase *$user* $text]    if {$found} {      regsub -all -nocase -- $user $text [string tolower $user] text    }</code></pre></div>which works on normal pubm but not action.<br><br>I also tried using these :-<br><div class="codebox"><p>Code: </p><pre><code>set text [string trim [string range $text $nick+1 e]]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set text [string trim $text {$nick+1} e]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set text [string trim $text [expr $nick+1] e]</code></pre></div>and various combinations using both {} and [] tound the $nick+1 in each <br><br>All of the above codes came up with this return :-<br><br>bad index "whatever the action was": must be integer or end?-integer?<br><br>Can somebody please help me to solve this problem?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9266">jeremie</a> — Sun Sep 23, 2007 6:39 pm</p><hr />
]]></content>
	</entry>
	</feed>
