collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Welcome Message  (Read 2227 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Welcome Message
« 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);
    }

}
?>

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Welcome Message
« Reply #1 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;
    }


  }
?>
BeBot Founder and Fixer Kingpin

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 757
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal