mIRC Home    About    Download    Register    News    Help

Print Thread
#142030 15/02/06 01:36 PM
Joined: Jan 2006
Posts: 22
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2006
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

#142031 15/02/06 02:12 PM
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

#142032 15/02/06 03:52 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

#142033 15/02/06 04:44 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

#142034 16/02/06 02:02 AM
Joined: Dec 2002
Posts: 29
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Dec 2002
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
    }
*/
 

#142035 16/02/06 05:50 AM
Joined: Jan 2006
Posts: 22
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2006
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..


Link Copied to Clipboard