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

	<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>2021-01-25T14:05:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-01-25T14:05:46-04:00</updated>

		<published>2021-01-25T14:05:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109360#p109360</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109360#p109360"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109360#p109360"><![CDATA[
with the help of SpiKe^^ who debugged it and took out all bugs it seems to work proper now, thanks again SpiKe^^ and nml375 ofcourse who wrote the original code,..... apreciated so ill post it here if someone  might need it as well:<br><br><div class="codebox"><p>Code: </p><pre><code>bind mode - "% +b" checkBanbind msg - !unban checkUnban## Add a time or cron binding to purge old entries every 10 minutes..bind cron - "*/10 * * * *" cronPurgeBan#bind time - "?0 *" cronPurgeBanproc checkBan {nick host handle channel mode target} {  ##Don't ban the bot, not explicitly requested but is a good precaution  if {[matchaddr $target $::botname]} {    pushmode $channel -b $target    return  }  foreach user [chanlist $channel] {    if {[matchaddr $target "${user}![getchanhost $user $channel]"]} {      set key [addUnban $user $channel $target]      puthelp "PRIVMSG $user :You have been banned! Please send \"!unban $channel $key\" to me to remove the ban"    }  }}proc generateRandomString {length} {  set string ""  while {[incr length -1] &gt;= 0} {    append string [string index "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#" [rand 64]]  }  return $string}proc addUnban {nick channel banmask} {  set key [string tolower $nick]  set password [generateRandomString 8]  ## Check to see if there's any data for the user already..  if {[info exists ::banKeys($key)]} {    ## If we're using tcl 8.5, this speeds things up alot..    if {$::tcl_version &gt;= 8.5} {      set index [lsearch -index 0 -exact -nocase $::banKeys($key) $channel]    } else {      for {set i 0; set index -1} {$i &lt; [llength $::banKeys($key)]} {incr i} {        if {[string equal -nocase [lindex $::banKeys($key) 0] $channel]} {          set index $i          break        }      }    }    ## See if we found a match for this channel in the user's data...    if {$index &gt;= 0} {      lset ::banKeys($key) $index [list $channel $banmask $password [clock seconds]]      return $password    }  }  lappend ::banKeys($key) [list $channel $banmask $password [clock seconds]]  return $password}proc checkUnban {nick host handle text} {  set key [string tolower $nick]  set data [split $text]  ## Check to see if there's any data for the user already..  if {[info exists ::banKeys($key)]} {    ## If we're using tcl 8.5, this speeds things up alot..    if {$::tcl_version &gt;= 8.5} {      lassign $data bChan bKey      set index [lsearch -index 0 -exact -nocase $::banKeys($key) $bChan]    } else {      foreach {bChan bKey} $data {}      for {set i 0; set index -1} {$i &lt; [llength $::banKeys($key)]} {incr i} {        if {[string equal -nocase [lindex $::banKeys($key) 0] $bChan]} {          set index $i          break        }      }    }    ## See if we found a match for this channel in the user's data...    if {$index &gt;= 0} {      if {[clock seconds] - [lindex $::banKeys($key) $index 3] &gt; 60} {        set ::banKeys($key) [lreplace $::banKeys($key) $index $index]        if {[llength $::banKeys($key)] == 0} {          unset ::banKeys($key)        }      } elseif {[string equal -nocase $bKey [lindex $::banKeys($key) $index 2]]} {        pushmode [lindex $::banKeys($key) $index 0] -b [lindex $::banKeys($key) $index 1]      }    }  }}proc purgeBan {{user *}} {  foreach key [array names ::banKeys -glob [string tolower $user]] {    set index 0      while {$index &lt; [llength $::banKeys($key)]} {      if {[clock seconds] - [lindex $::banKeys($key) $index 3] &gt; 60} {        set ::banKeys($key) [lreplace $::banKeys($key) $index $index]      } else {        incr index      }    }    if {[llength $::banKeys($key)] == 0} {      unset ::banKeys($key)    }  }}proc cronPurgeBan {minute hour day month weekday} {  purgeBan}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jan 25, 2021 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-01-21T18:27:32-04:00</updated>

		<published>2021-01-21T18:27:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109346#p109346</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109346#p109346"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109346#p109346"><![CDATA[
this is a bit of an old thread but i was curious about this code and tried it and <br><br>got: Tcl error [checkBan]: can't read "::banKeys(lilly)": no such variable<br><br>lilly being the banned nick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Jan 21, 2021 6:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-06-30T01:27:07-04:00</updated>

		<published>2011-06-30T01:27:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97128#p97128</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97128#p97128"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97128#p97128"><![CDATA[
Just ignore my first post as it won't do what exactly you needed, nml375's code on the other hand will.<br><br>/me takes hat down in front of nml375 <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> — Thu Jun 30, 2011 1:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demetrius_reis]]></name></author>
		<updated>2011-06-29T21:25:44-04:00</updated>

		<published>2011-06-29T21:25:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97127#p97127</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97127#p97127"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97127#p97127"><![CDATA[
oh yes I understand<br>I will evaluate scripts<br>thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11312">demetrius_reis</a> — Wed Jun 29, 2011 9:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-06-29T11:42:24-04:00</updated>

		<published>2011-06-29T11:42:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97121#p97121</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97121#p97121"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97121#p97121"><![CDATA[
I don't recall such a script, unfortunately..<br>I did put this little piece together this afternoon though..<br><br>Keep in mind, that the code has not been tested, so it might very well contain various bugs or issues. Also, it does a fair amount of list searches and keeps all codes in memory, so it might degrade performace in 600+ member channels.<br><br>The script is written for 1.6.20 eggdrops, if you're using older eggies, you'll have to find a replacement for the <strong class="text-strong">matchaddr</strong> command..<br><div class="codebox"><p>Code: </p><pre><code>bind mode - "% +b" checkBanbind msg - !unban checkUnban## Add a time or cron binding to purge old entries every 10 minutes..#bind cron - "*/10 * * * *" cronPurgeBan#bind time - "?0 *" cronPurgeBanproc checkBan {nick host handle channel mode target} {  ##Don't ban the bot, not explicitly requested but is a good precaution  if {[matchaddr $target $::botname]} {    pushmode $channel -b $target    return  }  foreach user [chanlist $channel] {    if {[matchaddr $target "${user}![getchanhost $user $channel]"]} {      set key [addUnban $user $channel $target]      puthelp "PRIVMSG $user :You have been banned! Please send \"!unban $channel $key\" to me to remove the ban"    }  }}proc generateRandomString {length} {  set string ""  while {[incr length -1] &gt;= 0} {    append string [string index "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#" [rand 64]]  }  return $string}proc addUnban {nick channel banmask} {  set key [string tolower $nick]  set password [generateRandomString 8]  ## Check to see if there's any data for the user already..  if {[info exists $::banKeys($key)]} {    ## If we're using tcl 8.5, this speeds things up alot..    if {$::tcl_version &gt;= 8.5} {      set index [lsearch -index 0 -exact -nocase $::banKeys($key) $channel    } else {      for {set i 0; set index -1} {$i &lt; [llength $::banKeys($key)]} {incr i} {        if {[string equal -nocase [lindex $::banKeys($key) 0] $channel]} {          set index $i          break        }      }    }    ## See if we found a match for this channel in the user's data...    if {$index &gt;= 0} {      lset ::banKeys($key) $index [list $channel $banmask $password [clock seconds]]      return $password    }  }  lappend ::banKeys($key) [list $channel $banmask $password [clock seconds]]  return $password}proc checkUnban {nick host handle text} {  set key [string tolower $nick]  set data [split $text]  ## Check to see if there's any data for the user already..  if {[info exists $::banKeys($key)]} {    ## If we're using tcl 8.5, this speeds things up alot..    if {$::tcl_version &gt;= 8.5} {      lassign $data bChan bKey      set index [lsearch -index 0 -exact -nocase $::banKeys($key) $bChan    } else {      foreach $data {bChan bKey} {}      for {set i 0; set index -1} {$i &lt; [llength $::banKeys($key)]} {incr i} {        if {[string equal -nocase [lindex $::banKeys($key) 0] $bChan]} {          set index $i          break        }      }    }    ## See if we found a match for this channel in the user's data...    if {$index &gt;= 0} {      if {[clock seconds] - [lindex $::banKeys($key) $index 3] &gt; 60} {        set ::banKeys($key) [lreplace $::banKeys($key) $index $index]        if {[llength $::banKeys($key)] == 0} {          unset ::banKeys($key)        }      } elseif {[string equal -nocase $bKey [lindex $::banKeys($key) $index 2]]} {        pushmode [lindex $::banKeys($key) $index 0] -b [lindex $::banKeys($key) $index 1]      }    }  }}proc purgeBan {{user *}} {  foreach key [array names ::banKeys -glob [string tolower $user]] {    set index 0    while {$i &lt; [llength $::banKeys($key)]} {      if {[clock seconds] - [lindex $::banKeys($key) $index 3] &gt; 60} {        set ::banKeys($key) [lreplace $::banKeys($key) $index $index]      } else {        incr index      }    }    if {[llength $::banKeys($key)] == 0} {      unset ::banKeys($key)    }  }}proc cronPurgeBan {minute hour day month weekday} {  purgeBan}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 29, 2011 11:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-06-29T01:21:59-04:00</updated>

		<published>2011-06-29T01:21:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97117#p97117</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97117#p97117"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97117#p97117"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind mode * "% +b" check:banproc check:ban {nick uhost handle channel change target} {# check if the mask matches the bot's host and return if it doesn'tif {![string match -nocase $target $::botname]} return# do what action/actions you wish as the mask matches his hostputserv "PRIVMSG $nick :your message in here"}</code></pre></div>This should do what you want.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Jun 29, 2011 1:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demetrius_reis]]></name></author>
		<updated>2011-06-29T00:38:18-04:00</updated>

		<published>2011-06-29T00:38:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97115#p97115</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97115#p97115"/>
		<title type="html"><![CDATA[what is the name of the tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97115#p97115"><![CDATA[
I'm looking for old tcl it worked like this:<br><br>When the user was banned, the BOT will automatically send a code to the user, use to unban yourself.<br><br>What is the name of the tcl?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11312">demetrius_reis</a> — Wed Jun 29, 2011 12:38 am</p><hr />
]]></content>
	</entry>
	</feed>
