BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Lyledesol on December 20, 2005, 08:41:32 pm

Title: Adding auto news to logon
Post by: Lyledesol on December 20, 2005, 08:41:32 pm
I tried to change logon.GUILD.php so it would send the latest news to members as they signed in. They're a lazy bunch and don't look otherwise :/

I added the line below, but it didn't do anything.. Can someone point me in the right direction please.


Code: [Select]
function buddy($name, $msg)
    {
    if ($this -> start < time())
    {
        if ($this -> bot -> is_member($name) == 1)
        {
        $id = $this -> bot -> aoc -> get_uid($name);
          if ($msg == 1)
          {
          if ($this -> last_log["on"][$name] < (time() - 5))
          {
            $result = $this -> bot -> db -> select("SELECT nickname, firstname, lastname, level, profession, rank_name FROM members WHERE id = " . $id);
 
 
            $res = "\"" . $name . "\"";
            if (!empty($result[0][1]))
            $res = $result[0][1] . " " . $res;
            if (!empty($result[0][2]))
            $res .= " " . $result[0][2];
            $res .= " (Lvl " . $result[0][3] . " " . $result[0][4] . " " . $result[0][5] . ") logged on";
           
            $result = $this -> bot -> db -> select("SELECT message FROM logon WHERE id = " . $id);
            if (!empty($result))
            $res .= "  -  " . $result[0][0];
           
            $this -> bot -> send_gc("<font color=#10a5e5>" . $res . "</font>");
          $this -> last_log["on"][$name] = time();
          $this -> bot -> send_tell($name, $this -> get_news());  /*ADDED LINE */
            }
          }
          else
          {
          if ($this -> last_log["off"][$name] < (time() - 5))
          {
          $this -> bot -> send_gc("<font color=#10a5e5>" . $name . " logged off</font>");
          $this -> last_log["off"][$name] = time();
          }
          }
        }
      }
    }
Title: Re: Adding auto news to logon
Post by: Khalem on December 20, 2005, 10:08:28 pm
Use this one:
http://svn.shadow-realm.org/svn/BeBot/trunk/modules/LogonNotify_GUILD.php

Comment out the Online and Raids calls as you probably wont have Raids news module installed and might not want the online list spammed in tells on connect.
Title: Re: Adding auto news to logon
Post by: blofeld on August 04, 2006, 03:27:39 am
i know necro is bad  ;) but i'm interested in this as well and the link seems to be dead

thanks
Title: Re: Adding auto news to logon
Post by: mookie on August 04, 2006, 04:51:16 am
Recommend not changing Login.Guild.php.

Here is my modified version of Loginnotify_guild.php This sends the member your welcome message and then news, online and so on.

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)
        {
//$this -> bot -> send_tell($name, "Welcome to " . $this -> bot -> guildname . " " . $name);
$this -> bot -> commands["tell"]["online"] -> tell($name, "online");
$this -> bot -> commands["tell"]["news"] -> tell($name, "news");
$this -> bot -> commands["tell"]["raids"] -> tell($name, "raids");
$this -> bot -> commands["tell"]["ts"] -> tell($name, "TeamSpeak");
        }
      }
}
    }

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


  }
?>
Title: Re: Adding auto news to logon
Post by: Khalem on August 04, 2006, 06:37:41 am
Updated URL.
Title: Re: Adding auto news to logon
Post by: blofeld on August 04, 2006, 09:45:13 pm
Thanks a ton.  Worked great.  You all are prompt, correct, and generally awesome!
SimplePortal 2.3.7 © 2008-2025, SimplePortal