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

	<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>2016-05-30T15:39:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2016-05-30T15:39:52-04:00</updated>

		<published>2016-05-30T15:39:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105059#p105059</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105059#p105059"/>
		<title type="html"><![CDATA[bad channel script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105059#p105059"><![CDATA[
Arnold_X-P, you replied without giving any info or context to your post. All you've done is basically flooded the same code, but you didn't use the code tags. <br>There's even a Code Button in the reply box. Please use this as it make use of syntax arrangement (which can in turn be useful to find missing braces/brackets).<br><div class="codebox"><p>Code: </p><pre><code>the code text looks like thismuch easier to read</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6204">Get_A_Fix</a> — Mon May 30, 2016 3:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-07-08T21:39:52-04:00</updated>

		<published>2006-07-08T21:39:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64546#p64546</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64546#p64546"/>
		<title type="html"><![CDATA[bad channel script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64546#p64546"><![CDATA[
This script is no longer supported. Search the Tcl Archives for a more recent one.<br><br>Ban Channel v3.0.3 by MC_8 would be more appropriate and one I use myself without problems.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sat Jul 08, 2006 9:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[honeybee]]></name></author>
		<updated>2006-07-08T21:33:03-04:00</updated>

		<published>2006-07-08T21:33:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64543#p64543</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64543#p64543"/>
		<title type="html"><![CDATA[bad channel script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64543#p64543"><![CDATA[
with small fixation suggested by demond and ban type change i m still encountering this error when i type .set errorInfo<div class="codebox"><p>Code: </p><pre><code>#Honey# set errorInfoCurrently: can't read "host": no such variableCurrently:     while executingCurrently: "unset bcqueue($host) bcnicks($nick)"</code></pre></div>Secondly this doesnt check the chanlist periodically to see if somone is still on bad channel can this be added?<br><br>here is the script:<div class="codebox"><p>Code: </p><pre><code>#badchan 1.0 by Bass of Undernet's #eggdrop (bass@tclslave.net)##This is a basic 'badchan' script to auto-ban ppl who are on other chans deemed 'bad'#People are scanned on-join.##Public commands:#!gbclist--lists the contents of the Global BadChan list#!bclist--lists the contents of the BadChan list for the current channel#!gabc &lt;mask&gt; &lt;reason&gt;--adds an item to the Global BadChan list#!grbc &lt;mask&gt;--removes an item from the Global BadChan list#!abc &lt;mask&gt; &lt;reason&gt;--adds an item to the BadChan list for the current channel#!rbc &lt;mask&gt;--removes an item from the BadChan list for the current channel##eg:  !abc *sex* No sex chans!##Users need n|- to change the global settings.#Users need o|o to change the channel settings.##The script keeps a copy of the list in a file so that it can be reloaded#   the next time the bot is restarted.if {[info exists bchan]} {unset bchan}#minutes to wait before rescanning (so a join-part flood won't hurt) set bchan(rescan) 3 #same as other flood-prot setting.set bc_flood 3:10#'ignored' channels.  no scanning is done.set bchan(exempt) "#xphiles #floods #ad&amp;d"#protected masks:set bchan(protect-hosts) { *!*bass@*.psu.edu}### END OF CONFIG OPTIONS ###if {[info exists bcqueue]} {unset bcqueue}set bchan(chans) ""proc bmaskhost {uhost} {  set uhost [lindex [split $uhost !] [expr [llength [split $uhost !]] -1]]  set temp [string range [lindex [split $uhost @] 0] [expr [string length [lindex [split $uhost @] 0]] - 8] e]  return "*!*$temp@[lindex [split [maskhost *!*@[lindex [split $uhost @] 1]] @] 1]"}proc bchan_read {} {  global bchan  set fd [open scripts/badchan.conf r]  while {![eof $fd]} {    set inp [gets $fd]    if {[string trim $inp " "] == ""} {continue}    set ban [lrange $inp 1 e]    set chan [string tolower [lindex $inp 0]]    if {[lsearch $bchan(chans) $chan] == -1} {lappend bchan(chans) $chan}    lappend bchan($chan) $ban  }  close $fd  putlog "badchan.conf loaded."}putlog "Bass's badchan.tcl 1.0 loaded"if {[file exists scripts/badchan.conf]} {bchan_read} {putlog "badchan.conf not found!"}proc bc_flood_init {} {  global bc_flood bc_flood_num bc_flood_time bc_flood_array  if {![string match *:* $bc_flood]} {putlog bchan: var bc_flood not set correctly. ; return 1}  set bc_flood_num [lindex [split $bc_flood :] 0]  set bc_flood_time [lindex [split $bc_flood :] 1]  set i [expr $bc_flood_num - 1]  while {$i &gt;= 0} {    set bc_flood_array($i) 0    incr i -1  }} ; bc_flood_initproc bc_flood {nick uhost} {  global bc_flood_num bc_flood_time bc_flood_array  if {$bc_flood_num == 0} {return 0}  set i [expr $bc_flood_num - 1]  while {$i &gt;= 1} {    set bc_flood_array($i) $bc_flood_array([expr $i - 1])    incr i -1  }  set bc_flood_array(0) [unixtime]  if {[expr [unixtime] - $bc_flood_array([expr $bc_flood_num - 1])] &lt;= $bc_flood_time} {    putlog "bchan: Flood detected from $nick."    #newignore [join [maskhost *!*[string trimleft $uhost ~]]] bchan flood 2    return  1  } {return 0}}bind join -|- * bchan_joinproc bchan_join {nick uhost hand chan} { global bchan bcqueue bcnicks botnick if {[matchattr [nick2hand $nick $chan] bmnof|mnof $chan]} {return 0} set host [string tolower [lindex [split $uhost @] 1]] set chan [string tolower $chan] set nick [string tolower $nick] if {[lsearch $bchan(chans) $chan] == -1 &amp;&amp; ([lsearch $bchan(chans) global] == -1 || [lsearch $bchan(exempt) $chan] &gt; -1)} {return 0} if {[string tolower $botnick] == [string tolower $nick]} {return 0} if {![botisop $chan]} {return 0} if {$bchan(protect-hosts) != ""} {  foreach i $bchan(protect-hosts) {   if {[string match [string tolower $i] $host]} {return 0}  } } if {[info exists bcqueue($host)]} {return 0} set bcqueue($host) 1  if {[bc_flood $nick $uhost]} {return 0} set bcnicks($nick) $chan putserv "whois $nick"  set i 0  set temp "" while {$i &lt; [string length $nick]} {   if {[string index $nick $i] == "\\"} {append temp "\\\\"} elseif {   [string index $nick $i] == "\["} {append temp "\\\["} elseif {   [string index $nick $i] == "\]"} {append temp "\\\]"} elseif {   [string index $nick $i] == "\{"} {append temp "\\\{"} elseif {   [string index $nick $i] == "\}"} {append temp "\\\}"} {   append temp [string index $nick $i]}   incr i } ; set nick $temp timer $bchan(rescan) [list catch {unset bcqueue($host) bcnicks($nick)}]}bind raw - 319 bc_whoisproc bc_whois {from key args} {  global bchan bcqueue bcnicks#  putlog "319: $args"  set args [join $args]  set nick [string tolower [lindex $args 1]]  if {[info exists bcnicks($nick)]} {set chan $bcnicks($nick)} {return 0}  set chans [string tolower [lrange $args 2 e]]  if {[lsearch $bchan(exempt) $chan] == -1 &amp;&amp; $bchan(global) != ""} {set bans $bchan(global)} {set bans ""}  if {[lsearch $bchan(chans) $chan] &gt; -1} {set bans "$bans $bchan($chan)"}  foreach tok $chans {    set tok [string trimleft $tok ":@+"]    foreach ban $bans {      if {[string match [lindex $ban 0] $tok]} {        putlog "badchan:  match! $nick k/b'd from $chan because [lrange $ban 1 e]"        putlog "args: $args, ban: $ban"        if {[onchan $nick $chan]} {newchanban $chan [bmaskhost [getchanhost $nick $chan]] badchan "[lrange $ban 1 e]" 10}        puthelp "privmsg $nick :You're found to be on a Prohibited channel $ban Please Part it and *REJOIN* #Karachireturn 0      }    }  }  return 0}bind pub n|- !gbclist bc_glistproc bc_glist {1 2 3 4 5} {bc_list $1 $2 $3 global $5}bind pub o|o !bclist bc_listproc bc_list {nick uhost hand chan args} {  global bchan  set chan [string tolower $chan]  if {[lsearch $bchan(chans) $chan] == -1} {puthelp "notice $nick :No badchans are registered for $chan." ; return 1}  set i 1  puthelp "notice $nick :BadChans for $chan..."  foreach ban $bchan($chan) {    puthelp "notice $nick :$i) $ban"    incr i  }}bind pub n|- !gabc bc_gaddproc bc_gadd {1 2 3 4 5} {bc_add $1 $2 $3 global $5}bind pub o|o !abc bc_addproc bc_add {nick uhost hand chan args} {  global bchan  set chan [string tolower $chan]  if {![string match *\\\** [lindex $args 0]]} {puthelp "notice $nick :syntax is: !abc &lt;chanmask&gt; \[reason\]" ; return 1}  set args [string trimright "[string tolower [lindex $args 0]] [lrange $args 1 e]" " "]  if {[lsearch $bchan(chans) $chan]} {lappend bchan(chans) $chan}  lappend bchan($chan) $args  puthelp "notice $nick :[lindex $args 0] was added to $chan's badchan list."  bchan_save  return 1}bind pub n|- !grbc bc_gremproc bc_grem {1 2 3 4 5} {bc_rem $1 $2 $3 global $5}bind pub o|o !rbc bc_remproc bc_rem {nick uhost hand chan args} {  global bchan  set chan [string tolower $chan]  set args [string tolower [lindex [join $args] 0]]  if {[lsearch $bchan(chans) $chan] == -1} {puthelp "notice $nick :No badchans are registered for $chan." ; return 1}  if {![string match *\\\** $args]} {puthelp "notice $nick :syntax is: !rbc &lt;chanmask&gt;" ; return 1}  set i 0  set temp ""  foreach ban $bchan($chan) {    if {[string compare $args [lindex $ban 0]] == 0} {incr i} {lappend temp $ban}  }  if {$i &gt; 0} {    if {$temp != ""} {set bchan($chan) $temp} {      unset bchan($chan)      set temp [lsearch $bchan(chans) $chan]      if {$temp == -1} {putlog "bchan: I'm confused." ; return 1}      set bchan(chans) [lreplace $bchan(chans) $temp $temp]    }    puthelp "notice $nick :$args was removed from $chan's badchan list."    bchan_save  } {puthelp "notice $nick :$args was not found in $chan's badchan list."}  return 1}proc bchan_save {} {  global bchan  set fd [open scripts/badchan.conf w]  foreach chan $bchan(chans) {    foreach ban $bchan($chan) {      puts $fd "$chan $ban"    }  }  close $fd}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7174">honeybee</a> — Sat Jul 08, 2006 9:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
