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

	<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>2003-11-26T09:52:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-26T09:52:00-04:00</updated>

		<published>2003-11-26T09:52:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30717#p30717</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30717#p30717"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30717#p30717"><![CDATA[
Wrong post for my (sad) emotion <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Wed Nov 26, 2003 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-11-26T04:02:09-04:00</updated>

		<published>2003-11-26T04:02:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30711#p30711</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30711#p30711"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30711#p30711"><![CDATA[
smile, my opinion doesn't matter <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=691">CrazyCat</a> — Wed Nov 26, 2003 4:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-25T18:14:28-04:00</updated>

		<published>2003-11-25T18:14:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30707#p30707</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30707#p30707"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30707#p30707"><![CDATA[
<img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Tue Nov 25, 2003 6:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-11-25T12:49:57-04:00</updated>

		<published>2003-11-25T12:49:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30696#p30696</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30696#p30696"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30696#p30696"><![CDATA[
Yes, I was thinking you were doing something like this...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Nov 25, 2003 12:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-25T07:28:24-04:00</updated>

		<published>2003-11-25T07:28:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30678#p30678</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30678#p30678"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30678#p30678"><![CDATA[
As I said the same method checks for bad nicks etc. So, a join or a nick bind would be useful for me.<br>Also the sign and part binds are useful too, because in my channel there are some users who joins the chan, and immetiately quit, in order to spam in their quit msg, and they are doing this 5 or more times. So, when the bot detects spam msg in someone's quit message, it will ban his host <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Tue Nov 25, 2003 7:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-11-25T03:48:59-04:00</updated>

		<published>2003-11-25T03:48:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30667#p30667</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30667#p30667"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30667#p30667"><![CDATA[
my tip is:<br>when someone joins a channel, he can't spam 'cuz he doesn't send any message.<br>So binding a join isn't usefull.<br>The only way to have a spam is pubm, msgm, act and notice.<br>the quit or part may contain spam, but it's too late.<br>You just have 4 binds <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=691">CrazyCat</a> — Tue Nov 25, 2003 3:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-24T15:34:33-04:00</updated>

		<published>2003-11-24T15:34:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30644#p30644</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30644#p30644"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30644#p30644"><![CDATA[
You are right. This is the best that I have to do and in this way, I'll have 5-6 binds and also less needed cpu.<br><br>What exactly do you mean in your tip? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Mon Nov 24, 2003 3:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-11-24T12:53:20-04:00</updated>

		<published>2003-11-24T12:53:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30622#p30622</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30622#p30622"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30622#p30622"><![CDATA[
well, imho, the second way should be better, but you may make a simpler one:<br>use your first version script, but when the script is loaded, you but all spamwords in an array.<br>When you add a spamword, make it added in both file and array.<br>So, you'll just have a few binds, and you read your file only when the eggdrop is loaded.<br><br>And a little tip: it's impossible to spam when joining <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=691">CrazyCat</a> — Mon Nov 24, 2003 12:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2003-11-23T23:34:05-04:00</updated>

		<published>2003-11-23T23:34:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30598#p30598</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30598#p30598"/>
		<title type="html"><![CDATA[Write &quot;correct&quot; code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30598#p30598"><![CDATA[
Hello,<br><br>I have written a script which detects spam words on a chan and bans/kicks the user. The script works great, but I have a problem. So I would like some opinions about which is the best code:<br><br>(I save all spam words to a file and I add them with +spamword command and I want the script to detect spamwords from pub, nicks(join/change), quit and part messages)<br><br><strong class="text-strong">Scenario 1</strong> Too much scans<br>The 1st scenario is to have a bind for each option (join, part, nick, pub, etc) and every time to scan every line of the file and checks (string match) if any spamword of the file exists to the text.<br><br><span style="text-decoration:underline">example</span><div class="codebox"><p>Code: </p><pre><code>bind join - * spamword:joinbind part - * spamword:partbind pub - * spamword:pubbind sign - * spamword:signbind nick - * spamword:nickproc spamword:join { nick uhost hand chan } {    spamword:check nick uhost chan nick}proc spamword:part { nick uhost hand chan {msg ""} } {    if {$msg != ""} { spamword:check nick uhost chan msg }}# (the same for other bind msgs)proc spamword:check { nick uhost chan text } {    # reads every line of the file where spamwords save and uses the    # [string match * *] command to find the spammers}</code></pre></div><br><strong class="text-strong">Scenario 2</strong> Too much binds<br>The 2nd scenario is on start, to "create" a bind for each one of the words which exists in the file.<br><br><span style="text-decoration:underline">example</span><div class="codebox"><p>Code: </p><pre><code>set t [open file r]while {![eof $t]} {     gets $t line     bind join - "$line" spamword:kickban     bind part - "$line" spamword:kickban     # The same for the other binds      }proc spamword:kickban { param1 param2 ... } {    # bans and kicks the user}</code></pre></div><br>Which code would be quicker and which one uses less cpu and ram?<br><br>P.S. I know how I could do all these, and the above code is only for example. The only that I want is the idea and not the code<br><br>Thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Sun Nov 23, 2003 11:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
