Depending on what kind of services are available on your network, you may just be able to set the channel modes to allow only java guest and registered users. Spam bots are highly unlikely to be using registered nicks, so this works quite well. The only drawback is that if an unregistered user wants to get into the channel, and they're using an irc client, they can't - but sometimes that's not such a bad thing, and overall the amount of spam has been reduced by 100%. In addition to your usual channel modes, type in
/chanserv mode #channel +JjR - hopefully your ircd will support these modes. Not sure if that was exactly what you were looking for, but hope it helps anyway. You could always ask in one of the help channels on your network too.