mIRC Homepage
Posted By: LordNight Bad Nick Kick - 15/02/06 01:36 PM
Hi ya Again...
I am not sure if this will do what I want it to. but on a bad nick I want it to kick the person adn msg them to change there nick

Code:
on *:join:#:{
  if ([censored] isin $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }
  if (cunt isin $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }
  if (bitch isin $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }
  if (pussy isin $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }
  if (Visitor isin $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname. | /msg $nick Change your Name and try again. }
 }
} 


So will this work
Or is there a shorter version I can use... LOL

Thanks
Posted By: bwr30060 Re: Bad Nick Kick - 15/02/06 02:12 PM
You might want to use "iswm, like this:
Code:
if (*whatever* iswm $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }

You also might want to write the person's whois info to your log so you can track whether someone in your channel has been there before with an offensive nick. I'd suggest writing $wildsite to your log. Also remember that this code would need to be changed in an ON NICK event to "if (*whatever* iswm $newnick)"...Hope that helps.
Posted By: hixxy Re: Bad Nick Kick - 15/02/06 03:52 PM
if (*blah* iswm whatever) is exactly the same as if (blah isin whatever).

To the original poster: instead of asking if it will work, try the code out.
Posted By: genius_at_work Re: Bad Nick Kick - 15/02/06 04:44 PM
I may be wrong, but it looks like there is an extra } at the end of the code. Try removing it. You can also use the [{}] button in the mIRC script editor to test whether you have matching { and } in your script.

-genius_at_work
Posted By: HobophobE Re: Bad Nick Kick - 16/02/06 02:02 AM
By using a while loop you save yourself from the multiple-if-thens. I also moved the kick code to a separate alias, so that in the event there is a word in a name which is offensive, but not part of your %badlist
you can type /kickbad [nick] [channel] to manually invoke it. If you want, you can make %badlist a permanent variable, and add an alias to allow you to add new badwords to it at will.

Code:
on *:join:#:{
/*
[color:red]Set this values below:[/color]
%badlist = word1'word2'word3'...'wordn
*/
  var %badlist = [color:red]ugly'stupid'dumb[/color]
  var %bad = $gettok(%badlist,0,39)
  while (%bad > 0) {
/*
Although you could use iswm, the code with isin is slightly cleaner.
See afterwards for the iswm code, if you want it.
*/
    if ($gettok(%badlist,%bad,39) isin $nick) {
      kickbad $nick $chan
    }
    dec %bad
  }  
}
alias kickbad {
  .kick $$2 $$1 $$1 $+ , Kicked for Inappropriate nickname.
  write KickLogs.txt $+($chr(40),$date,-,$time,$chr(41)) $+($$1,$chr(44)) Kicked for Inappropriate nickname.
  msg $$1 Change your Name and try again.
} 
/*
this is the iswm code:
    if ($+($chr(42),$gettok(%badlist,%bad,39),$chr(42)) iswm $nick) {
      kickbad $nick $chan
    }
*/
 
Posted By: LordNight Re: Bad Nick Kick - 16/02/06 05:50 AM
Ok Thanks All......

HobophobE I ended up with yours... and also made it write in there ip and everything so I coudl keep track..

thank everyone..
© mIRC Discussion Forums