Then $2 isnt the key
You'd want to fix your hash table to set whatever $2 is as the key so that you can retrieve the data quicker.
Looking at your original posts it seems the HOST is $2, so you'd want to add THAT as the key, not the nickname.
the variables that get passed in are %nick %host %chan so wouldn't $2 be correct as the key? That's the way I had it.
if ($hget(bots,$2)) {
???