This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

TCM.tcl help..

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
erotism
Voice
Posts: 13
Joined: Tue Aug 10, 2010 7:39 am
Location: Sofia, Bulgaria
Contact:

TCM.tcl help..

Post by erotism »

Here si code who I want to modify..

Code: Select all

proc *raw:cmds {from key arg} {
  global botnick servername ochan klist u_cflood c_kreason c_ktime c_kcount host whatdoing host
  if {$from != $servername} { return 0 }  
  if {[lindex $arg 2] == "Oper" && [lindex $arg 3] == "privs"} {
    putquick "STATS c"  
    putquick "STATS v"
    putquick "STATS p"
    putquick "STATS o"
    return 0
  }
  if {[lindex $arg 5] == "Flooder" && [lindex $arg 4] == "Possible"} {
    set fnick [lindex $arg 5]
    set fhost [lindex $arg 6]
    set onserver [lindex $arg 8]
    set target [lindex $arg 10]
	set whatdoing [lrange $arg 4 end]
    set host "[lindex [split "[lindex $arg 6]" "\[\]"]>-1]"
	putquick "PRIVMSG $ochan :$whatdoing"
    if {[lsearch -glob [string tolower $host] "*server.com"]>-1} {return 0}
    if {[lsearch -glob [string tolower $host] "*111.222.333.444"]>-1} {return 0}
    if {[lsearch -glob [string tolower $host] "*server1.com*"]>-1} {return 0}
    scan $fhost "%\[^@]@%s" trash uhost
    scan $uhost "%\[^]]]%s" host trash
    if {[regexp -nocase $host $klist]} {
      return 0
    } else {
      set klist "$klist $host"
      timer 10 "remove_kline $host"
    }
    putlog "KLINE 10 *@$host :$fnick $fhost Stop flooding, please!"
  }
}
On flood I received snotice:

Code: Select all

(13:10:56) -irc.server.com- *** Notice -- Possible Flooder nick[~ident@host] on irc.server.com target: #channel
How to make a bot to take nick ident and host from servernotice and set them as $fnick $fident and $fhost, and..

Code: Select all

putlog "KLINE 10 *@$host :$fnick $fhost Stop flooding, please!"
becoming..

Code: Select all

putlog "Flooder Nick: $fnick"
putlog "Flooder Identd: $fident"
putlog "Flooder Host: $fhost"
Post Reply