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: Logon info  (Read 2342 times)

0 Members and 1 Guest are viewing this topic.

Offline bmoscato

  • BeBot User
  • **
  • Posts: 51
  • Karma: +0/-0
Logon info
« on: January 30, 2007, 09:52:19 pm »
I'm currently using JJ's Logon_Guild.php.  When I member logs on I see:

[Exodus] Exobot2: "Kattemp" (Lvl 56 Meta-Physicist Applicant) logged on.

I would like to add the AI level and to this to look something like:

[Exodus] Exobot2: "Kattemp" (Level 56/0 - None, Female Solitus Meta-Physicist, Applicant of Exodus) logged on.

Has anyone done this?

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: Logon info
« Reply #1 on: January 30, 2007, 10:03:21 pm »
Yes, I have.

The code below will not work unless your member table has the same fields as the one I have listed. 

For this code I pull out of table members:
nickname, firstname, lastname, level, profession, rank_name, ailevel, aititle 

Check your roster or whatever php file creates and modifies your member table to make sure it has the ai fields.  It should but check anyways. 

This code also changes the default color of the login logoff messages and sends to both GC and pgroup. (our pgroup is our guest channel and thus they should see everything that goes on in gc. You can edit this out if you want.)


Code: [Select]
/*
This gets called if a buddy logs on/off
*/
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, ailevel, aititle  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][6] . " (" . $result[0][7] . ") " . $result[0][4] . " " . $result[0][5] . ") logged on.";

$main = $this -> bot -> alts -> main($name);
$alts = $this -> bot -> alts -> get_alts($main);

if (!empty($alts))
{
$altsresult = " ";
$altsresult .= $this -> bot -> alts -> make_alt_blob($main, $alts);
}
else
$altsresult = "";

$res .= $altsresult;

$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=#66FFFF>" . $res . "</font>");
$this -> bot -> send_pgroup("<font color=#66FFFF>" . $res . "</font>");

if ($this -> bot -> guild_relay_target)
{
$tell = "<pre>gcr [" . $this -> bot -> guildname . "] <font color=#66FFFF>" . $res . "</font>";
$target = strtolower($this -> bot -> guild_relay_target);
$this -> bot -> send_tell($target, $tell, 0, false);
}
$this -> last_log["on"][$name] = time();
}
}
else
{
if ($this -> last_log["off"][$name] < (time() - 5))
{
$this -> bot -> send_gc("<font color=#66FFFF>" . $name . " logged off</font>");
$this -> bot -> send_pgroup("<font color=#66FFFF>" . $name . " logged off</font>");

$this -> last_log["off"][$name] = time();

if ($this -> bot -> guild_relay_target)
{
$tell = "<pre>gcr [" . $this -> bot -> guildname . "] " . $this -> bot -> botname . ": <font color=#66FFFF>" . $name . " logged off</font>";
$target = strtolower($this -> bot -> guild_relay_target);
$this -> bot -> send_tell($target, $tell, 0, false);
}

}
}
}
}
}
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline bmoscato

  • BeBot User
  • **
  • Posts: 51
  • Karma: +0/-0
Re: Logon info
« Reply #2 on: January 31, 2007, 12:01:00 am »
Hey Nebhyper, thanks that worked.

Is there a way to use multiple colors?  Like make the AI level appear green instead of blue.

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Logon info
« Reply #3 on: January 31, 2007, 12:43:15 am »
Hmm, this is most strange.  Here's the output from my logon_guild module (this has changed alts and blacklist settings from the standard bebot module)...

-jj-

Uprnet: Gimmeh "Litespeeeed" Now (Lvl 217 / 13 (Adept) Fixer Member) logged on. View Lilshooter's Alts  ::  You hit Culuth-Len for 6153 points of Burst damage.

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: Logon info
« Reply #4 on: January 31, 2007, 03:10:28 am »
With the code above I get this when I logon:

Ivana "Siocuffin" Urhans (Lvl 210 / 18 (Trustworthy) Agent Squad Commander) logged on. View Siocuffin's Alts  ::  Muhandes: You might want to be more careful with !logon material


As for colors, sure.

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, ailevel, aititle  FROM members WHERE id = " . $id);

$res = "<font color=#66FFFF>\"" . $name . "\"</font>";
//$res = "<font color=#66FFFF>" . $res . "</font>";
if (!empty($result[0][1]))
$res = "<font color=#66FFFF>" . $result[0][1] . " " . $res . "</font>";
if (!empty($result[0][2]))
$res .= " " . $result[0][2];
$res .= "<font color=#66FFFF> (Lvl " . $result[0][3] . " / </font><font color=#33cc33>" . $result[0][6] . "</font><font color=#66FFFF> (</font><font color=#33cc33>" . $result[0][7] . "</font><font color=#66FFFF>) " . $result[0][4] . " " . $result[0][5] . ") logged on.</font>";

$main = $this -> bot -> alts -> main($name);
$alts = $this -> bot -> alts -> get_alts($main);

if (!empty($alts))
{
$altsresult = " ";
$altsresult .= $this -> bot -> alts -> make_alt_blob($main, $alts);
}
else
$altsresult = "";

$res .= $altsresult;

$result = $this -> bot -> db -> select("SELECT message FROM logon WHERE id = " . $id);
if (!empty($result))
$res .= "<font color=#66FFFF>  ::  " . $result[0][0] . "</font>";

$this -> bot -> send_gc($res);
$this -> bot -> send_pgroup($res);

if ($this -> bot -> guild_relay_target)
{
$tell = "<pre>gcr [" . $this -> bot -> guildname . "] <font color=#66FFFF>" . $res . "</font>";
$target = strtolower($this -> bot -> guild_relay_target);
$this -> bot -> send_tell($target, $tell, 0, false);
}
$this -> last_log["on"][$name] = time();
}
}
else
{
if ($this -> last_log["off"][$name] < (time() - 3))
{
$this -> bot -> send_gc("<font color=#66FFFF>" . $name . " logged off</font>");
$this -> bot -> send_pgroup("<font color=#66FFFF>" . $name . " logged off</font>");

$this -> last_log["off"][$name] = time();

if ($this -> bot -> guild_relay_target)
{
$tell = "<pre>gcr [" . $this -> bot -> guildname . "] " . $this -> bot -> botname . ": <font color=#66FFFF>" . $name . " logged off</font>";
$target = strtolower($this -> bot -> guild_relay_target);
$this -> bot -> send_tell($target, $tell, 0, false);
}

}
}
}
}
}


That should give you what you want.
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline bmoscato

  • BeBot User
  • **
  • Posts: 51
  • Karma: +0/-0
Re: Logon info
« Reply #5 on: January 31, 2007, 04:36:31 am »
Thanks again Nebhyper that was exactly what I was looking for.

Bryan

 

* 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: 269
  • 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