Naib has released a newer version of this, where it checks for the bots next item. I don't recommend what you currently have, either Naib's new return code, or my own one in http://forums.heroesofnewerth.com/showthread.php?491207