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 

protection error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Nov 14, 2005 4:10 pm    Post subject: protection error Reply with quote

Ok, i have an error with the kickmsg, the kickmsg does not format correctly

The code:
Code:
proc protect::protection {nickname hostname handle channel mode victim} {
   if {($nickname == "$victim") || ($nickname == "$::botnick") || ![channel get $channel "protection"]} {
      return 0
   }
   switch -exact -- $mode {
      "+o" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            putquick "PRIVMSG [protect::service $channel] :DEOPALL $channel" -next
            if {[string match -nocase $::botnick $victim]} {
               set reason "op me"
            } else {
               set reason "op anyone"
            }
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set homename *!*@[lindex [split $hostname] 1]
            }
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               if {[string match -nocase $::botnick $victim]} {
                  putquick "MODE $channel -o+b $nickname $hostname" -next
               } else {
                  putquick "MODE $channel -oo+b $nickname $victim $hostname" -next
               }
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: op\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-o" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            putquick "PRIVMSG [protect::service $channel] :DEOPALL $channel" -next
            if {[string match -nocase $::botnick $victim]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel" -next
               set reason "deop me"
            } else {
               set reason "deop anyone"
            }
            set kickid [expr {$::id} + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set homename *!*@[lindex [split $hostname] 1]
            }
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               if {[string match -nocase $::botnick $victim]} {
                  putquick "MODE $channel -o+b $nickname $hostname" -next
               } else {
                  putquick "MODE $channel -o+ob $nickname $victim $hostname" -next
               }
               putquick "KICK $channel $nickname :$kickmsg"
               putlog "punished $nickname on $channel \(Reason: op\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+v" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {[botisop $channel]} {
               putquick "MODE $channel -ov $nickname $victim"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
         putlog "punished $nickname on $channel \(Reason: voice\)"
      }
      "-v" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {[botisop $channel]} {
               putquick "MODE $channel -o+v $nickname $victim"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
         putlog "punished $nickname on $channel \(Reason: devoice\)"
      }
      "+b" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            if {[string match -nocase $::botname $victim]} {
               if {![botisop $channel]} {
                  putquick "PRIVMSG [protect::service $channel] :OP $channel" -next
               }
               set reason "ban me"
            } else {
               set reason "ban anyone"
            }
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -ob+b $nickname $victim $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: ban\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-b" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel" -next
            }
            set reason "unban anyone"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+bb $nickname $hostname $victim" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unban\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+i" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set kickmsg $protect::kickmsg
            set reason "set invite"
            set kickid [expr $::id + 1]
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -oi+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set invite\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-i" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset invite"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+ib $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset invite\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+l" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +l \(limit\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -ol+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set limit\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-l" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +l \(limit\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+bl $nickname $hostname $victim" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset limit\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+m" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +m \(moderated\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -om+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set moderated\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-m" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +m \(moderated\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+mb $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset moderated\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+k" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +k \(key\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -ok+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set key\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-k" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +m \(moderated\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+bk $nickname $hostname $victim" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset key\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+t" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +t \(topic\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -ot+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set topic +t\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-t" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +t \(topic\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+bt $nickname $hostname " -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset topic +t\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+n" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +n \(no external messages\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -on+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set key\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-n" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +n \(no external messages\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+nb $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset key\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+s" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +s \(secret\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -os+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set secret\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-s" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +s \(secret\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+sb $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset secret\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "+p" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "set +p \(private\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -op+b $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: set private\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
      "-p" {
         if {![matchattr $handle nmAS|nmo $channel]} {
            if {![botisop $channel]} {
               putquick "PRIVMSG [protect::service $channel] :OP $channel"
            }
            if {[string match -nocase "*users.quakenet.org" $hostname]} {
               set hostname "*!*@[lindex [split $hostname] 1]"
            }
            set reason "unset +p \(private\)"
            set kickid [expr $::id + 1]
            set kickmsg $protect::kickmsg
            set kickmsg "[format $kickmsg $reason $channel $kickid $protect::homechan]"
            newchanban $channel $hostname "$kickmsg" $protect::prot_btime
            if {[botisop $channel]} {
               putquick "MODE $channel -o+pb $nickname $hostname" -next
               putquick "KICK $channel $nickname $kickmsg"
               putlog "punished $nickname on $channel \(Reason: unset private\)"
            } else {
               putlog "Error: could not punished $nickname on $channel \(Reason: no op\)"
            }
         }
      }
   }
}


The error:
Code:

* Bk`Tosser-- sets mode: +i
* aP|Trojan sets mode: -io+b Bk`Tosser-- *!Tosser@spc1-lanc1-3-0-cust169.asfd.broadband.ntl.com
* Bk`Tosser-- was kicked by aP|Trojan (6) ][ (SecureBot by #BotCentrum) ])

Kickmsg should be:
* Bk`Tosser-- was kicked by aP|Trojan ([ (You are not ALLOWED to set invite on #channel) ][ (ID: 6) ][ (SecureBot by #BotCentrum) ])


I can't seem to find an error with the format...

Thanks in advance !!
Chris Smile
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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