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.

looking for special caps.tcl

Old posts that have not been replied to for several years.
M
Mackenzie
Voice
Posts: 36
Joined: Sun Jul 28, 2002 2:08 pm
Location: Belgium
Contact:

Post by Mackenzie »

wow indeed set caps on 3 and ´% on 20

that's what i call a capskicker :lol:


is that also possibel that caps abusers will kick temporary for 1 minit after 3 kicks? a tempban?

Mack
M
Mackenzie
Voice
Posts: 36
Joined: Sun Jul 28, 2002 2:08 pm
Location: Belgium
Contact:

Post by Mackenzie »

oki to all the people on this forum....

a nice good working caps.tcl

--------------------------------------------------------------------------

#########################################
# capsGF.tcl (GF stands for G-Force bot)
# credits goes to:
# ppslim, Papillon
#
#Date: 11 sept 2002
#
#########################################
#
#Set this to the minimum string wize, before it will act
#IE, set 6, "HELLO" = no kick, "HELLO ALL" = kick
set cap_min 5

#set this tot he percentage, wihtout any percentage char
#IE, 50
set cap_per 40

bind pubm - "*" cap:perc:kick
proc cap:perc:kick {nick uh hand chan arg} {
global cap_per cap_min
if {[string length $arg] <= $cap_min} { return }
set full [string length $arg]
regsub -all {[A-Z]} $arg "" arg
putlog "$arg"
set perc [expr (($full - [string length $arg]) * 100) / $full]
putlog "$perc"
if {$perc >= $cap_per} {
putserv "KICK $chan $nick :*** NO *** caps please!!!) ([string range $perc 0 5]% caps)"
}
}

putlog "CapsGF.tcl 2002 Loaded"


--------------------------------------------------
I give all the credits to ppslim and Pappillon
many tnx for your help

Friendly greetings
Mackenzie
C
CosmicD
Op
Posts: 102
Joined: Sat Dec 11, 2004 3:46 pm

Post by CosmicD »

allright,

can i revive this topic by asking someone to make it channel aware (with a udef flag for each channel - or + ? :)
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

# use .chanset #yourchan <channel setting name> <min length>:<max percent>
# the name of your channel setting:
set capskick CAPSKICK;

setudef str $capskick
bind pubm - * capskick
proc capskick {n u h c a} {
	if {[scan [channel get $c $::capskick] %d:%d m p]!=2} return
	if {[set t [string len $a]]<$m} return
	set P [expr ([regexp -all {[A-Z]} $a]/$t.)*100]
	if {$P>=$p} {
		putkick $c $n "A-Z: [format %.1f $P]%"
	}
}
EDIT: fixed a bug and added the percent to the kick message
EDIT2: fixed the bug i introduced when fixing the other bug
(not tested as usual :P)
EDIT3: testing might not be such a bad idea after all... (rounding bug)
Last edited by user on Sat Jan 22, 2005 8:57 pm, edited 3 times in total.
Have you ever read "The Manual"?
C
CosmicD
Op
Posts: 102
Joined: Sat Dec 11, 2004 3:46 pm

Post by CosmicD »

:) hello

dont want to act up but... it seems to be a whole new script thx :) how to display the values (like % caps) in the kickmessage also ?

ok, i tried it with a simple thing
10 x a's
when i use
aaaaaaaaaa it doesnt do anything (wich is normal)
when i do
Aaaaaaaaaa it kicks already, while i've set 5:50

basicly it just kicks when i talk in the channel :)

anyway isnt it better to add to the previous script ? (the channel awareness) i tested that and it works good :)
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

CosmicD wrote:anyway isnt it better to add to the previous script ? (the channel awareness) i tested that and it works good :)
no, it's always better to do a total rewrite :P (try the edited version)
Have you ever read "The Manual"?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

CosmicD wrote::) hello

dont want to act up but... it seems to be a whole new script thx :) how to display the values (like % caps) in the kickmessage also ?

ok, i tried it with a simple thing
10 x a's
when i use
aaaaaaaaaa it doesnt do anything (wich is normal)
when i do
Aaaaaaaaaa it kicks already, while i've set 5:50

basicly it just kicks when i talk in the channel :)

anyway isnt it better to add to the previous script ? (the channel awareness) i tested that and it works good :)
Here's the one I use, quite similar to the one posted in this topic.

Code: Select all

# Set the channels here where you wish the kick to be activated on.
set capschans "#india #bharat"

#Set this to the minimum text size, before it will act
set capsmin "70"

# Minimum percentage of CAPS detected from the full text
set capslen "65"

bind pubm - * pub:caps:kick

proc pub:caps:kick {nick uhost hand chan text} {
 global botnick capschans capsmin capslen
  if {[string length $text] < $capsmin} {return 0}
    set text [ctrl:filter $text]
    set maxcaps "[string length $text]"
    regsub -all {[A-Z]} $text "" counted
    set countcaps [string length $counted]
    set capsban "*!*@[lindex [split $uhost @] 1]"
    set capsper [expr (($maxcaps - $countcaps) * 100) / $maxcaps]
    if {(([lsearch -exact [string tolower $capschans] [string tolower $chan]] != -1) || ($capschans == "*"))} {
     if {([botisop $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $hand mn|mn $chan]) && ([onchan $nick $chan]) && ($capsper >= $capslen)} {
      set capsrange "[string range $capsper 0 end]%"
      putquick "MODE $chan +b $capsban"
      putquick "KICK $chan $nick :0,1 Excessive CAPS Text Kick 12,0 - 12Exceeded the limit of2 $capslen% percent 12of caps by typing2 *$maxcaps* capital characters, 12at a rate of2 $capsrange percent. 12Please turn *off* your 2caps lock switch, 12which is located 2left to the 'A' button 12on your keyboard." 
      timer 30 "pushmode $chan -b $capsban"
      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
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked