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

	<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>2004-07-24T21:00:11-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2004-07-24T21:00:11-04:00</updated>

		<published>2004-07-24T21:00:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39044#p39044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39044#p39044"/>
		<title type="html"><![CDATA[nospam1.7.2.tcl kick problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39044#p39044"><![CDATA[
You set your custom message in nospam1.71.tcl.<br><br>Find this line and edit what you wish within the quotation marks.<div class="codebox"><p>Code: </p><pre><code># Random ban messages to use. # # Please Note:  That using * as the first character in your message makes the ban sticky. # set spam_reason(chan) {   "\00312Mass-Msg/Invite/Adv/Trojan Send\00312" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sat Jul 24, 2004 9:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[forever79]]></name></author>
		<updated>2004-07-24T17:57:45-04:00</updated>

		<published>2004-07-24T17:57:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39042#p39042</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39042#p39042"/>
		<title type="html"><![CDATA[nospam1.7.2.tcl kick problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39042#p39042"><![CDATA[
hi <br>this is a antispam tcl script code, this is work good with any problem...<br>my bot ban to user but not good kick, its kick to user because user was banned. i want to kick spam user with my special message than ban to it...<br><br>please help me<br><br><br><div class="codebox"><p>Code: </p><pre><code>#---------------------------------------------------------------------------------------#- no!spam leaf - by wreck#---------------------------------------------------------------------------------------#- $Id: no.spam.leaf.tcl,v 1.6 2001/07/31 00:07:37 ppslim Exp $#---------------------------------------------------------------------------------------# If you want no!spam leaf to keep a log of all the spammers it bans, then set this to 1.# Then right below it set the full path of the file you want to log spammers to.set spam-leaf-log 1set spam-leaf-file "/home/forever69/cirkinbot/scripts/leafspam"# If you want no!spam leaf to echo the log into the partyline, set this to 1. Otherwise,# 0 to disable. This can be used without using $spam-leaf-log.set spam-leaf-party 1#---------------------------------------------------------------------------------------#- code begins here#- please don't edit anything below, unless you know what you are doing.#---------------------------------------------------------------------------------------proc pushkick {chan nick rsn} {if {$chan != ""} {if {[onchan $nick $chan]} {putquick "KICK $chan $nick :$rsn"}} else {foreach chan [channels] {if {[onchan $nick $chan]} {puthelp "KICK $chan $nick :$rsn"}}}}proc hs_ban {mask bot comment type time} {if {$time &gt;= 0} {newban $mask $bot $comment $time} else {newban $mask $bot $comment}}proc hs_chanban {chan mask bot comment type time} {if {$time &gt;= 0} {newchanban $chan $mask $bot $comment $time} else {newchanban $chan $mask $bot $comment}}#---------------------------------------------------------------------------------------proc hs_log {type bot who where what why} {  global spam-leaf-log spam-leaf-file spam-leaf-party  if {${spam-leaf-log} || ${spam-leaf-party}} {    set when [strftime "%D %r"]    switch $type {      c {set data "$when: $who said: (#$why) $what in: $where"}      d {set data "$when: $who was sending: $what to people in: $where"}      i {set data "$when: $who invited me to: $where"}      m {set data "$when: $who messaged me with: (#$why) $what"}      n {if {![string length $where]} {set where "me"} ; set data "$when: $who noticed: $where with: (#$why) $what"}      p {set data "$when: $who parted from: $where with: (#$why) $what"}    }    if {${spam-leaf-log}} {      set file [open ${spam-leaf-file} a+]      puts $file $data      close $file        }    if {${spam-leaf-party}} {putlog "\[no!spam(\002$bot\002)\] $data"}  }}proc hs_handle {bot type glbl nick from chan idx kick1 kick2 time mask rsn data} {  if {[validchan $chan]} {    if {$glbl} {      hs_ban $mask $bot $rsn $type $time      if {$kick1} {pushkick "" $nick $rsn}    } else {      hs_chanban $chan $mask $bot $rsn $type $time      if {$kick1} {pushkick $chan $nick $rsn}    }  } else {    hs_ban $mask $bot $rsn $type $time    if {$kick2} {pushkick "" $nick $rsn}  }  hs_log $type $bot $from $chan $data $idx}proc hs_handler {from cmd arg} {  hs_handle $from [lindex $arg 0] [lindex $arg 1] [lindex $arg 2] [lindex $arg 3] [lindex $arg 4] [lindex $arg 5] [lindex $arg 6] [lindex $arg 7] [lindex $arg 8] [lindex $arg 9] [lindex $arg 10] [lindex $arg 11]  return 0}bind bot - spammer hs_handlerputlog "no!spam leaf :Loaded"</code></pre></div><br><br><br><br><br>and<br>this a nospam1.7.1.tcl<br>________________________________________________________<br><br><div class="codebox"><p>Code: </p><pre><code>#---------------------------------------------------------------------------------------#- no!spam - by PPSlim and wreck##-   First beta and 1.6.3 by: PPSlim  (Nothing is real but the pain.)#- 1.2.0 to 1.6.2 &amp; 1.7.0 by: wreck   (Hi kids. Do you like violence?)##- Works on all eggdrops 1.1.5 to 1.6.6.#---------------------------------------------------------------------------------------#- $Id: no.spam.tcl,v 1.24 2002/01/14 20:52:06 ppslim Exp $#---------------------------------------------------------------------------------------#- DCC commands: (see .desc file for full descriptions)##-   +spam &lt;type&gt; &lt;string&gt;           Add spam string.#-   -spam &lt;type&gt; &lt;string&gt;           Remove spam string.#-   spams &lt;type&gt; [string]           View spam strings. (that match string)##-   +spamchan &lt;channel&gt; [type]      Add spam channel. (add type to channel)#-   -spamchan &lt;channel&gt; [type]      Remove spam channel. (remove type from channel)#-   spamchans                       View spam channels.##- Valid types can be found by typing DCC command name by itself,#- strings can contain wildcards (* or ?) and case does not matter.#---------------------------------------------------------------------------------------# Set this to the full path of your spam channels file, this is where the channels that# no!spam will monitor are kept. Don't manually create this. Do it in the partyline using# the DCC commands +/-spamchan.set spam-chan-file "/home/forever69/cirkinbot/scripts/spam.chans"timer 20 restart# Ignore channel, notice, part, and private messages that are under $spam-len characters in length.set spam-len 1# If the alleged spammer doesn't meet atleast this flag, ban them.# (if o is given, anyone who has the +o flag on the bot won't be banned)set spam-ignore-flag "m"# If the alleged spammer doesn't meet atleast this channel flag, ban them.# (if o is given, anyone who has the +o channel flag on the bot won't be banned)# This maybe set to "" for no channel flag matching. Previous versions, emulated a setting of ""set spam-ignore-cflag ""# If the alleged spammer is an op in the channel, don't ban them?set spam-ignore-opped 1# If the alleged spammer is a voice in the channel, don't ban them?set spam-ignore-voiced 1# People who meet atleast this flag can use the no!spam DCC commands.set spam-dcc-flag m# If you want no!spam to keep a log of all the spammers it bans, then set this to 1.# Then right below it set the full path of the file you want to log spammers to.set spam-log 1set spam-log-file "/home/forever69/cirkinbot/scripts/spammers"#---------------------------------------------------------------------------------------#- spam leaf bot(s)# If you want this copy of no!spam to forward all spammers to another bot for processing# then set this to 1. If you do not want to forward, then set this to 0.## How this Works:  The hub will sit and monitor for spam like normal, but instead of#                  banning the spammer itself, it will ask the leaf(s) to take care of it.##                  The hub sends the leaf(s) all the appropriate settings to handle the#                  bans. (such as ban time, ban reason, etc.) So you MUST continue#                  setting up the rest of this TCL for the leaf to work properly.##                  The only thing always processed by the hub will be $spam_file_warn.## Please Note:  The hub is this bot, and the leaf(s) will being any bots running#               no.spam.leaf.tcl. These do not have to do with botflags or sharing.##               Though, the bots must be linked with the hub running no!spam 1.7.0#               or later, and the leaf(s) using no.spam.leaf.tcl.#set spam-use-leaf 1# The events and the leaf(s) that should process them.# Leave any event set to "" to have the hub process it.## Please Note:  You need to specify the leaf's botnet-nick, not its normal IRC nick.#set spam_leaf(chan) "cirkinbot"set spam_leaf(file) "cirkinbot"set spam_leaf(invt) "cirkinbot"set spam_leaf(notc) "cirkinbot"set spam_leaf(part) "cirkinbot"set spam_leaf(priv) "cirkinbot"# What should no!spam do if the leaf is not linked?# 0 = Nothing, ignore the spam# 1 = Process the spam itselfset spam-no-leaf 1#---------------------------------------------------------------------------------------#- channel messages# If you want no!spam to monitor the channel messages (normal chat) in channels that you# have marked as +c (see DCC commands) then set this to 1. Otherwise leave it set to 0,# to keep it disabled.## This works by you providing a list of search strings to look for. If one of these strings# is found in anyone's (that doesn't meet $spam-ignore-flag) channel message then they will# be banned accordingly.#set spam_check(chan) 0# Set this to the full path of your channel spam strings file.# You don't have to create one now, you can wait and do it using +/-spam.## Please Note:  If you want to use the same spam strings for each type, then specify the#               same file for each. Then use +/-spam on one, it will be applied to them all.## Example of a channel spam file: (don't include the # of course)## *join #*# *http://www.*# *first to join * gets a cookie*#set spam_file(chan) "/home/forever69/cirkinbot/scripts/spam.chan"# Where should the ban be applied?# 0 = Only ban globally if we have to# 1 = Always ban globally## Please Note:  This now works the same for each type.#set spam_global(chan) 1# How should the hosts of the spammers be masked?# 0 = *!user@host.domain# 1 = *!*user@host.domain# 2 = *!*@host.domain# 3 = *!*user@*.domain# 4 = *!*@*.domain# 5 = nick!user@host.domain# 6 = nick!*user@host.domain# 7 = nick!*@host.domain# 8 = nick!*user@*.domain# 9 = nick!*@*.domain# 10 = regular eggdrop maskset spam_mask(chan) 2# How long (in minutes) should the ban last?# Set to 0, to make it a permanent ban. (not recommended)# Set to -1, to use the default ban-time. (as set in your eggdrop.conf)## Please Note:  No longer uses "" for default ban-time.#set spam_time(chan) 60# Random ban messages to use.## Please Note:  That using * as the first character in your message makes the ban sticky.#set spam_reason(chan) {  "\00312Mass-Msg/Invite/Adv/Trojan Send\00312"}#---------------------------------------------------------------------------------------#- part messages#- Please Note:  This works exactly like above, except part messages are checked on#-               channels that're marked as +pset spam_check(part) 0set spam_file(part) "/home/forever69/cirkinbot/scripts/spam.part"set spam_mask(part) 0set spam_time(part) 60set spam_global(part) 1set spam_reason(part) {  "Part message abuse"}#---------------------------------------------------------------------------------------#- notices#- Please Note:  This works just like above except notices that are sent to your bot,#-               and channel notices to channels that're marked as +n are monitored.set spam_check(notc) 1set spam_file(notc) "/home/forever69/cirkinbot/scripts/spam.notc"set spam_mask(notc) 0set spam_time(notc) 60set spam_global(notc) 1set spam_reason(notc) {  "\00312Mass-Msg/Invite/Adv/Trojan Send\00312"}#---------------------------------------------------------------------------------------#- invites# If you want no!spam to ban people, who don't match $spam-ignore-flag, that invite your# bot to a channel that it isn't on, set this to 1. Otherwise set it to 0, to disable.## Please Note:  If the person who sent this notice left the channel they sent it from,#               the ban will become global (only for $spam_time(invt)) despite $spam_global.##               And since no message is sent with invites, you don't need to add#               any search strings. You also don't need to mark any channels for#               this, since it (the spammer or spam) won't necessarily be in one.#set spam_check(invt) 1set spam_mask(invt) 0set spam_time(invt) 60set spam_global(invt) 1set spam_reason(invt) {  "\00312Mass-Msg/Invite/Adv/Trojan Send\00312"}#---------------------------------------------------------------------------------------#- private messages# If you want no!spam to monitor your bots private messages (/msg) for spam, then set# this to 1, otherwise 0 to disable.## Please Note:  This works just like invite checking, but you're required to store a list#               of search strings. (see DCC commands)#set spam_check(priv) 1set spam_file(priv) "/home/forever69/cirkinbot/scripts/spam.priv"set spam_mask(priv) 0set spam_time(priv) 60set spam_global(priv) 1set spam_reason(priv) {  "\00312Mass-Msg/Invite/Adv/Trojan Send\00312"}#---------------------------------------------------------------------------------------#- dcc sends# If you want no!spam to monitor DCC sends that people send to your bot, then keep this# set to 1, otherwise 0 to disable.#set spam_check(file) 1# If you want no!spam to cycle channels that are marked as +d (see DCC commands) every# $spam-file-interval minutes, so it can pick-up DCC-on-joins and ban the sender, then# keep this set to 1.## Also Note:  This can also help catch on-join/part spamming too.#set spam-file-cycle 1# Interval to cycle channels. (in minutes)set spam-file-interval 1# Pick interval at random? (from $spam-file-lower to $spam-file-interval)set spam-file-rand 0# If using random intervals, set this to the lower radom limit. (mins)## Example:  Set spam-file-interval 20, and spam-file-lower 10 would make the bot#           cycle the channel every 10 to 20 mins rather than the original method,#           1 to 20 minutes.## Please Note:  To make it use the original random method, set this to 1, higher#               than or the same as $spam-file-interval.#set spam-file-lower 10# Skip cycling a channel if the bot isn't opped there?set spam-cycle-noop 0# Skip cycling a channel if the bot is the only op left?set spam-cycle-onlyop 0# Skip cycling a channel if it is opless?set spam-cycle-juped 0# Don't cycle a channel if there isn't atleast $spam-cycle-min nick(s) matching# the $spam-cycle-flag flag, that are opped? (setting spam-cycle-min to 0 will disable this)set spam-cycle-min 0set spam-cycle-flag b# If you want to keep a list of files that you don't want to ban for then set# them here. You can safely set this to "" to block all files. Wildcards work.set spam-file-safe {  "motd.txt"}# If you want no!spam to send a notice to someone for sending a specific file out,# then set it here.## Example:##   set spam_file_warn(life_stages.text.shs) {#     "You were banned because you are infected with a virus."#     "If you need help removing it, join #dmsetup."#     "Please don't respond to this, I'm a bot."#   }## Please Note:  Each line is sent seperately, file name NEEDS to be lower case.#set spam_mask(file) 0set spam_time(file) 60set spam_global(file) 1set spam_reason(file) {  ""}#---------------------------------------------------------------------------------------#- code begins here#- please don't edit anything below, unless you know what you are doing.#---------------------------------------------------------------------------------------if {!$spam_check(chan) &amp;&amp; !$spam_check(part) &amp;&amp; !$spam_check(notc) &amp;&amp; !$spam_check(invt) &amp;&amp; !$spam_check(priv) &amp;&amp; !$spam_check(file)} {  putlog "Loading no!spam has been skipped. You have it disabled."  return 0}proc ctrl:filter {str} {regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str ; return $str}proc strcmp {one two} {if {[string tolower $one] == [string tolower $two]} {return 1} ; return 0}proc llcmp {lsta lstb} {strcmp [llength $lsta] [llength $lstb]}proc lremove {list str} {lreplace $list [lsearch -exact $list $str] [lsearch -exact $list $str]}proc fulltype {type} {switch -- $type {c {return chan} d {return file} i {return invt} m {return priv} n {return notc} p {return part}}}proc findnick {nick} {foreach chan [channels] {if {[onchan $nick $chan]} {return $chan}} ; return ""}proc isbothost {uhost} {global botname ; return [strcmp $uhost $botname]}proc pushkick {chan nick rsn} {if {$chan != ""} {if {[onchan $nick $chan]} {putserv "KICK $chan $nick :$rsn"}} else {foreach chan [channels] {if {[onchan $nick $chan]} {puthelp "KICK $chan $nick :$rsn"}}}}if {$numversion &lt;= 1032800} {proc isbotnick {nick} {global botnick ; return [strcmp $nick $botnick]}}proc ns:ban {mask comment type} {global botnick spam_time ; if {[set time $spam_time([fulltype $type])] &gt;= 0} {newban $mask $botnick $comment $time} else {newban $mask $botnick $comment}}proc ns:chanban {chan mask comment type} {global botnick spam_time ; if {[set time $spam_time([fulltype $type])] &gt;= 0} {newchanban $chan $mask $botnick $comment $time} else {newchanban $chan $mask $botnick $comment}}proc ns:clrtmr {} {if {[string match *nospam_cycle* [set tms [timers]]]} {foreach t $tms {if {[string match *nospam_cycle* $t]} {killtimer [lindex [split $t] 2]}}}}proc ns:rand {low high} {if {$low &gt;= $high} {return [rand $high]} else {return [expr ([rand [expr $high - $low]]) + $low]}}proc spamlen {spam} {global spam-len ; if {[string length $spam] &gt; ${spam-len}} {return 1} ; return 0}#- masktype{} is based upon the original by MC_8 (mc.moretools.tcl)proc masktype {uhost type} {  set masked [maskhost $uhost]  set nick [string range $uhost 0 [expr [string first ! $uhost] - 1]]  switch -- $type {    0 {set ban "*[string range $uhost [string first ! $uhost] e]"}    1 {set ban "*!*[string trimleft [string range $uhost [expr [string first ! $uhost] + 1] e] "~"]"}    2 {set ban "*!*[string range $uhost [string first @ $uhost] e]"}    3 {set ident [string range $uhost [expr [string first ! $uhost] + 1] [expr [string last @ $uhost] - 1]] ; set ban "*!*[string trimleft $ident ~][string range $masked [string first @ $masked] e]"}    4 {set ban "*!*[string range $masked [string last @ $masked] e]"}    5 {set ban $uhost}    6 {set ident [string range $uhost [expr [string first ! $uhost] + 1] [expr [string last @ $uhost] - 1]] ; set ban "$nick!*[string trimleft $ident ~][string range $uhost [string last @ $uhost] e]"}    7 {set ban "$nick!*[string range $uhost [string last @ $uhost] e]"}    8 {set ident [string range $uhost [expr [string first ! $uhost] + 1] [expr [string last @ $uhost] - 1]] ; set ban "$nick!*[string trimleft $ident ~][string range $masked [string last @ $masked] e]"}    9 {set ban "$nick!*[string range $masked [string last @ $masked] e]"}    default {set ban "*!*[string range $uhost [string first @ $uhost] e]"}  }  set nnick [lindex [split $ban !] 0]  set iident [string range $ban [expr [string first ! $ban] + 1] [expr [string last @ $ban] - 1]]  set hhost [string range $ban [expr [string last @ $ban] + 1] e]  if {$iident != [set temp [string range $iident [expr [string length $iident] - 9] e]]} {set iident *[string trimleft $temp *]}  if {$hhost != [set temp [string range $hhost [expr [string length $hhost] - 63] e]]} {set hhost *[string trimleft $temp *]}  return $nnick!$iident@$hhost}proc spamchan {chan type} {  global spam_chans  if {![info exists spam_chans]} {return 0}  foreach cflags $spam_chans {    set chanx [lindex [split $cflags +] 0]    if {$type != ""} {if {[strcmp $chanx $chan] &amp;&amp; [string match *$type* [lindex [split $cflags +] 1]]} {return 1}} else {if {[strcmp $chanx $chan]} {return 1}}  }  return 0}proc spamignore {who chan} {  global spam-ignore-flag spam-ignore-cflag spam-ignore-opped spam-ignore-voiced  if {[string match *!*@* $who]} {    set hand [finduser $who]    set nick [lindex [split $who !] 0]    #set hand [nick2hand [set nick [lindex [split $who !] 0]]]  } else {    set nick [hand2nick [set hand $who]]  }  if {(${spam-ignore-cflag} != "") &amp;&amp; ([validchan $chan])} {    if {[matchattr $hand "${spam-ignore-flag}|${spam-ignore-cflag}" $chan]} {return 1}  } else {    if {[matchattr $hand ${spam-ignore-flag}]} {return 1}  }  if {[validchan $chan]} {    if {(${spam-ignore-opped} &amp;&amp; [isop $nick $chan]) || (${spam-ignore-voiced} &amp;&amp; [isvoice $nick $chan])} {return 1}  }  return 0}proc spamsyntax {idx cmd} {  switch -- $cmd {    +spam {putidx $idx "Usage: +spam &lt;type&gt; &lt;string&gt;" ; putidx $idx "Valid types: c (chan), m (priv msg), n (notices), p (parts) or a for all."}    -spam {putidx $idx "Usage: -spam &lt;type&gt; &lt;string&gt;" ; putidx $idx "Valid types: c (chan), m (priv msg), n (notices), p (parts) or a for all."}    spams {putidx $idx "Usage: spams &lt;type&gt; \[string\]" ; putidx $idx "Valid types: c (chan), m (priv msg), n (notices), p (parts)."}    +spamchan {putidx $idx "Usage: +spamchan &lt;#channel&gt; \[type\]" ; putidx $idx "Valid types: c (chan), d (dcc-cycle), n (notices), p (parts)."}    -spamchan {putidx $idx "Usage: -spamchan &lt;#channel&gt; \[type\]" ; putidx $idx "Valid types: c (chan), d (dcc-cycle), n (notices), p (parts)."}  }}#---------------------------------------------------------------------------------------#- spam string file procsproc sf_write {type data} {  global spam_file  set file [open $spam_file($type) w]  foreach spam $data {puts $file $spam}  close $file}proc sf_read {type} {  global spam_file spam_matches  if {[file exists $spam_file($type)]} {    set file [open $spam_file($type) r]    set size [file size $spam_file($type)]    set data [split [read $file $size] \n]    close $file    if {[llength $data]} {set spam_matches($type) $data}  }}proc sf_matches {type} {  global spam_matches  if {[info exists spam_matches($type)]} {return $spam_matches($type)}  return ""}proc sf_append {type data} {  global spam_matches spam_file  set type [fulltype $type]  if {[info exists spam_matches($type)]} {if {[lsearch -exact $spam_matches($type) $data] != -1} {lappend spam_matches($type) $data}} else {set spam_matches($type) [list $data]}  set file [open $spam_file($type) a+]  puts $file $data  close $file}proc sf_remove {type item} {  global spam_matches spam_file  if {[llength [sf_matches [set type [fulltype $type]]]]} {if {![llcmp $spam_matches($type) [set spam_matches($type) [lremove $spam_matches($type) $item]]]} {sf_write $type $spam_matches($type) ; return 1}}  return 0}#---------------------------------------------------------------------------------------#- spam chan file procsproc scf_write {} {  global spam-chan-file spam_chans  set file [open ${spam-chan-file} w]  puts $file $spam_chans  close $file}proc scf_read {} {  global spam-chan-file spam_chans  set file [open ${spam-chan-file} r]  set size [file size ${spam-chan-file}]  set data [split [read $file $size]]  close $file  if {[llength $data]} {set spam_chans $data}}proc scf_entry {chan} {  global spam_chans  foreach cflags $spam_chans {if {[strcmp [lindex [split $cflags +] 0] $chan]} {return $cflags}}  return ""}proc scf_addtype {old new} {  global spam_chans  set chan [string tolower [lindex [split $old +] 0]]  if {![string length [set new [string tolower [string trimleft $new +]]]]} {return 0}  if {![info exists spam_chans]} {set spam_chans [list "$chan\+$new"] ; return 1}  if {![string length [set temp [string tolower [lindex [split $old +] 1]]]]} {if {[llcmp $spam_chans [set spam_chans [lremove $spam_chans $old]]]} {return 0} else {lappend spam_chans "$chan\+$new" ; return 1}}  foreach i [split $new {}] {if {![string match *$i* $temp]} {append temp $i}}  if {[string length $temp]} {    if {[set i [lsearch -exact $spam_chans $old]] != -1} {      set spam_chans [lreplace $spam_chans $i $i "$chan\+$temp"]      return 1    }  }  return 0}proc scf_remtype {old del} {  global spam_chans  if {$old == ""} {return 0}  set chan [string tolower [lindex [split $old +] 0]]  set temp [string tolower [lindex [split $old +] 1]]  if {[string length [set del [string tolower [string trimleft $del -]]]]} {    set r 0    foreach i [split $del {}] {if {[string match *$i* $temp]} {regsub $i $temp "" temp ; incr r}}    if {$r} {      if {[set i [lsearch -exact $spam_chans $old]] != -1} {        set spam_chans [lreplace $spam_chans $i $i "${chan}+${temp}"]        scf_write        return 1      }    }  }  return 0}proc scf_append {chan flags} {  global spam_chans  set chan [string tolower $chan]  if {[info exists spam_chans]} {lappend spam_chans "${chan}+${flags}"} else {set spam_chans [list "${chan}+${flags}"]}  scf_write}proc scf_remove {chan} {  global spam_chans  set temp ""  foreach cflags $spam_chans {if {[strcmp [lindex [split $cflags +] 0] $chan]} {set temp $cflags ; break}}  if {$temp != ""} {if {![llcmp $spam_chans [set spam_chans [lremove $spam_chans $temp]]]} {scf_write ; return 1}}  return 0}#---------------------------------------------------------------------------------------#- dcc-on-join procsif {$spam_check(file) &amp;&amp; ${spam-file-cycle}} {  proc getchankey {chan} {    set chanm [split [getchanmode $chan]]    set modes [lindex $chanm 0]    if {[string match *k* $modes]} {if {[string match *l* $modes]} {set key [lindex $chanm 2]} else {set key [lindex $chanm 1]}} else {set key ""}    return $key  }  proc cyclechan {chan} {    global spam-cycle-noop spam-cycle-onlyop spam-cycle-juped spam-cycle-min spam-cycle-flag    if {![botonchan $chan] || (${spam-cycle-noop} &amp;&amp; ![botisop $chan])} {return 0}    set ops 0    if {${spam-cycle-min}} {      foreach nick [chanlist $chan ${spam-cycle-flag}] {if {[isop $nick $chan]} {incr ops}}      if {$ops &lt;= ${spam-cycle-min}} {return 0}    }    set ops 0    foreach nick [chanlist $chan] {if {[isop $nick $chan]} {incr ops}}    if {${spam-cycle-juped} &amp;&amp; !$ops} {return 0}    if {${spam-cycle-onlyop} &amp;&amp; ($ops == 1) &amp;&amp; [botisop $chan]} {return 0}    if {[set key [getchankey $chan]] != ""} {puthelp "JOIN $chan :$key"} else {puthelp "JOIN $chan"}    puthelp "PART $chan"  }  proc nospam_ctimer {} {    global spam-file-cycle spam-file-interval spam-file-rand spam-file-lower    ns:clrtmr    if {${spam-file-cycle}} {      if {${spam-file-rand}} {set i [ns:rand ${spam-file-lower} ${spam-file-interval}]} else {set i ${spam-file-interval}}      timer $i nospam_cycle    }  }  proc nospam_cycle {} {    global spam_chans    foreach cflags $spam_chans {      set cflags [split $cflags +]      if {[string match *d* [lindex $cflags 1]]} {cyclechan [lindex $cflags 0]}    }    nospam_ctimer  }}#---------------------------------------------------------------------------------------#- spammer loggerproc sl_write {type who where what why} {  global spam-log spam-log-file  if {${spam-log}} {    set file [open ${spam-log-file} a+]    set when [strftime "%D %r"]    switch $type {      c {puts $file "$when: $who said: (#$why) $what in: $where"}      d {puts $file "$when: $who was sending: $what to people in: $where"}      i {puts $file "$when: $who invited me to: $where"}      m {puts $file "$when: $who messaged me with: (#$why) $what"}      n {if {![string length $where]} {set where "me"} ; puts $file "$when: $who noticed: $where with: (#$why) $what"}      p {puts $file "$when: $who parted from: $where with: (#$why) $what"}    }    close $file  }}#---------------------------------------------------------------------------------------#- event handlingproc spamhandle {type nick from chan idx kick1 kick2 data} {  global spam_global spam-use-leaf spam-no-leaf spam_leaf spam_time spam_reason spam_mask  set ftype [fulltype $type]  set rsn [lindex $spam_reason($ftype) [rand [llength $spam_reason($ftype)]]]  set mask [masktype $from 2]  if {[info exists spam-use-leaf] &amp;&amp; ${spam-use-leaf}} {if {[set leaf $spam_leaf($ftype)] == ""} {set method norm} elseif {[islinked $leaf]} {set method leaf} else {if {[info exists spam-no-leaf] &amp;&amp; ${spam-no-leaf}} {set method norm} else {set method null}}}  if {![info exists method]} {set method norm}  switch $method {    norm {      if {[validchan $chan]} {if {$spam_global($ftype)} {ns:ban $mask $rsn $type ; if {$kick1} {pushkick "" $nick $rsn}} else {ns:chanban $chan $mask $rsn $type ; if {$kick1} {pushkick $chan $nick $rsn}}} else {ns:ban $mask $rsn $type ; if {$kick2} {pushkick "" $nick $rsn}}      sl_write $type $from $chan $data $idx    }    leaf {putbot $leaf "spammer [list $type $spam_global($ftype) $nick $from $chan $idx $kick1 $kick2 $spam_time($ftype) $mask "$rsn" "$data"]"}    null {return 0}  }}#---------------------------------------------------------------------------------------#- event monitoringset nospam-loaded ""catch {unbind raw - PRIVMSG chan:abuse}catch {rename chan:abuse ""}catch {unbind msgm - * priv:abuse}catch {rename priv:abuse ""}if {$spam_check(chan) || $spam_check(priv)} {  proc msgs:abuse {from key arg} {    global spam_check    set arg [split $arg]    set where [lindex $arg 0]    if {![isbothost $from] &amp;&amp; ![spamignore $from $where]} {      if {$spam_check(chan) &amp;&amp; [spamchan $where c]} {set type chan} elseif {$spam_check(priv) &amp;&amp; [isbotnick $where]} {set type priv}      if {[info exists type] &amp;&amp; [llength [set matches [sf_matches $type]]]} {        if {[spamlen [set text [ctrl:filter [string tolower [string trimleft [lrange $arg 1 end] :]]]]]} {          set nick [lindex [split $from !] 0]          set idx 0          foreach match $matches {            incr idx            if {[string match [string tolower $match] $text]} {if {$type == "chan"} {spamhandle c $nick $from $where $idx 1 1 $text} else {spamhandle m $nick $from $where $idx 1 0 $text} ; break}          }        }      }    }    return 0  }  bind raw - PRIVMSG msgs:abuse  if {$spam_check(chan)} {append nospam-loaded c}  if {$spam_check(priv)} {append nospam-loaded m}} else {  catch {unbind raw - PRIVMSG msgs:abuse}  catch {rename msgs:abuse ""}}if {$spam_check(file)} {  proc file:abuse {nick uhost hand dest key arg} {    global spam-file-safe spam_file_warn    if {![isbothost [set from "$nick!$uhost"]] &amp;&amp; ![spamignore $hand [set chan [findnick $nick]]]} {      set arg [split $arg]      if {[strcmp [lindex $arg 0] send]} {        set file [string tolower [lindex $arg 1]]        if {[info exists spam-file-safe]} {foreach safe ${spam-file-safe} {if {[string match [string tolower $safe] $file]} {return 0}}}        spamhandle d $nick $from $chan "" 1 0 $file        if {[info exists spam_file_warn([string tolower $file])]} {foreach msg $spam_file_warn([string tolower $file]) {puthelp "NOTICE $nick :$msg"}}      }    }    return 0  }  bind ctcp - DCC file:abuse  append nospam-loaded d  if {${spam-file-cycle}} {nospam_ctimer}} else {  catch {unbind ctcp - DCC file:abuse}  catch {rename file:abuse ""}  ns:clrtmr}if {$spam_check(invt)} {  proc invt:abuse {from key arg} {    if {![isbothost $from] &amp;&amp; ![spamignore $from [set chan [findnick [set nick [lindex [split $from !] 0]]]]]} {      if {![validchan [string trimleft [lindex [split $arg] 1] :]]} {spamhandle i $nick $from $chan "" 1 0 ""}    }    return 0  }  bind raw - INVITE invt:abuse  append nospam-loaded i} else {  catch {unbind raw - INVITE invt:abuse}  catch {rename invt:abuse ""}}if {$spam_check(notc)} {  proc notc:abuse {from key arg} {    if {([llength [set arg [split $arg]]] &gt; 1) &amp;&amp; [string match *!*@* $from]} {      if {![isbothost $from] &amp;&amp; ![spamignore $from [set chan [lindex $arg 0]]]} {        if {[spamchan $chan n] || [isbotnick $chan]} {          if {[llength [set matches [sf_matches notc]]]} {            if {[spamlen [set nmsg [ctrl:filter [string trimleft [string tolower [join [lrange $arg 1 end]]] :]]]]} {              if {[isbotnick $chan]} {set chan ""}              set nick [lindex [split $from !] 0]              set idx 0              foreach match $matches {                incr idx                if {[string match [string tolower $match] $nmsg]} {spamhandle n $nick $from $chan $idx 1 1 $nmsg ; break}              }            }          }        }      }    }    return 0  }  bind raw - NOTICE notc:abuse  append nospam-loaded n} else {  catch {unbind raw - NOTICE notc:abuse}  catch {rename notc:abuse ""}}if {$spam_check(part)} {  proc part:abuse {from key arg} {    if {($key == "PART") &amp;&amp; ([llength [set arg [split $arg]]] &gt; 2) &amp;&amp; [strcmp [string index [lindex $arg 1] 0] :]} {      if {[spamchan [set chan [lindex $arg 0]] p]} {        if {![isbothost $from] &amp;&amp; ![spamignore $from $chan]} {          if {[llength [set matches [sf_matches part]]]} {            if {[spamlen [set pmsg [ctrl:filter [string trimleft [string tolower [join [lrange $arg 1 end]]] :]]]]} {              set idx 0              foreach match $matches {                incr idx                if {[string match [string tolower $match] $pmsg]} {spamhandle p $nick $from $chan $idx 0 0 $pmsg ; break}              }            }          }        }      }    }    return 0  }  bind raw - PART part:abuse  append nospam-loaded p} else {  catch {unbind raw - PART part:abuse}  catch {rename part:abuse ""}}#---------------------------------------------------------------------------------------#- dcc commandsproc dcc:+spam {hand idx arg} {  putcmdlog "#$hand# +spam $arg"  if {([llength [set arg [split $arg]]] &lt; 2) || ([string length [set type [string tolower [lindex $arg 0]]]] &gt; 1)} {spamsyntax $idx "+spam" ; return 0}  if {[string length [set spam [join [lrange $arg 1 end]]]] &lt;= 2} {putidx $idx "Try a bigger search string than that." ; return 0}  if {$type == "a"} {    sf_append c $spam ; sf_append n $spam ; sf_append p $spam ; sf_append m $spam    putidx $idx "Successfully added spam string ${spam} to all appropriate types."  } else {    sf_append $type $spam    putidx $idx "Successfully added [fulltype $type] spam string $spam"  }  return 0}proc dcc:-spam {hand idx arg} {  putcmdlog "#$hand# -spam $arg"  if {([llength [set arg [split $arg]]] &lt; 2) || ([string length [set type [string tolower [lindex $arg 0]]]] &gt; 1)} {spamsyntax $idx "-spam" ; return 0}  set spam [join [lrange $arg 1 end]]  if {$type == "a"} {    sf_remove c $spam ; sf_remove n $spam ; sf_remove p $spam ; sf_remove m $spam    putidx $idx "Removed spam string ${spam} from all appropriate types."  } else {    if {[sf_remove $type $spam]} {      putidx $idx "Removed [fulltype $type] spam string $spam"    } else {      putidx $idx "Unable to remove [fulltype $type] spam string $spam"    }  }  return 0}proc dcc:spams {hand idx arg} {  putcmdlog "#$hand# spams $arg"  if {![llength [set arg [split $arg]]]} {spamsyntax $idx "spams" ; return 0}  set type [fulltype [string tolower [lindex $arg 0]]]  if {[llength [set spams [sf_matches $type]]]} {    if {[llength $arg] == 1} {      putidx $idx ",---- [llength $spams] ${type} spam string(s)"      foreach spam $spams {putidx $idx "| $spam"}      putidx $idx "`---- end"    } else {      set string [join [lrange $arg 1 end]]      putidx $idx ",---- ${type} spam string(s), that match: $string"      foreach spam $spams {if {[string match [string tolower $string] [string tolower $spam]]} {putidx $idx "| $spam"}}      putidx $idx "`---- end"    }  } else {    putidx $idx "You have no ${type} spam strings."  }  return 0}proc dcc:+spamchan {hand idx arg} {  putcmdlog "#$hand# +spamchan $arg"  if {![llength [set arg [split $arg]]]} {spamsyntax $idx "+spamchan" ; return 0}  set chan [lindex $arg 0]  if {[llength $arg] == 1} {    if {[spamchan $chan ""]} {      putidx $idx "I am already monitoring $chan"    } else {      scf_append $chan cdnp      putidx $idx "Successfully added spam channel ${chan}+cdnp"    }  } else {    set flags [string tolower [lindex $arg 1]]    if {[spamchan $chan ""]} {      set cflags [scf_entry $chan]      if {[scf_addtype $cflags $flags]} {        scf_write        putidx $idx "Successfully changed ${cflags} to [scf_entry $chan]"      } else {        putidx $idx "Unable to make any changes to $chan"      }    } else {      scf_append $chan $flags      putidx $idx "Successfully added spam channel ${chan}+${flags}"    }  }  return 0}proc dcc:-spamchan {hand idx arg} {  global spam_chans  putcmdlog "#$hand# -spamchan $arg"  if {![llength [set arg [split $arg]]]} {spamsyntax $idx "-spamchan" ; return 0}  if {![info exists spam_chans] || ([llength $spam_chans] &lt; 1)} {putidx $idx "No spam channels to remove from." ; return 0}  set chan [lindex $arg 0]  if {[llength $arg] == 1} {    if {[scf_remove $chan]} {putidx $idx "Successfully removed spam channel $chan"} else {putidx $idx "Unable to remove spam channel $chan"}  } else {    set flags [string tolower [lindex $arg 1]]    set cflags [scf_entry $chan]    if {[scf_remtype $cflags $flags]} {putidx $idx "Successfully changed ${cflags} to [scf_entry $chan]"} else {putidx $idx "Unable to make any changes to $chan"}  }  return 0}proc dcc:spamchans {hand idx arg} {  global spam_chans spam_check  putcmdlog "#$hand# spamchans $arg"  if {![info exists spam_chans] || ([llength $spam_chans] &lt; 1)} {putidx $idx "No spam channels to list." ; return 0}  putidx $idx ",---- spam channels \[types\] \[#channel\]"  foreach cflags $spam_chans {    set type [lindex [split $cflags +] 1]    if {$spam_check(invt)} {append type i}    if {$spam_check(priv)} {append type m}    putidx $idx "| [format "%-11.11s %s" $type [lindex [split $cflags +] 0]]"  }  putidx $idx "`---- end"  return 0}bind dcc ${spam-dcc-flag} +spam dcc:+spambind dcc ${spam-dcc-flag} -spam dcc:-spambind dcc ${spam-dcc-flag} spams dcc:spamsbind dcc ${spam-dcc-flag} +spamchan dcc:+spamchanbind dcc ${spam-dcc-flag} -spamchan dcc:-spamchanbind dcc ${spam-dcc-flag} spamchans dcc:spamchans#---------------------------------------------------------------------------------------#- load our spamfile buffers and we're donecatch {unset spam_matches(chan) spam_matches(notc) spam_matches(part) spam_matches(priv) spam-chan-matches spam-notc-matches spam-part-matches spam-priv-matches spam_chans}if {$spam_check(chan)} {sf_read chan}if {$spam_check(notc)} {sf_read notc}if {$spam_check(part)} {sf_read part}if {$spam_check(priv)} {sf_read priv}if {[file exists ${spam-chan-file}]} {scf_read}putlog "no!spam [lindex [set nospam-ver {010702 1.7.2}] 1] \+${nospam-loaded} :Loaded"#0107020F</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3368">forever79</a> — Sat Jul 24, 2004 5:57 pm</p><hr />
]]></content>
	</entry>
	</feed>
