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

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

Author Topic: Adding auto news to logon  (Read 2332 times)

0 Members and 1 Guest are viewing this topic.

Offline Lyledesol

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Adding auto news to logon
« 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();
          }
          }
        }
      }
    }

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Adding auto news to logon
« Reply #1 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.
« Last Edit: August 04, 2006, 06:37:31 am by Khalem »
BeBot Founder and Fixer Kingpin

Offline blofeld

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Adding auto news to logon
« Reply #2 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

Offline mookie

  • BeBot User
  • **
  • Posts: 27
  • Karma: +0/-0
Re: Adding auto news to logon
« Reply #3 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;
    }


  }
?>

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Adding auto news to logon
« Reply #4 on: August 04, 2006, 06:37:41 am »
Updated URL.
BeBot Founder and Fixer Kingpin

Offline blofeld

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Adding auto news to logon
« Reply #5 on: August 04, 2006, 09:45:13 pm »
Thanks a ton.  Worked great.  You all are prompt, correct, and generally awesome!

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 125
  • 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