mIRC Home    About    Download    Register    News    Help

Print Thread
#77033 28/03/04 06:20 PM
Joined: Feb 2004
Posts: 24
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Feb 2004
Posts: 24
I was wondering say for instance, I tell someone not to spam the room, and I warn them the first time, and then I let them do it again and they just get a warning and on the 3rd time they spam, they're automatically kicked. I was wondering how would you go about writing a script like that?

#77034 28/03/04 06:27 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on $@*:text:/(come to|join|check out)#*/i:#:{
  inc %warn. [ $+ [ $nick ] ] 
  if %warn. [ $+ [ $nick ] ] == 1 { msg # first warning $nick $+ , do not spam }
  elseif %warn. [ $+ [ $nick ] ] == 2 { msg # last warning $nick $+ , do not spam in this channel! }
  elseif %warn. [ $+ [ $nick ] ] == 3 { 
    ban -ku60 # $nick i warned you, do not spam in this channel! 
    unset %warn. [ $+ [ $nick ] ]
  } 
}



New username: hixxy
#77035 28/03/04 06:34 PM
Joined: Feb 2004
Posts: 24
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Feb 2004
Posts: 24
So, how about for caps? Say I don't want them typing in all caps, they're only allowed to type in less then 7%, and I warn them 2x and then I kick them, how would I go about doing this? Sorry if this is off the subject.

#77036 28/03/04 06:38 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @*:text:*:#:{
  if $regex($1-,/[A-Z]/g) == $calc($len($1-) - $count($1-,$chr(32))) {
    inc %warn2. [ $+ [ $nick ] ] 
    if %warn2. [ $+ [ $nick ] ] == 1 { msg # first warning $nick $+ , do not type in full caps. }
    elseif %warn2. [ $+ [ $nick ] ] == 2 { msg # last warning $nick $+ , do not type in full caps on this channel! }
    elseif %warn2. [ $+ [ $nick ] ] == 3 { 
      ban -ku60 # $nick i warned you, do not type in full caps on this channel! 
      unset %warn2. [ $+ [ $nick ] ]
    } 
  }
}


New username: hixxy
#77037 28/03/04 08:32 PM
Joined: Feb 2004
Posts: 24
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Feb 2004
Posts: 24
I'm totally having a blonde moment, but how about if I want to set it at 7%? meaning if they type more then 7% in caps, they'll be warned?

#77038 28/03/04 08:50 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
You may want to take a look at this caps kicker and #HelpDesk's other document about Reaction Levels.

Regards,


Mentality/Chris
#77039 28/03/04 09:16 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
you can also do this:
change:
if $regex($1-,/[A-Z]/g) == $calc($len($1-) - $count($1-,$chr(32))) {
to:
if $calc(($regex($1-,/[A-Z]/g) / $len($1-)) *100) > 7 {


New username: hixxy
#77040 29/03/04 09:57 PM
Joined: Feb 2004
Posts: 24
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Feb 2004
Posts: 24
Ok, yall are gona think I'm really really stupid heh. I don't know much about scripting yet, but I'm learning, all this helping me is helping me understand better. Here's what I finally got after copying and pasting (sorry for this, I'll write my own later, I just want to know why things did what) 2 scripts.

on @*:TEXT:*:#: {
if ($len($1-) > 9) || ($nick isop #) return
var %text = $strip($remove($1-,$chr(32)))
var %non.caps = $len($removecs(%text,$regex($1-,/[A-Z]/g))
var %full.line = $len($strip($remove(%text,$chr(32))))
var %percent = $calc(1 - (%non.caps / %full.line))
if (%percent >= 0.8) {
inc %warn2. [ $+ [ $nick ] ]
if %warn2. [ $+ [ $nick ] ] == 1 { notice $nick first warning $nick $+ , do not type in full caps. This is an automated message, Do Not Respond Back. }
elseif %warn2. [ $+ [ $nick ] ] == 2 { notice $nick last warning $nick $+ , do not type in full caps on this channel! This is an automated message, Do Not Respond Back. }
elseif %warn2. [ $+ [ $nick ] ] == 3 {
gag $nick | Your text contains $calc(%percent * 100) %$+caps. This is not acceptable. You were already warned two times because of your abuse of caps.
unset %warn2. [ $+ [ $nick ] ]
}
}

and I'm getting a
* Invalid format: $len (line 4, Caps.mrc)

Can anyone help? sorry to be a bother. confused

#77041 29/03/04 10:02 PM
Joined: Feb 2004
Posts: 24
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Feb 2004
Posts: 24
sorry
Code:
  on @*:TEXT:*:#: {
  if ($len($1-) > 9) || ($nick isop #) return
  var %text = $strip($remove($1-,$chr(32)))
  var %non.caps = $len($removecs(%text,$regex($1-,/[A-Z]/g))
  var %full.line = $len($strip($remove(%text,$chr(32))))  
  var %percent = $calc(1 - (%non.caps / %full.line))
  if (%percent >= 0.8) {
    inc %warn2. [ $+ [ $nick ] ] 
    if %warn2. [ $+ [ $nick ] ] == 1 { notice $nick first warning $nick $+ , do not type in full caps. This is an automated message, Do Not Respond Back. }
    elseif %warn2. [ $+ [ $nick ] ] == 2 { notice $nick last warning $nick $+ , do not type in full caps on this channel! This is an automated message, Do Not Respond Back. }
    elseif %warn2. [ $+ [ $nick ] ] == 3 { 
      gag $nick | Your text contains $calc(%percent * 100) %$+caps. This is not acceptable.  You were already warned two times because of your abuse of caps.
      unset %warn2. [ $+ [ $nick ] ]
    } 


Link Copied to Clipboard