BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Zorrna on February 26, 2011, 06:11:06 pm

Title: noob question ;) is it possible to get the online stat chars?
Post by: Zorrna on February 26, 2011, 06:11:06 pm
Hi

Is it possible to get the online state of any char on the server via bot?

I need it to make my Friendslist better to use that i can see on my list if the player is on or not

I´am working on this http://bebot.link/module-requests/alternative-friendslist-for-aoc/

by the way is it also possible to get the class of any char on my server?

LG


Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Drizzurdeen on February 26, 2011, 07:13:08 pm
try .... !is charname ... this would give u feedback if the char is online
!yg charname ... this would give u feddback of the yg profile of the char

hop i could help

drizz
Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Zorrna on February 26, 2011, 11:38:44 pm
i know th !is funktion but i want to use it in a script


Code: [Select]
function freund_liste($name)
{
//finde den mainchar von $name
$findmain = $this -> bot -> db -> select("SELECT main FROM alts WHERE alts.alt='$name'");
if (empty($findmain)) {$main=$name;}
else {$main = current($findmain[0]);}

//finde alle freunde und liste in scriptbox
$output ="<Center>##ao_infoheadline##:::: Freundesliste von $main und Twinks ::::##end##</Center>".$this->brfix(2);
$freunde = $this -> bot -> db -> select("SELECT * FROM  `#___friends` WHERE mainchar =  '$main'");
if (!empty($freunde)) {
foreach ($freunde as $aa) {
$fname = $aa[1];
$fdatum = $aa[2];
$fnotiz = $aa[3];
$output .= "##Lime##$fname##end##    $fdatum    $fnotiz".$this->brfix();
}
}
$output = $this -> bot -> core("tools") -> make_blob("Freundesliste f?r $main", $output);
return $output;
}

u see i make a list with my buddy´s and make a blob to show it but i want to check if the char wit the name $fname is online if not i don´t add him to the list can i use !is for this?

Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Drizzurdeen on February 27, 2011, 08:49:06 am
i think so .... just try and error ;) .... on our bot the !is funktion works with no botmembers either
Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Runemy on February 27, 2011, 04:09:46 pm
If you get your friends added to the bot somehow, perhaps as guests, then I suppose you could use this sniplet to some extent? (It's from the guildinfo.php mod (http://bebot.link/aoc-modules/guild-recruitment/msg12417/#msg12417))

Code: [Select]
$online = $this -> bot -> core("online") -> get_online_state('Wood');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Wood Im interested in joining Exalted'>Wood</a> - Guild leader##end##\n";

I don't know how you could implement it fully to your use, but it might be a clue.
Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Kentarii on March 01, 2011, 11:32:21 am
Here's what I've used for a module of mine:
Code: [Select]
$online_users = $this -> bot -> core('online') -> list_users('gc');

Do some looping of your friends list and get the $char_name somehow, then do:
Code: [Select]
$output .= sprintf("##%s##%s##end##\n", (in_array($char_name, $online_users) ? 'green' : 'red'), $char_name);
Online users will be green, offline will be red.

As for class, you will either have to check your whois table or use yg functionality.

Edit: list_users('gc') might just list online guild members though... so it might be better to check the online status in the whois table.
Title: Re: noob question ;) is it possible to get the online stat chars?
Post by: Zorrna on March 07, 2011, 05:26:11 pm
okay with the
Code: [Select]
$this -> bot ->core("whois") -> lookup($user);
i become the online state for each user but it isn`t up to date (only bot members will be updated) a user not in guildbot as member will be shown as online long after they will be loged out. (testet it with a second testbot of me)

now how i can force a update of the whois table?

LG



SimplePortal 2.3.7 © 2008-2024, SimplePortal