Thank you all for your answers.
By the way, its not a bot who types !afk, its a normal user and if that one types !afk my bot says that that user ($nick) is afk.
@krimson: Ahh... very true, $nick is the desired nick, while $botnick is the actual.. keep mixing those up all the time :/ *bows before master*
@darton: Then there would be no use to make any variables global at all, go with krimson's example instead or put the checks directly inside the first proc...
I have shortened the script above a little bit
So its not the $nick directly who says !afk. The bot who is $nick reproduces everything from a game, so there are people in the game who type !afk. So its [lindex [split $arg] 0] who says !afk.