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

	<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-04-05T14:04:19-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-05T14:04:19-04:00</updated>

		<published>2003-04-05T14:04:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18620#p18620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18620#p18620"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18620#p18620"><![CDATA[
Here is the stuff you've requested.<div class="codebox"><p>Code: </p><pre><code>bind join * * sock:checkproc sock:check {nick uhost handle channel} {  utimer 2 "sock:ban $nick $uhost $channel"}proc sock:ban {nick uhost channel} {  if {![botisop $channel]} { return }  if {![file exists $::socksfile]} {    putlog "\002Error\002: $::socksfile dose not exist!"    return 0  }  set file [open "$::socksfile" r]  while {![eof $file]} {    set lines [split [read $file] "\n"]    foreach line $lines {      if {$line == "" || ![string match "[lindex [split $uhost @] 1]" $line]} { continue }      set mask "*!*@[lindex [split $uhost @] 1]"      if {[ischanban $mask $channel]} { return }      newchanban $channel $mask Socks "$::socksreason" $::socksbantime      break    }  }}</code></pre></div>Enjoy.. <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=187">caesar</a> — Sat Apr 05, 2003 2:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-04-05T06:00:46-04:00</updated>

		<published>2003-04-05T06:00:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18611#p18611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18611#p18611"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18611#p18611"><![CDATA[
sorry for asking you again but..<br>is it possible to make it scan 2 seconds after the join if the sock is banned in the channel and if not then ban it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Sat Apr 05, 2003 6:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-05T02:21:07-04:00</updated>

		<published>2003-04-05T02:21:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18605#p18605</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18605#p18605"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18605#p18605"><![CDATA[
Due the fact that I was borring made something nice for you:<div class="codebox"><p>Code: </p><pre><code>bind msg m socks msg:socksproc msg:socks {nick host hand text} {  if {![file exists $::socksfile]} {    putserv "PRIVMSG $nick :\002Error\002: $::socksfile dose not exist!"    return 0  }  if {[llength $text] &lt;1} {    putserv "PRIVMSG $nick :\002Usage\002: socks &lt;add|del|check&gt; &lt;socks&gt;"    return 0  }  switch -- [string tolower [lindex $text 0]] {    "add" {      if {[lindex $text 1] == ""} {        putserv "PRIVMSG $nick :\002Usage\002: socks &lt;add&gt; &lt;socks&gt;"        return 0      }      set sock "[lindex $text 1]"      set file [open "$::socksfile" r]      while {![eof $file]} {        set line [gets $file]        if {[string match [lindex $text 1] $line]} {          putserv "PRIVMSG $nick :'$sock' socks is already in the list."          return 0        }      }      catch {close $file}      set file [open "$::socksfile" a]      puts $file $sock      putserv "PRIVMSG $nick :Socks '$sock' was added to the list."      catch {close $file}    }    "del" {      if {[lindex $text 1] == ""} {        putserv "PRIVMSG $nick :\002Usage\002: socks &lt;del&gt; &lt;socks&gt;"        return 0      }      set found 0      set index ""      set sock "[lindex $text 1]"      set file [open $::socksfile r]       while {![eof $file]} {        set lines [split [read $file] "\n"]        foreach line $lines {           if {$line == ""} { continue }          if {$line == $sock} {            set found 1          } else { lappend index $line }        }        if {$found == 0} {          putserv "PRIVMSG $nick :'$sock' was not found in the list."        return }      }      catch {close $file}      set file [open $::socksfile w]       foreach line $index {        puts $file $line      }      catch {close $file}      putserv "PRIVMSG $nick :Socks '$sock' was removed."    }    "check" {      if {[lindex $text 1] == ""} {        putserv "PRIVMSG $nick :\002Usage\002: socks &lt;check&gt; &lt;socks&gt;"        return 0      }      set sock "[lindex $text 1]"      set file [open "$::socksfile" r]      while {![eof $file]} {        set line [gets $file]        if {[string match [lindex $text 1] $line]} {          putserv "PRIVMSG $nick :Socks '$sock' was found in the list."          return 0        }      }      catch {close $file}      putserv "PRIVMSG $nick :Socks '$sock' was not found in the list."    }  }}</code></pre></div>With 'socks add' you add a socks in to the list, with 'socks del' you delete one and finaly but not the last, with 'socks check' you can check if the specified socks is in the list. Enjoy.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>PS: Please tell me if you spot an error or something..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Apr 05, 2003 2:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-05T03:03:49-04:00</updated>

		<published>2003-04-05T01:50:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18604#p18604</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18604#p18604"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18604#p18604"><![CDATA[
I've had a feeling that something is wrong there and decided to run a test. I've noticed that he only tests the first line, so here is the code that will read and test all lines from the file:<div class="codebox"><p>Code: </p><pre><code>set socksfile "socks.txt"set socksreason "Don't use socks!"set socksbantime 1440bind join * * sock:checkproc sock:check {nick uhost handle channel} {  if {![botisop $channel]} { return }  if {![file exists $::socksfile]} {    putlog "\002Error\002: $::socksfile dose not exist!"    return 0  }  set file [open "$::socksfile" r]  while {![eof $file]} {    set lines [split [read $file] "\n"]    foreach line $lines {      if {$line == "" || ![string match "[lindex [split $uhost @] 1]" $line]} { continue }      set mask "*!*@[lindex [split $uhost @] 1]"      newchanban $channel $mask Socks "$::socksreason" $::socksbantime      break    }  }}</code></pre></div>My appologies..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Apr 05, 2003 1:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-04-04T13:23:26-04:00</updated>

		<published>2003-04-04T13:23:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18588#p18588</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18588#p18588"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18588#p18588"><![CDATA[
thank you <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=2044">ReaLz</a> — Fri Apr 04, 2003 1:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-04T12:50:02-04:00</updated>

		<published>2003-04-04T12:50:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18582#p18582</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18582#p18582"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18582#p18582"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set socksfile "socks.txt"set socksreason "Don't use socks!"set socksbantime 1440bind join * * sock:checkproc sock:check {nick uhost handle channel} {  set file [open "$::socksfile" r]  if {![file exists $::socksfile]} {    putlog "\002Error\002: $::socksfile dose not exist!"    return 0  }  while {![eof $file]} {    set text [split [read $file] "\n"]    if {![string match "[lindex [split $uhost @] 1]" [split $text]]} { return }    set mask "*!*@[lindex [split $uhost @] 1]"    newchanban $channel $mask Socks "$::socksreason" $::socksbantime  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Apr 04, 2003 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReaLz]]></name></author>
		<updated>2003-04-04T12:28:47-04:00</updated>

		<published>2003-04-04T12:28:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18579#p18579</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18579#p18579"/>
		<title type="html"><![CDATA[on join check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18579#p18579"><![CDATA[
could u tell me how to make a simple script that reads a file with socks and when the eggdrop sees a sock joining the channel to ban it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2044">ReaLz</a> — Fri Apr 04, 2003 12:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
