Hi,
there are many ways to create a pm blocker. Personally I would go with a Hash Table, or perhaps the User List.
However, it's your script so I'll give you a solution that is closest to the way you like it.
Now, your test.txt file consists of lines with on each line 1 nickname, no spaces.
An altered $isinfile alias using $read instead of filter works great for your script, since it's single words, not multiple words on each line. The filter solution is preferable in the case of multiple words on one line.
Example code:
alias isinfile {
if !$isfile($$1) { echo -a Error: File $1 missing. | return }
if $2 == $null { echo -a Error: Matchtext missing. | return }
.echo -q $read($1,s,$2)
return $readn
}
[color:red] [/color]
on ^*:OPEN:?:*:{
if !$isinfile(test.txt,$nick) { echo -a $+ $nick just tried messaging you : 12 $+ $1- | halt }
}
Hope it is to your likings,
Greets
Edit: added the ^ in front of the event thanks to tsoglanos.