Code:
on @*:text:*:#:{if $nick isreg # { var %k = 1,%kk = $lines(badwords.txt) | while %k <= %kk { if $+(*,$read(badwords.txt,%k),*) iswm $1- { ban -ku600 $chan $nick 2 Bad word detected out out > $read(badwords.txt,%k) | return $true } | inc %k } | return $false }

im using that code for badwords on channel the words on txt list how can i do same thing on hash tables confused
Code:
on *:text:*:#:{
  if !bwadd* iswm $1- {
    if $read(write badwords.txt,w,$2-) {
      .msg $chan  $2- already on the list
    }
    else {
      .write badwords.txt $2-
      .msg $chan $2- added on the list
    }
  }
} 

i try to do !bwadd fukeh so the script will add the fukeh word in the badwords.txt but its not work can fix it ?
also if make first code for hash table how can use !bwadd confused