mIRC Homepage
Posted By: Garou Not working - 22/07/07 06:22 PM
Its not kicking on whois or join...any ideal why?
Code:
 

raw 311:*:{
  if (%name != off) && ($nick !isop #chat) {
    var %a = 1, %b = $numtok($3-,32)
    while %a <= %b {
      if $hget(name,$gettok($3-,%b,32)) {
        ban -ku600 #chat $2 2 14Offensive IrcName Detected
        %a = %b
      }
      inc %a
    }
    return $regsubex($1-,/\b( $+ %name $+ )\b/gi,$str(*,$len(\t)))
  }
  haltdef
}
on *:start:{
  if !$hget(name) { .hmake name 10 }
  if $exists(name.op) { .hload name name.op }
}
on *:exit:{
  .hsave -o name name.op
}
on *:disconnect:{
  .hsave -o name name.op
}


Posted By: RusselB Re: Not working - 22/07/07 06:55 PM
The only thing that I can see from what you posted, is the fact that, $nick returns $null in a raw event, so your first if statement tries to check $null !isop #chat
Posted By: Garou Re: Not working - 22/07/07 07:19 PM
Dunno :P
Maybe I should go back to var instead?
Posted By: SladeKraven Re: Not working - 22/07/07 07:19 PM
RusseB is correct, use $2 instead of $nick.

Code:
Raw 311:*: echo 2 -a $2- | halt


Praetorian Madison Staff.OranosChat.com * on ss

$2 returns the nickname
$3 returns the ident/user
$4 returns the address
$6- returns the fullname

A more detailed explanation on Raw events can be found here
Posted By: Garou Re: Not working - 22/07/07 07:34 PM
Raw 311:*:{
if (%name != off) && ($2 !isop #chat) {


Still not kicking?
Posted By: SladeKraven Re: Not working - 22/07/07 07:45 PM
Code:
Raw 311:*:{
  if (%name != off) && ($2 !isop #chat) {
    if ($hfind(name,$2)) {
      ban -ku600 #chat $2 2 14Offensive IrcName Detected
    }
  }
  haltdef
}


I don't understand why you are using a loop. There's nothing to really loop through.
Posted By: Garou Re: Not working - 22/07/07 08:01 PM
Nope...This is what I have so far?

Code:
 

Raw 311:*:{
  if (%name != off) && ($2 !isop #chat) {
    if ($hfind(name,$2)) {
      ban -ku600 #chat $2 2 14Offensive IrcName Detected
    }
  }
  haltdef
}

on *:start:{
  if !$hget(name) { .hmake name 10 }
  if $exists(name.op) { .hload name name.op }
}
on *:exit:{
  .hsave -o name name.op
}
on *:disconnect:{
  .hsave -o name name.op
}
alias name {
  if !$1 { .notice $nick No word specified }
  else { .hadd -m name $2 $iif($hget(name,$2),$false,$true)  }
}

Posted By: SladeKraven Re: Not working - 22/07/07 08:04 PM
The above code I pasted works for me when I whois them, they get kicked.
Posted By: Garou Re: Not working - 22/07/07 08:09 PM
How do you save your bad names in name.op?
mine are like this on one line:
blowjob
$true
suck
$true
Posted By: SladeKraven Re: Not working - 22/07/07 08:15 PM
Just simply add them by:

/hadd -m name Nick $true
/hadd -m name AnotherNick $true

I'd save it using the -i switch, you don't have to but it's easier for me to read. Just my preference.
Posted By: Garou Re: Not working - 22/07/07 08:37 PM
Thx guys.
© mIRC Discussion Forums