mIRC Home    About    Download    Register    News    Help

Print Thread
#103428 20/11/04 10:30 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I have this code:
Code:
on CAPS1:TEXT:*:#:{
  if ($me isop $chan) {
    var %1-
    .echo -q $regsub($1-,/[^a-zA-Z0-9ÄÖ]/g,,%1-)
    if (%dkickop == off) && ($nick isop $chan) { return }
    if (%dkickvo == off) && ($nick isvo $chan) { return }
    if ($ulevel == 200) && (%ctcp.op == Enabled) { return }
    if ($ulevel == 125) && (%Group.AutoOp == Enabled) { return }
    if ($ulevel == 100) && (%friend == Enabled) { return }
    if ($ulevel == 75) && (%a.voice == Enabled) { return }
    else {
      if ($read($mircdir\dontckick.mrc,w,* $+ $chan $+ *)) { return }
      if ($int($calc(($regex(%1-,/[A-ZÄÖ]/g) / $len(%1-)) * 100)) > 75) { .ruser CAPS1 $nick | ban -u $+ %caps.b # $nick %bs | kick $chan $nick You have been warned. turn off your CAPSLOCK. }
    }
  }
}

but from time to time it "miss fire", it kick a user that dont use caps, somone that have a bether way to do this ? not nice to kick people that dont derseve it :tongue:

they get the user level CAPS1 by the same code, but thats triggered by everyone.. so no need to paste that part too here..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#103429 20/11/04 10:44 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @*:text:*:#:{
  var %p = $int($calc(($regex($1-,/[A-ZÄÖ]/g) / $len($1-)) * 100))
  if (%p > 75) && (!$hget($+(warn,$cid,$chan),$nick)) { 
    hinc -m $+(warn,$cid,$chan) $nick 
    msg $chan $nick $+ , Turn the caps off please.
  }
  elseif (%p > 75) && ($hget($+(warn,$cid,$chan),$nick)) { 
    ban -ku60 $chan $nick 2 You were told to stop using caps.
    hdel $+(warn,$cid,$chan) $nick 
  }
}


New username: hixxy
#103430 20/11/04 10:47 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
$hget should be an alias:

alias hget return $read($mircdir\dontckick.gx,w,* $+ $chan $+ *)

??


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#103431 20/11/04 10:51 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
No, $hget() is an identifier built into mIRC.
Take a look at /help hash tables


New username: hixxy
#103432 21/11/04 05:48 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Hmm, i have been trying your code for a while now, the problem is that the warnings is sent to the active channel, not the channel its trigger on.. how can i solve this? been trying with $chan . still same thing :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#103433 21/11/04 05:52 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Mine already uses $chan and it should work on the channel it was triggered on, not the active channel.


New username: hixxy
#103434 21/11/04 05:54 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
it sends it to the channel im talking on tho.. so hmm :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard