Хм...вопрос...как добавить ПРАВИЛЬНО команду.... имеем
Цитата:
//!инвиз
if(preg_match('~^!инвиз~', $msg_text))
{
preg_match('~\s+([0-9-]+)~', $msg_text, $icq);
foreach($icq as $i => $xek)
{
$xek = str_replace('-', NULL, $xek);
if($i)
{
$fp = fsockopen("kanicq.ru", 80, $errno, $errstr, 30);
$query = 'human=1&uin='.$xek.'&uin4login=&password4login=';
$out = "POST /invisible/?method=2 HTTP/1.1\r\n";
$out .= "Host: kanicq.ru\r\n";
$out .= "Referer: http://kanicq.ru/invisible/?method=2\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Content-length: ".strlen($query)."\r\n\r\n";
$out .= $query;
fwrite($fp, $out);
$result = '';
while (!feof($fp))
{
$result .= fgets($fp, 128);
}
if ( preg_match ("/Free for chat/i" , "$result")) { $status = "ГОТОВ К ОБЩЕНИЮ"; }
elseif ( preg_match ("/Online/i" ,"$result")) { $status = "ОНЛАЙН"; }
elseif ( preg_match ("/Away/i" , "$result")) { $status = "ОТОШЕЛ"; }
elseif ( preg_match ("/N\/A/i" , "$result")) { $status = "НЕДОСТУПЕН"; }
elseif ( preg_match ("/Occupied/i" , "$result")) { $status = "ЗАНЯТ"; }
elseif ( preg_match ("/DND/i" , "$result")) { $status = "ПРОСИТ НЕ БЕСПОКОИТЬ"; }
elseif ( preg_match ("/offline/i" , "$result")) { $status = "ОФФЛАЙН"; }
elseif ( preg_match ("/status\/invisible/i" , "$result")) { $status = "НЕВИДИМЫЙ"; }
else { $status = "НЕИЗВЕСТНО"; }
$send .= 'Номер '.$xek.' сейчас '.$status.'!'."\n";
}
else
{
continue;
}
}
}
|
Это из бота ISIS....надо переделать под этого :)
Пробывал так..не пашет..(
Цитата:
//!инвиз
preg_match('~\s+([0-9-]+)~', $msg_text, $icq);
foreach($icq as $i => $xek)
{
$xek = str_replace('-', NULL, $xek);
if($i)
{
$fp = fsockopen("kanicq.ru", 80, $errno, $errstr, 30);
$query = 'human=1&uin='.$xek.'&uin4login=&password4login=';
$out = "POST /invisible/?method=2 HTTP/1.1\r\n";
$out .= "Host: kanicq.ru\r\n";
$out .= "Referer: http://kanicq.ru/invisible/?method=2\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Content-length: ".strlen($query)."\r\n\r\n";
$out .= $query;
fwrite($fp, $out);
$result = '';
while (!feof($fp))
{
$result .= fgets($fp, 128);
}
if ( preg_match ("/Free for chat/i" , "$result")) { $status = "ГОТОВ К ОБЩЕНИЮ"; }
elseif ( preg_match ("/Online/i" ,"$result")) { $status = "ОНЛАЙН"; }
elseif ( preg_match ("/Away/i" , "$result")) { $status = "ОТОШЕЛ"; }
elseif ( preg_match ("/N\/A/i" , "$result")) { $status = "НЕДОСТУПЕН"; }
elseif ( preg_match ("/Occupied/i" , "$result")) { $status = "ЗАНЯТ"; }
elseif ( preg_match ("/DND/i" , "$result")) { $status = "ПРОСИТ НЕ БЕСПОКОИТЬ"; }
elseif ( preg_match ("/offline/i" , "$result")) { $status = "ОФФЛАЙН"; }
elseif ( preg_match ("/status\/invisible/i" , "$result")) { $status = "НЕВИДИМЫЙ"; }
else { $status = "НЕИЗВЕСТНО"; }
return 'Номер '.$xek.' сейчас '.$status.'!'."\n";
}
else
{
continue;
}
}
|
|