mIRC Homepage
Posted By: sparta caps problem - 20/11/04 10:30 PM
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..
Posted By: tidy_trax Re: caps problem - 20/11/04 10:44 PM
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 
  }
}
Posted By: sparta Re: caps problem - 20/11/04 10:47 PM
$hget should be an alias:

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

??
Posted By: tidy_trax Re: caps problem - 20/11/04 10:51 PM
No, $hget() is an identifier built into mIRC.
Take a look at /help hash tables
Posted By: sparta Re: caps problem - 21/11/04 05:48 PM
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:
Posted By: tidy_trax Re: caps problem - 21/11/04 05:52 PM
Mine already uses $chan and it should work on the channel it was triggered on, not the active channel.
Posted By: sparta Re: caps problem - 21/11/04 05:54 PM
it sends it to the channel im talking on tho.. so hmm :tongue:
© mIRC Discussion Forums