Quote:
I tried that but it kicks all who joins my chan

That would be because it executes the kick each time the on join is executed unless it gets halted by the $read being $null.

Sparta: Please, please, read up on 1) /help $read and 2) /help /while :]

Code:
var %badword = $read(badwords.txt,nt,%badword.line)
;; Doing it for nick and user parts of the address separately:
if (%badword isin $nick || %badword isin $ial($nick).user) { ... }
;; Doing it for nick and user parts of the address in one:
if (%badword isin $gettok($fulladdress,1,64)) { ... }


I would either do the kick in the while loop, or set a flag:

Code:
var %n = $lines(badwords.txt)
;; option 1
while (%n) {
  if ($read(...)) { kick ... }
  dec %n
}

;; option 2
var %flag = $false
;; the && !%flag here is optional - if it's not present, it will always run through the entire file, which may be useful for some applications
while (%n && !%flag) {
  if ($read(...)) { %flag = $true }
  dec %n
}
if (%flag) { kick .... }


These are obviously just templates, I leave it up to you, dear reader, to implement them as you see fit!


Sais