are you typing !ip on the SAME mirc that you put the script on?
if so then it wont work..previously you said that you had a bot..
so put the code on your bot, not YOUr client.