|
ExampleSession
Example of basic session connections.
Documentation IndexExample sessionsThis function will simply login to the .NET Passport account.. and show the response of the server. <?php
include("mzk.php");
$t = new MezzengerKlient;
$t->debug=true;
$t->init("mail@mail.com","password");
$t->login();
$t->main();
$t->quit();
?>This function will say "Hello" to all contacts online. <?php
include("mzk.php");
$t = new MezzengerKlient;
$t->debug=true;
$t->onLogin="spam";
$t->init("mail@mail.com","password");
$t->login();
$t->main();
$t->quit();
function spam(){
global $t;
for ($i=0;isset($t->onlinefriends[$i]);$i++){
$cont=@split(' ',$t->onlinefriends[$i]);
$t->MessageToNew($cont[0],"Hello");
}
}
?>This function will change the bot's nick to "I am a bot" when logged in. <?php
include("mzk.php");
$t = new MezzengerKlient;
$t->debug=true;
$t->onLogin="change_nick";
$t->init("mail@mail.com","password");
$t->login();
$t->main();
$t->quit();
function change_nick(){
global $t;
$t->setNick('I am a bot');
}
?>More examples can be found at the download section here: http://code.google.com/p/mzk/downloads/list |
Sign in to add a comment
Hello, plz can you help me ? I want to stop the bot after hi say to all "hello" ...
Thank's for all !
maybe
<?php include("mzk.php"); $t = new MezzengerKlient?; $t->debug=true; $t->onLogin="spam"; $t->init("mail@mail.com","password"); $t->login(); $t->main(); $t->quit(); function spam(){ global $t; for ($i=0;isset($t->onlinefriends[$i]);$i++){ $cont=@split(' ',$t->onlinefriends[$i]); $t->MessageToNew?($cont0?,"Hello"); } $t->quit(); } ?>Hola me gustaria saber como realizar el codigo para que cuando el bot reciba el primer mensaje diga un mensaje de alerta y al finalizar la conversacion envie todo el log a un correo electronico, algo asi.
contacto dice: Hola!! bot dice: Hola soy un bot. =)
Y cuando el contacto cierre su ventana de conversacion se envie el log al correo.
alguien puede ayudarme?
Hola. Estoy intentando que cuando hable con todos los contactos el script se desconecte y no se quede cargado el php pero no lo consigo. Intente esto:
global $t; for ($i=0;isset($t->onlinefriends$i?);$i++){ $cont=@split(' ',$t->onlinefriends$i?); $t->MessageToNew?($cont0?,"Hello"); } $t->quit(); }
El script se queda detenido pero no envia el mensaje a los usuarios. Tambien intente con die; en vez de $t->quit(); pero ocurre lo mismo!!
Que puedo hacer!?
Hi
I am wondering can the class send a add a friend request?
What I want to do is to use the class to send a message to the user. I think this does not work without user first accepting the bot as friend?
Is there an example for doing this?
If I add a loop after the main() function, how can we monitor for any messages (RNG), then respond to them automatically? Can that be done?
eg. (from a diff php bot)
$data = $this->get();
if ($data) { switch($code = substr($data, 0, 3)) { default: case 'RNG': if (preg_match('/BLEEP(.?)$/i', $msg)) { $sbsess->tx_im($this->fp, "O BLEEP you too!", $this->passport, $email); }
} }
Also, I'm gertting this Nexus Error.. even though curl & ssl are compiled in PHP.
What does the $matches array hold? As I can't see anywhere for it to get anything.. :(
Sería posible dejar el bot conectado las 24h? me gustaría hacer una aplicacion que buscara en mi web (le dices al bot "!busca HOLA" y aparezcan los post que contengan hola, o link a la pagina de busqueda) pero parece que cuando acaba el tiempo de ejecución, deja de funcionar, deja de responder y al tiempo parece que se desconecta. Tiene limite de contactos el bot? habria que usar varias cuentas si lo tiene o que solucion tomar? Gracias!
hello,
I have a probleme, the bot send : << <NotificationData? xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Service>ABCHInternal</Service><CID>-3400268437622983253</CID><LastModifiedDate>2008-12-29T13:44:53.053-08:00</LastModifiedDate><HasNewItem>false</HasNewItem></NotificationData> !-E->call_user_func("spam"); >> REA 44 theozoeht@live.fr allofmanga-bot << REA 44 1 theozoeht@live.fr allofmanga-bot
and stop ...
have you any idea of this ?
Hola, me gustaria saber si puedo saber el email de quien envia mensajes al bot, es decir, ya ven que esta el onChatMessage que es para cuando el bot recive un mensaje, entonces quisiera saber si puedo obtener la direccion de correo de quien le ha enviado el mensaje para poder responderle a esa misma persona
seria algo asi como:
Bueno, tal vez alguien me pueda ayudar.
Saludos, gracias de ante mano
hola no entiendo mucho y solo quieo un code para tener un webmessenger basico tenes un code listo llegar y copiar
cristianptf@live.com
te lo agradeceria mucho
Just tried it out and it works fine for what I need.
Thanks!
Can I use "ignore_user_abort(1)" to keep the bot connected? Puedo usar "ignore_user_abort(1)" para mantener al bot conectado?
24 ours conexion?