consider using a privmsg to the person instead of a public tell. Keep a hash of $seenusers{"$nickname"} with the value being a epoch time. you know if the hash entry exists that you have said hi to this user before, and what time you have said hi, so you can calculate "hey I only want to say hi to users every 30 minutes and I have not said hi to this user for 4 hours and I am seeing him join the channel again ... must say hi"