PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- /**
- * Bot UIN (change it!!!)
- *
- */
- /**
- * Bot account password (change it!!!)
- *
- */
- /**
- * Administrator UIN for system messages (change it!!!)
- *
- */
- /**
- * Status for bot
- *
- */
- $help = "Bot commands:\r
- \t'!about' - print message about this bot.\r
- \t'!help' - print help message.\r
- \t'!stop' - stop bot (administrative).\r
- \t'!uptime' - print bot uptime.\r
- ";
- $about = "PHP BOT v3.4
- Based on WebIcqPro v1.2b
- (c) Sergey Akudovich
- Contact author:
- http://intrigue.ru/forum/";
- '000000',
- '000001',
- );
- require_once('WebIcqPro.class.php');
- $icq = new WebIcqPro();
- $icq->setOption('UserAgent', 'miranda');
- if($icq->connect(UIN, PASSWORD))
- {
- $icq->sendMessage(ADMINUIN, "Service PHP BOT started...");
- $icq->setStatus(STARTSTATUS, 'STATUS_DCCONT', 'Test me!!!');
- $icq->setXStatus('Love');
- $status = STARTSTATUS;
- }else{
- echo $icq->error;
- }
- $icq->activateOfflineMessages(UIN);
- while($icq->isConnected()){
- $msg = $icq->readMessage();
- $icq->sendMessage(ADMINUIN, $msg['from'].' > '.$msg['message']);
- {
- case '!about':
- $icq->sendMessage($msg['from'], $about);
- break;
- case '!help':
- $icq->sendMessage($msg['from'], $help);
- break;
- case '!stop':
- if($msg['from'] == ADMINUIN)
- {
- $icq->sendMessage(ADMIN, "Service PHP BOT stopt...");
- $icq->disconnect();
- }
- else
- {
- $icq->sendMessage($msg['from'], "The system is going down for reboot NOW! :)");
- }
- break;
- case '!uptime':
- break;
- default:
- $icq->sendMessage($msg['from'], "Type '!help' for assistance.");
- break;
- }
- }
- }
- ?>