egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Extra words after "else" clause in "if"

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri Jun 25, 2004 4:23 am    Post subject: Extra words after "else" clause in "if" Reply with quote

Hi,

I have this script it is a clone detector and a channel locker script.
I am having problems with else and if statements, if someone could
help me with the error it would be greatful.

Code:

Tcl error [clonejoin]: wrong # args: extra words after "else" clause in "if" command


Code:

bind join - * clonejoin


proc clonejoin {nick uhost hand chan} {
   global cp_chans cp_j_flood cp_jp_flood cp_btime cp_host_count cp_uh_count clonebantime
   set uhost [string tolower $uhost]
   set host [lindex [split $uhost @] 1]
   set chan [string tolower $chan]
      set banmask "*!*@[lindex [split $uhost @] 1]"
   set joinpartsplit [lindex [split $cp_j_flood ":"] 0]; set joinparttimes [lindex $joinpartsplit 0]; set joinpartsecs [lindex $joinpartsplit 1]
     if {(([lsearch -exact [split [string tolower $cp_chans]] [string tolower $chan]] == -1) || ($cp_chans == "*"))} {return 0}
   if {![info exists cp_host_count($host:$chan)]} {
      set cp_host_count($host:$chan) 1
   } else {
      incr cp_host_count($host:$chan)
   }
   utimer [lindex $cp_j_flood 1] [list cp_expire cp_host_count($host:$chan)]
   if {$cp_host_count($host:$chan) > [lindex $cp_j_flood 0]} {
    newchanban $chan *!*@$host clones "2(Excessive Clones 12from:6 *!*@$host2)" 30
       if {[botisop $chan]} {
          enforce:flood:mlock $chan
        putquick "KICK $chan $nick :2(Excessive Clones 12from:6 *!*@$host2)" -next
             utimer 1 [list scan:remove:clones $banmask $host $nick $chan]
        }
       }
   if {![info exists cp_uh_count($uhost:$chan)]} {
      set cp_uh_count($uhost:$chan) 1
   } else {
      incr cp_uh_count($uhost:$chan)
   }
   utimer [lindex $cp_jp_flood 1] [list cp_expire cp_uh_count($uhost:$chan)]
   if {$cp_uh_count($uhost:$chan) >= [expr [lindex $cp_jp_flood 0]*2]} {
    newchanban $chan *!*@$host clones "2(Excessive Clones 12from:6 *!*@$host2)" 30
       if {[botisop $chan]} {
      enforce:flood:mlock $chan; set list [list]
         putquick "KICK $chan $nick :2(Excessive Clones 12from:6 *!*@$host2)" -next
      foreach user [chanlist $chan] {
          if {[string equal -nocase $user $nick]} { continue }
          if {[string match -nocase $banmask "${nick}![getchanhost $user $chan]"]} { lappend list $user }
       }
         putquick "KICK $chan [join $list {,}] :0,1 Mass Join/Part Flood Kick 12,0 - 12Detected 2multiple 12clients cycling in here with the 2host6 $banmask 12performing2 $joinparttimes 12or more2 join/part cycles,12 in less than2 $joinpartsecs secs." -next
         timer $clonebantime "pushmode $chan -b *!*@$host"
                  }
   }
}


proc enforce:flood:mlock {chan} {
 global botnick allmodes mlockswitch mlock mlock1 mlock2 noticeswitch clonenotice mlockremove
  set checkmode [split [string trim [lindex [split [getchanmode $chan]] 0] "+"] ""]
  if {($mlockswitch == 1) && ($mlock != "") && ((![string match *$checkmode* *$allmodes*]) || (![string match *$checkmode* $mlock]) || (![string match *$checkmode* $mlock1]) || (![string match *$checkmode* $mlock2]))} {
   putquick "MODE $chan +$allmodes" -next; set modeslocked 1
   }
   if {($noticeswitch == 1) && ($clonenotice != "")} {
    putquick "NOTICE $chan :$clonenotice"
    }
   if {($mlockremove == "") || ($mlockremove == "0") || ($mlockremove < "1")} { set $mlockremove 10 }
  utimer $mlockremove [list remove:flood:mlock $chan]
  return 1
}

proc remove:flood:mlock {chan} {
 global botnick allmodes mlock mlock1 mlock2
  set checknewmode [split [string trim [lindex [split [getchanmode $chan]] 0] "+"] ""]
  if {($mlock1 == "")} { set mlock1 $mlock }; if {($mlock2 == "")} { set mlock2 $mlock }
   if {([string match *$checknewmode* *$allmodes*]) || ([string match *$checknewmode* $mlock]) || ([string match *$checknewmode* $mlock1]) || ([string match *$checknewmode* $mlock2])} {
    putserv "MODE $chan -$allmodes"
    return 1
    }
}

proc scan:remove:clones {banmask host nick chan} {
 global botnick clonebantime
  set list [list]
  foreach user [chanlist $chan] {
   if {[string equal -nocase $user $nick]} {continue}
   if {[string match -nocase $banmask "${nick}![getchanhost $user $chan]"]} { lappend list $user }
   }
  putquick "KICK $chan [join $list ,] :0,1 Excessive Clone/Botnet Join Kick 2,0 - (Excessive Clones 12from host:6 *!*@$host2)" -next
  timer $clonebantime "pushmode $chan -b *!*@$host"
 return 1
}

_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber