Here are a few examples:
# END spammers and trolls
# This example demands you manually add and block spammers etc by IP address
order allow,deny
deny from {IP ADDRESS}
deny from {SECOND IP ADDRESS ONE PER LINE}
deny from {YOU CAN ALSO USE DOMAIN NAME trollhostname.com}
allow from all
# END spammers and trolls
another way to do it is:
#This way blocks automated registrations if people did not come to your site directly
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_REFERER} !^
http://www.urltoyoursite.com [NC]
RewriteRule .* - [F]
# END
another way is:
# With this example if the referrer is blank it stops them registering etc. Most spammers remove the referrer
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* - [F]
# END Block blank referrer
There are more but these examples should help you get started.