| Arcades | Library | Travel | MP3 | Directory | Horoscope | Downloads | Mobile | Movies | Gallery | PHP Group |
| mIRC :: SCRIPTING & HELP mIRC Scripting help, General help, Tips and Tricks! |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Caps Flood
PHP Code:
__________________
Last edited by Cult; 21-11-2005 at 07:31 PM. |
|
#2
|
||||
|
||||
|
Re: Caps Flood
On @*:TEXT:*:#: {
if ($nick !isop #) && ($len($1-) > 3) { var %caps.percent = $calc($regex($1-,/[A-Z]/g)/$len($1-)*100) if (%caps.percent > 60) { ban -k # $nick 2 Since you will not listen, its best you leave coz you too loud in CAPS text. } } } I THINK THIS IS BETTER :p
__________________
|
|
#3
|
||||
|
||||
|
Re: Caps Flood
Caps Kicker Using $regex Again, Working 100 % Id Someone Typed 40 % In Caps Letters.
***NOTICE: If You Are Using An Old Version Of miRc, Means Below 6.03, You Will Have To change this code: Code:
ban -k $chan $nick Please do not overuse capital letters. Code:
ban $chan $nick 2 kick $chan $nick Please Do Not OverUse Capital Letters. Code:
on $@*:TEXT:/([A-Z])/g:#: {
if ($calc($regml(0) / $len($1-)) >= .40) && ($nick isreg $chan) && ($len($1-) > 4) {
ban -k $chan $nick Please Do Not OverUse Capital Letters.
}
}
__________________
|
|
#4
|
||||
|
||||
|
Re: Caps Flood
Code:
on @*:text:*:#: {
var %c = 1, %u = 0, %l = 0
while (%c <= $len($1-)) {
if ($mid($1-,%c,1) isupper) {
inc %u
}
if ($mid($1-,%c,1) islower) {
inc %l
}
inc %c
}
if ($gettok($calc(%u / $len($1-) * 100),1,46) >= 70) {
ban -k $chan $nick 2 Caps Lock Kicker! $gettok($calc(%u / $len($1-) * 100),1,46) $+ % caps.
}
}
__________________
|
|
#5
|
||||
|
||||
|
Re: Caps Flood
Too many loops! I wouldn't go that way, count the characters instead.
Here is something I was working on some time ago; I don't understand a lot about $regex, but I mixed my code with yours on top and this is what I came up with: Code:
On @*:TEXT:*:#: {
if ($nick isreg $chan) && ($len($1-) > 20) {
var %caps.percent = $calc($regex($1-,/[A-Z]/g)/$len($1-)*100)
if (%caps.percent > 50) ban -k $chan $nick 2 Execess CAPS $+( [ ,%,$ceil(%caps.percent),/%100 CAPS ] )
}
}
The kick message will look something like this: Code:
* CAPS-FLOODER was kicked from #Channel by Some-OP ( Execess CAPS [ %51/%100 CAPS ] ) Code:
On @*:TEXT:*:#: {
if ($nick isreg $chan) && ($len($1-) > 20) && ($calc($regex($1-,/[A-Z]/g)/$len($1-)) > .5) {
ban -k $chan $nick 2 Execess CAPS
}
}
Got questions? I got answers ("I don't know" is an answer by the way!) ![]()
__________________
:: i have been since the dawn of time. i will be until the dusk of eternity :: |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Request] Channel Flood Protection | AYEHAN | mIRC :: SCRIPTING & HELP | 12 | 07-04-2006 06:34 PM |
| flood pro | Cult | mIRC :: SCRIPTING & HELP | 0 | 07-02-2006 11:11 AM |
| Caps Flood | Cult | mIRC :: SCRIPTING & HELP | 0 | 21-10-2005 07:30 PM |
| Query Flood Protection | Cult | mIRC :: SCRIPTING & HELP | 2 | 22-08-2005 12:17 PM |
| Action flood | shiah | mIRC :: SCRIPTING & HELP | 0 | 25-03-2005 07:35 PM |