BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Wanuarmi on November 12, 2005, 08:47:46 am

Title: Welcome Message
Post by: Wanuarmi on November 12, 2005, 08:47:46 am
This is a simple welcome message when a member joins the private group.

Just save as WelcomeMessage.php in the modules folder.

Code: [Select]
<?

$welcomeMessage = new WelcomeMessage($bot);

$commands["pgjoin"][] = &$welcomeMessage;

class WelcomeMessage
{
    var $bot;

    function WelcomeMessage (&$bot)
    {
      $this -> bot = &$bot;
    }

    function pgjoin($name)
    {
$botname = $this -> bot -> botname;
$this -> bot -> send_tell($name, "Welcome to $botname. ::: Please check the rules /tell $botname !rules", 1);
    }

}
?>
Title: Welcome Message
Post by: Khalem on November 12, 2005, 11:48:04 pm
And heres an example for Guild bots:
Code: [Select]

<?
  /*
   * LogonNotify_GUILD.php -
   *
   * BeBot - An Anarchy Online Chat Automaton
   * Copyright (C) 2004 Jonas Jax
   *
   * Developed by Blondengy (RK1)
   * Special thanks goes out to Khalem (RK1) for his support.
   *
   * File last changed at $LastChangedDate: 2004-12-29 01:41:32 +0100 (Wed, 29 Dec 2004) $
   * Revision: $Id$
   */

  $LogonNotify = new LogonNotify($bot);

  $commands["buddy"][] = &$LogonNotify;
  $commands["connect"][] = &$LogonNotify;


  /*
    The Class itself...
  */
  class LogonNotify
  {
    var $bot;
    var $start;



    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function LogonNotify (&$bot)
    {
      $this -> bot = &$bot;
    }



    /*
      This gets called if a buddy logs on/off
    */
    function buddy($name, $msg)
    {
        if ($this -> start < time())
        {

                if ($this -> bot -> is_member($name) == 1)
                {
                        if ($msg == 1)
                        {
                                // A generic welcome message example
                                $this -> bot -> send_tell($name, "Welcome to " . $this -> bot -> guildname . " " . $name);
                                // Lets show the online list
                                $this -> bot -> commands["tell"]["online"] -> tell($name, "online");
                                // Lts show the news too
                                $this -> bot -> commands["tell"]["news"] -> tell($name, "news");
                        }
                }
        }
    }

    /*
      This gets called when bot connects
    */
    function connect()
    {
        $this -> start = time() + $this -> bot -> crondelay;
    }


  }
?>
SimplePortal 2.3.7 © 2008-2024, SimplePortal