Development > Coding and development discussion

noob question ;) is it possible to get the online stat chars?

<< < (2/2)

Kentarii:
Here's what I've used for a module of mine:

--- Code: ---$online_users = $this -> bot -> core('online') -> list_users('gc');

--- End code ---

Do some looping of your friends list and get the $char_name somehow, then do:

--- Code: ---$output .= sprintf("##%s##%s##end##\n", (in_array($char_name, $online_users) ? 'green' : 'red'), $char_name);

--- End code ---
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.

Zorrna:
okay with the

--- Code: ---$this -> bot ->core("whois") -> lookup($user);
--- End code ---

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



Navigation

[0] Message Index

[*] Previous page

Go to full version