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: help with org name from player id  (Read 2903 times)

0 Members and 1 Guest are viewing this topic.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
help with org name from player id
« on: January 25, 2010, 05:00:14 am »
working on coding a module to relay alliance members online to a webserver, and have a slight issue with dealing with members that are in the pg. sample of the code is as follows:
Code: [Select]
if ($this -> bot -> core("notify") -> check($name))
{
$botname = $this -> bot -> botname;
$online = $this -> bot -> db -> select("SELECT t1.nickname, t2.level, org_rank, org_name, profession FROM "
. "#___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc=1 "
. "AND botname='".$botname."' ORDER BY profession ASC, t1.nickname ASC");

foreach ($online as $player)
{
$alname .= "|" . $player[0];
$allevel .= "|" . $player[1];
$alprof .= "|" . $player[4];
$alorg .= "|" . $this -> bot -> guildname;
$alrank .= "|" . $player[2];
}

my problem is if the player is in the pg, it is reading their rank and applying it to the guildname of the bot. Of course this doesn't work if the bot in question is a raid bot, as there is no guildid. Is there a way of getting the guild information out of the player itself and what would that be?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: help with org name from player id
« Reply #1 on: January 26, 2010, 11:43:21 pm »
Isn't there the guildname/org_name in the whois table too?

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: help with org name from player id
« Reply #2 on: January 27, 2010, 01:06:53 am »
yes there is alreadythere, unfortunately, I can only mess up code. I am not sure how I would go about implimenting it into my example above. I thought there might be something attached to the $player
  • tage and that maybe [3] would be what I need. After looking through the files to figure out where that was from,  and coming up empty, I'm no better off than when I started, which is why I am here. I am still learning php and sql hooks and can say most of my courseload has been doing the bots.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: help with org name from player id
« Reply #3 on: January 27, 2010, 11:45:10 pm »
It should be [3] according to your query, yes. If it's empty then it's most likely empty on the table too.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: help with org name from player id
« Reply #4 on: January 28, 2010, 01:57:01 am »
still have one org that isn't showing up and not sure why on that...will work it out later, for the most part it should be working now

 

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