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

	<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-06-11T01:03:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-06-11T01:03:21-04:00</updated>

		<published>2003-06-11T01:03:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21620#p21620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21620#p21620"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21620#p21620"><![CDATA[
This thing with the userlist is not a good ideea because in case someone uses a colour or something today, it's added to the list and after 24 hours when it uses it again it's directly banned so he used only one time the colours per that day. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Also, instead of adding a user, removing it and so on, just add it's host to a certain user and see if it's mask is there either by checking the masks or by matching his handle with a certain flag of that user.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Jun 11, 2003 1:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TsT]]></name></author>
		<updated>2003-06-10T14:52:32-04:00</updated>

		<published>2003-06-10T14:52:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21611#p21611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21611#p21611"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21611#p21611"><![CDATA[
Why not use global variable?<br><br>like:<div class="codebox"><p>Code: </p><pre><code># add a userproc my_adduser {mask} {    global my_users    set my_users([string tolower $mask]) ""}# return "" = not found# else return the 1st mask which matchedproc my_searchuser {uhost} {    global my_users    set uhost [string tolower $uhost]    foreach mask $my_users {        if {[string match $mask $uhost]} {            return $mask        }    }    return}# remove a userproc my_deluser {mask} {    global my_users    catch {unset my_users($mask)}}</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set validuser [my_searchuser $nick!$uhost]if {$validuser == ""} {  #User isn't added, as noted  #So do this code  my_adduser [maskhost $uhost]}if {$validuser != ""} {  #User is added, we just added him above, so this gets called now  #SO we call ban code}# remove the user:my_deluser $validuser</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2803">TsT</a> — Tue Jun 10, 2003 2:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-06-09T11:31:02-04:00</updated>

		<published>2003-06-09T11:31:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21500#p21500</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21500#p21500"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21500#p21500"><![CDATA[
I'll goto bed now.<br><br>You wanna see how red my cheeks are, flame grilled steak any1.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Jun 09, 2003 11:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-06-09T11:15:09-04:00</updated>

		<published>2003-06-09T11:15:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21498#p21498</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21498#p21498"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21498#p21498"><![CDATA[
ppslim, actually he had it correct the first time. The reason is that he has a 'return' statement after adding the user. So basically he's using the user record as a flag to see if the person has been warned already.<br><br>1. sheep sends a msg with control chars<br>2. bot checks if user exists<br>3: no - so bot adds user and sends notice, returns<br>4. sheep sends another msg with control chars<br>5. bot checks if user exists<br>6. yes - so bot bans and deletes user (resetting flag), returns<br><br>It's actually a very smart way of doing it, because using the user record automatically adds permanance (e.g. bot saves user records automatically, so on .restart the user still exists).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon Jun 09, 2003 11:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-06-09T08:22:17-04:00</updated>

		<published>2003-06-09T08:22:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21494#p21494</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21494#p21494"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21494#p21494"><![CDATA[
For the issue I posted, take this<br><br>"usera" is not added to the bot. He triggers the bind.<br><div class="codebox"><p>Code: </p><pre><code>if {![validuser usera]} {  #User isn't added, as noted  #So do this code  adduser usera}if {[validuser usera]} {  #User is added, we just added him above, so this gets called now  #SO we call ban code}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Jun 09, 2003 8:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-06-09T08:01:59-04:00</updated>

		<published>2003-06-09T08:01:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21492#p21492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21492#p21492"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21492#p21492"><![CDATA[
could u give me an example?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Mon Jun 09, 2003 8:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-06-09T05:38:24-04:00</updated>

		<published>2003-06-09T05:38:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21491#p21491</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21491#p21491"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21491#p21491"><![CDATA[
Exactly. Anyway, you should use an array to do what you do with the userlist.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jun 09, 2003 5:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-06-09T05:27:44-04:00</updated>

		<published>2003-06-09T05:27:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21490#p21490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21490#p21490"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21490#p21490"><![CDATA[
you mean to write first the <div class="codebox"><p>Code: </p><pre><code>[validuser</code></pre></div> and then the <div class="codebox"><p>Code: </p><pre><code>![validuser</code></pre></div>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Mon Jun 09, 2003 5:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-06-09T05:09:04-04:00</updated>

		<published>2003-06-09T05:09:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21488#p21488</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21488#p21488"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21488#p21488"><![CDATA[
stdragon was correct in regards to the script being called multiple times, however, there is a second reason for the notice and ban in one go, that requires only a single control character to be used in the text.<br><br>In your second "if" test, you see if the user ISNT there. If not, then add them and warn them.<br><br>Your third i"if" checks to see if they ARE added. If so, then ban them.<br><br>The way you use this is very correct, however, but your ordering isn't.<br><br>The first "validuser" returns 0, so add them. The second "validuser" returns 1, because you have just added them.<br><br>A qucik fix for this, is to switch the order in which these "if" statments are called.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Jun 09, 2003 5:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-06-08T16:48:07-04:00</updated>

		<published>2003-06-08T16:48:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21476#p21476</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21476#p21476"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21476#p21476"><![CDATA[
No it won't.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Jun 08, 2003 4:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-06-08T16:24:55-04:00</updated>

		<published>2003-06-08T16:24:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21475#p21475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21475#p21475"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21475#p21475"><![CDATA[
yeah... good idea thanx<br>but it will still be a problem if a user uses <div class="codebox"><p>Code: </p><pre><code>\002</code></pre></div> and <div class="codebox"><p>Code: </p><pre><code>\003</code></pre></div> in the same line<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Sun Jun 08, 2003 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-06-08T13:47:24-04:00</updated>

		<published>2003-06-08T13:47:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21468#p21468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21468#p21468"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21468#p21468"><![CDATA[
You realize that ASCII characters include a-z, A-Z, 0-9, and all that right? heh<br><br>Aside from that, the reason you're probably having this problem is that the pubm bind is "stackable". Which means, it gets executed multiple times for the same input. So if a user types a line with more than one of your forbidden characters, the procedure will get called more than once, thus warning him and banning him.<br><br>Instead, you should have a single bind with *, and check for illegal chars within it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Jun 08, 2003 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-06-08T12:46:21-04:00</updated>

		<published>2003-06-08T12:46:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21462#p21462</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21462#p21462"/>
		<title type="html"><![CDATA[ASCII ban]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21462#p21462"><![CDATA[
I'm trying to make a script that firstly warns the users who use ASCII chars in the channel and if they do it again they get banned... but when someone uses ASCII chars it gets banned and the bot also sends him notices at the same time.<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - "* *\002*" ascii:pubmbind pubm - "* *\003*" ascii:pubmbind pubm - "* *\006*" ascii:pubmbind pubm - "* *\007*" ascii:pubmbind pubm - "* *\017*" ascii:pubmbind pubm - "* *\026*" ascii:pubmbind pubm - "* *\037*" ascii:pubmproc ascii:pubm {nick uhost hand chan text} {  if {[matchattr $hand of|fo $chan] || [isop $nick $chan]} {    return  }if {![validuser $nick]} {adduser $nickputserv "NOTICE $nick :Please don't use ASCII chars in $chan"return}if {[validuser $nick]} {deluser $nickset mask "*!*@[lindex [split $uhost @] 1]"newban $mask ASCII "\00210 minutes\002 ban for using \002ASCII characters\002 within \002$chan\002 " 10return 1}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Sun Jun 08, 2003 12:46 pm</p><hr />
]]></content>
	</entry>
	</feed>
