My favorites | Sign in
Project Logo
mzk
                
Search
for
Updated Jan 30, 2007 by sirdarckcat
Labels: Phase-Implementation
ExampleSession  
Example of basic session connections.

Documentation Index

Example sessions

This 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


Comment by theozoeht, Mar 15, 2008

Hello, plz can you help me ? I want to stop the bot after hi say to all "hello" ...

Thank's for all !

Comment by Eleazan, Apr 30, 2008

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(); 

    } 

?>
Comment by setting7, May 04, 2008

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?

Comment by gayastur20, May 19, 2008

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!?

Comment by vprelovac, Jul 11, 2008

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?

Comment by pedsters.planet, Aug 20, 2008

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); }

} }

Comment by pedsters.planet, Aug 21, 2008

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.. :(

Comment by duas.rpg, Aug 21, 2008

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!

Comment by theozoeht, Dec 29, 2008

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 ?

Comment by montherito, Mar 25, 2009

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:

si recivo mensaje verificar de quien viene(osea obtener su mail) mandarle mensaje

Bueno, tal vez alguien me pueda ayudar.

Saludos, gracias de ante mano

Comment by cyk.se.aman, May 25, 2009

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

Comment by pallsopp, Jun 22, 2009

Just tried it out and it works fine for what I need.

Thanks!

Comment by gvuyk07, Jul 26, 2009

Can I use "ignore_user_abort(1)" to keep the bot connected? Puedo usar "ignore_user_abort(1)" para mantener al bot conectado?

Comment by rommell, Aug 10, 2009

24 ours conexion?


Sign in to add a comment
Hosted by Google Code