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

	<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>2002-12-14T11:24:15-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-14T11:24:15-04:00</updated>

		<published>2002-12-14T11:24:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14267#p14267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14267#p14267"/>
		<title type="html"><![CDATA[What's wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14267#p14267"><![CDATA[
TO do this, it makes things a little simpler.<br><br>Remove this line<br><div class="codebox"><p>Code: </p><pre><code>set wingatejoinbmask($chan) *!*[string tolower [string range $uhost [string first "@" $uhost] end]]</code></pre></div>This is appending to an array, which never gets used for any real purpose.<br><br>There is a slighly more overhead in managing arrays, so simply using a temp var would do. Besides that, you over ever use it localy, and is never globaly exported.<br><br>Now create a full nick!user@host variable, to match against.<br><div class="codebox"><p>Code: </p><pre><code>set temp "${nick}!${uhost}"</code></pre></div><br>Next create a extra proc, to handle the matching.<br><br>[proc]<br>proc maskmatch {list string} {<br>  foreach l $list {<br>    if {[string match $l $string]} { return 1 }<br>  }<br>  return 0<br>}<br>[/code]<br>You can then change the matching if command (lsearch) to<br><div class="codebox"><p>Code: </p><pre><code>if {[maskmatch $wingateipslist $temp]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Dec 14, 2002 11:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z_one]]></name></author>
		<updated>2002-12-14T09:40:41-04:00</updated>

		<published>2002-12-14T09:40:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14266#p14266</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14266#p14266"/>
		<title type="html"><![CDATA[What's wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14266#p14266"><![CDATA[
Hi,<br><br>Ok I will degub it but about the matching system, I want it to be more global.<br>Example, say I have:<br><div class="codebox"><p>Code: </p><pre><code>set wingateipslist {} lappend wingateipslist "*!*@63.1.43.*"</code></pre></div>Then I want any matching ip to trigger the code.<br>So if <strong class="text-strong">*!*@63.1.43.23</strong> and <strong class="text-strong">*!*@63.1.43.165</strong> and <strong class="text-strong">*!*@63.1.43.227</strong> all join I need them to match the list element <strong class="text-strong">*!*@63.1.43.*</strong> <br><br>What "lsearch" option should I use to achieve this, and what's the exact code to do it.<br>Thanks in advance.<br><br>z_one<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=698">z_one</a> — Sat Dec 14, 2002 9:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-14T09:24:12-04:00</updated>

		<published>2002-12-14T09:24:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14262#p14262</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14262#p14262"/>
		<title type="html"><![CDATA[What's wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14262#p14262"><![CDATA[
OK - first off<div class="codebox"><p>Code: </p><pre><code>set wingateipslist "*!*@63.1.43.23 *!*@63.1.43.24"</code></pre></div>This is not a proper list, and as such, may cause problems.<br><br>somthing like<div class="codebox"><p>Code: </p><pre><code>set wingateipslist {}lappend wingateipslist "*!*@63.1.43.23"lappend wingateipslist "*!*@63.1.43.24"</code></pre></div>Second, use some putlogs, for debugging purposes.<br><br>Places them after "if"'s, and other matching systems, so you can see what happens when.<br><br>IE, if you put a putlog after the if that checks for a matching IP, then you can see if it matched. If not, then the matching system needs revising.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Dec 14, 2002 9:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z_one]]></name></author>
		<updated>2002-12-14T08:06:44-04:00</updated>

		<published>2002-12-14T08:06:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14259#p14259</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14259#p14259"/>
		<title type="html"><![CDATA[What's wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14259#p14259"><![CDATA[
Ok, this script checks out if the nicks who are joining a channel have ips that match the ones in a predefined list.<br><br>If more than 3 ppl have these ips and join ... the bot sets mode +MR<br><br>I made 6 clones having the ips 63.1.43.23 and 63.1.43.24 join my channel but I can't get it to work though ! What's wrong with it ?<br><div class="codebox"><p>Code: </p><pre><code>set wingateipslist "*!*@63.1.43.23 *!*@63.1.43.24"foreach chan [channels] {  set wingatejointimes($chan) 0  set wingatejoindone($chan) 0  set wingatejoinbmask($chan) ""  set wingatejointimer($chan) 0}bind join - * wingatepowerjoinproc wingatepowerjoin {nick uhost hand chan} {  global wingatejointimes wingatejoindone wingatejoinbmask wingatejointimer  if {![botisop $chan]} { return 0 }  set wingatejoinbmask($chan) *!*[string tolower [string range $uhost [string first "@" $uhost] end]]     if {[lsearch -exact $wingateipslist [string tolower $wingatejoinbmask($chan)]] != -1} {     if {$wingatejointimes($chan) &gt;= 3} {        if {$wingatejoindone($chan) == 0} {          putquick "MODE $chan +RM"          set wingatejoindone($chan) 1          utimer 10 { set wingatejoindone($chan) 0 }        }     } else {        set wingatejointimes($chan) [expr $wingatejointimes($chan) + 1]        foreach timr [utimers] {           if {[lindex $timr 2] == $wingatejointimer($chan)} {               killutimer $wingatejointimer($chan)               break           }        }        set wingatejointimer($chan) [utimer 2 {set wingatejointimes($chan) 0}]     }   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=698">z_one</a> — Sat Dec 14, 2002 8:06 am</p><hr />
]]></content>
	</entry>
	</feed>
