mIRC Home    About    Download    Register    News    Help

Topic Options
#142030 - 15/02/06 01:36 PM Bad Nick Kick
LordNight Offline
Ameglian cow

Registered: 31/01/06
Posts: 22
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

Top
#142031 - 15/02/06 02:12 PM Re: Bad Nick Kick
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.
_________________________
Bears on Patrol Chat

Top
#142032 - 15/02/06 03:52 PM Re: Bad Nick Kick
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
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.

Top
#142033 - 15/02/06 04:44 PM Re: Bad Nick Kick
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#142034 - 16/02/06 02:02 AM Re: Bad Nick Kick
HobophobE Offline
Ameglian cow

Registered: 23/12/02
Posts: 29
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
    }
*/
 

Top
#142035 - 16/02/06 05:50 AM Re: Bad Nick Kick
LordNight Offline
Ameglian cow

Registered: 31/01/06
Posts: 22
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..

Top