mIRC Home    About    Download    Register    News    Help

Print Thread
#113759 08/03/05 02:42 PM
P
phishes
phishes
P
I'm a newbie at this stuff, but basically what i was after was a small script, that gets triggered by someone talking in caps (has to be more than 5 caps in the line) and when this happens, i reply with a line something like this..

<ph1shes> Stop talking in 66.5% caps and stuff nickname
i want it to work out the percentage of caps within the line(s)

thanks.

#113760 08/03/05 07:53 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Code:
on *:text:*:#:{
  var %caps = $regex($1-,/[A-Z]/g)
  if (%caps &gt; 5) { msg $chan Stop talking in $round($calc(%caps / $len($1-) * 100),2) $+ % and stuff $nick }
}


The above is untested, but it should work.

#113761 08/03/05 08:36 PM
D
DaveC
DaveC
D
So on a 300 character line with 5 caps its ment to say...

<ph1shes> Stop talking in 1.7% caps and stuff Bob

lol

#113762 09/03/05 03:45 PM
P
phishes
phishes
P
Yeah works great, all i need now is the flood defence to go with it, lol
some people like to take advantage of it frown

#113763 09/03/05 07:44 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Code:
on *:text:*:#:{
  if (!%caps.floodprotection) {
    inc -u2 %caps.floodprotection
    var %caps = $regex($1-,/[A-Z]/g)
    if (%caps &gt; 5) { msg $chan Stop talking in $round($calc(%caps / $len($1-) * 100),2) $+ % and stuff $nick }
  }
}


Link Copied to Clipboard