<? set_time_limit(0); require_once('WebIcqPro.class.php'); $file = 'anek.txt'; $icq = new WebIcqPro(); $uin = 1234567; $pwd = 123456; $anek = file($file); if($icq->connect($uin,$pwd)) { echo "Connected";} else { echo $icq->error; exit();} while($icq->isConnected()) { $msg = $icq->readMessage(); if(preg_match('/!anekdot/', $msg['message'], $trash)) { $icq->sendMessage($msg['from'], $anek[rand(0,sizeof($anek)-1)]); } } ?>