L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 02:11:58 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Module Requests > Topic: A memberlist
Pages: [1]   Go Down
« previous next »
Print
Author Topic: A memberlist  (Read 1719 times)
0 Members and 1 Guest are viewing this topic.
Shelnaria
Freshman
*
Offline Offline

Posts: 17


A memberlist
« on: December 04, 2005, 10:23:56 PM »

I have and use the !memberlist which shows the amount of people on the bot but would truly like to see a module that has a listing similiar to !online that shows all the org members. Perhaps keep it to member or admin only usage to prevent severe slowdowns on the bot. It only seems logical that the bot can do this as it can tell who is online and also has a record for the org for who is and is not a member in the sql tables. I am still learning php so its a bit beyond me to tackle at this time.
Logged
Handor
Freshman
*
Offline Offline

Posts: 10


Re: A memberlist
« Reply #1 on: December 14, 2005, 08:07:47 PM »

  Hello,
 I would like to see a !members command module for Bebot aswell, similar to IGN's. Just a list of org members, and their lvls. IF some one could make this it would be extremely appreciated in the AO community.

Thank You.
Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: A memberlist
« Reply #2 on: January 20, 2006, 04:58:20 AM »

This one only works in tells, formatting is so so.. I don't really use it myself anymore.
Code:
<?
  /*
   * Something written by wolfbiter
   */
   
  $ml = new memberList($bot);

  $commands["tell"]["memberlist"] = &$ml;

  class memberList {
    var $bot;
    var $online;
    function memberList (&$bot) {$this->bot = &$bot;}
    function tell($name, $msg) {
        $admin = $this->bot->admin->in_group($name, "admin");
        $leader = $this->bot->admin->in_group($name, "raidleader");
        if ($admin || $leader) {$this -> bot -> send_tell($name, $this -> list_members($name,$msg));}
    }
    function list_members($name,$msg) {
        unset($admins,$leaders,$members);
        $text = explode(" ",$msg);
        if ($text[1] == "org" || $text[1] == "guild") {$sql="select nickname,profession,level,guild from members order by 'guild','nickname','profession','level' asc";}
        elseif ($text[1] == "prof" || $text[1] == "profession") { $sql="select nickname,profession,level,guild from members order by 'profession','nickname','level','guild' asc";}
        elseif ($text[1] == "level") {$sql="select nickname,profession,level,guild from members order by 'level','profession','nickname','guild' ASC";}
        else {$sql="select nickname,profession,level,guild from members order by 'nickname','profession','level','guild' asc";}
        $rawlist = $this->bot->db->select($sql);
        $memberstot = count($rawlist);
        foreach ($rawlist as $member) {
            $name = $member[0];
            $namelist[$name]['level'] = $member[2];
            $namelist[$name]['org'] = $member[3];
            $namelist[$name]['prof'] = $member[1];
            $admin = $this->bot->admin->in_group($name, "admin");
            $leader = $this->bot->admin->in_group($name, "raidleader");
            if ($admin) {$admins[] = $name;}
            elseif ($leader) {$leaders[] = $name;}
            else {$members[] = $name;}
        }
$output= "<font color=#FFFF66>Order by [ <a href='chatcmd:///tell <botname> !memberlist'>Name</a> ] [ <a href='chatcmd:///tell <botname> !memberlist level'>Level</a> ] [ <a href='chatcmd:///tell <botname> !memberlist prof'>Profession</a> ] [ <a href='chatcmd:///tell <botname> !memberlist org'>Org</a> ]<br><br>";
    if (count($admins) > 0) {
        $output.='<font color=#99CCCC>[<u>Admins</u>]';
    foreach($admins as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC> (".$namelist[$cur]['org'].")";}
}
if (count($leaders) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Leaders</u>]';
    foreach($leaders as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC> (".$namelist[$cur]['org'].")";}
}
if (count($members) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Members</u>]';
    foreach($members as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC> (".$namelist[$cur]['org'].")";}
}
$return = $this->bot->make_blob($memberstot." Members",$output);
return $return;
    }
  }
?>
Logged

220 Doctor | 220 Adventurer | 220 Shade
Shelnaria
Freshman
*
Offline Offline

Posts: 17


Re: A memberlist
« Reply #3 on: February 10, 2006, 10:36:05 PM »

It looks good but when I try to use this I am getting Warning: Invalid argument supplied for foreach() in C:\Bebot\modules\memberlist.
php on line 28

Any advice?

Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: A memberlist
« Reply #4 on: February 10, 2006, 11:53:11 PM »

When I wrote it, I assumed the query would never be empty, so there's no check for that.
the whole foreach{} must have "if (!empty($rawlist)) {}" around it.

I'd like to point out that this script was made for raidbot, not orgbot.

Code for orgbot is below
Code:
<?
  /*
   * Something written by wolfbiter
   */
   
  $ml = new memberList($bot);

  $commands["tell"]["memberlist"] = &$ml;

  class memberList {
    var $bot;
    var $online;
    function memberList (&$bot) {$this->bot = &$bot;}
    function tell($name,$msg) {$this->bot->send_tell($name,$this->list_members($name,$msg));}
    function list_members($name,$msg) {
        unset($admins,$leaders,$members);
        $text = explode(" ",$msg);
        if ($text[1] == "prof" || $text[1] == "profession") { $sql="select nickname,profession,level from members order by 'profession','nickname','level' asc";}
        elseif ($text[1] == "level") {$sql="select nickname,profession,level from members order by 'level','profession','nickname' ASC";}
        else {$sql="select nickname,profession,level from members order by 'nickname','profession','level' asc";}
        $rawlist = $this->bot->db->select($sql);
        $memberstot = count($rawlist);
        foreach ($rawlist as $member) {
            $name = $member[0];
            $namelist[$name]['level'] = $member[2];
            $namelist[$name]['prof'] = $member[1];
            $admin = $this->bot->admin->in_group($name, "admin");
            $leader = $this->bot->admin->in_group($name, "raidleader");
            if ($admin) {$admins[] = $name;}
            elseif ($leader) {$leaders[] = $name;}
            else {$members[] = $name;}
        }
$output= "<font color=#FFFF66>Order by [ <a href='chatcmd:///tell <botname> !memberlist'>Name</a> ] [ <a href='chatcmd:///tell <botname> !memberlist level'>Level</a> ] [ <a href='chatcmd:///tell <botname> !memberlist prof'>Profession</a> ]<br><br>";
    if (count($admins) > 0) {
        $output.='<font color=#99CCCC>[<u>Admins</u>]';
    foreach($admins as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
if (count($leaders) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Leaders</u>]';
    foreach($leaders as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
if (count($members) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Members</u>]';
    foreach($members as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
$return = $this->bot->make_blob($memberstot." Members",$output);
return $return;
    }
  }
?>
« Last Edit: February 11, 2006, 12:55:08 AM by Wolfbiter » Logged

220 Doctor | 220 Adventurer | 220 Shade
stonybg
Rookie
**
Offline Offline

Posts: 23


Re: A memberlist
« Reply #5 on: February 24, 2006, 05:07:37 AM »

Wolfbiter can you add function to show in same blob with members lis who its online and who its not ?
bebot its instal for orgbot but have addet many members from other bots and will be greed if can see how much members its online (all with this one neot joinet in chanel) and how its online and who not.
tanky
Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: A memberlist
« Reply #6 on: February 24, 2006, 10:24:29 AM »

It's not meant to be used for online, it's so you can check the users on the bot. There's an !online command, use that instead.
Logged

220 Doctor | 220 Adventurer | 220 Shade
stonybg
Rookie
**
Offline Offline

Posts: 23


Re: A memberlist
« Reply #7 on: March 15, 2006, 10:30:50 AM »

!online comad show me only online player in bot not how much members total its online, example i wana strart raid but dont know how much total members its online in bot and for that need start raid, to see how much will join in bot  and if dont have minimum come...
Logged
Naturalistic
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 221


Re: A memberlist
« Reply #8 on: March 15, 2006, 11:09:40 AM »

You need to basically code that in. Here's just an idea (and don't copy/paste, because you need to do some work to get the whole thing working Tongue)

$buddylist = $this->bot->aoc->buddies;
foreach ($buddylist as $id => $crap)
{
  if ($this->bot->aoc->buddy_online($id))
  {
    $this -> useronline[$id]= $id;
  }
}...

Then just display $this -> useronline[$id]

This will only work properly if the buddylist is less than 1000 remember.
Logged

220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php
MatHack
Guest
Re: A memberlist
« Reply #9 on: March 15, 2006, 11:13:52 AM »

Assuming this is a raidbot, you gotta adjust core/Online.php and add some command that will return:

count($this -> pgroup)

That would give you the number of people in your privategroup.
Logged
Naturalistic
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 221


Re: A memberlist
« Reply #10 on: March 15, 2006, 11:15:13 AM »

Unless I read that wrong.

Figured he wanted 'who' was online.

Same code can apply, $this -> useronline[$id]= $id; just replace with $buddycount++;
Logged

220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: A memberlist
« Reply #11 on: June 22, 2006, 11:14:52 AM »

http://www.jjones.co.uk/files/memberlist.php

Needed a good way to clean up the roster on the org, so added a few things to Wolfbiter's script - org rank (to see who needed promoting), last seen time (to see who needed kicking) and a button to retrieve the toon's alts (no make sure all alts were registered to main).

N.B. Obviously, u need Xen's excellent rooster_guild for the last seen time to work (and I also use his modified !alts commands).

One small problem, the last person in list doesn't seem to process the lastseen time properly, if anyone knows how to fix that, I would be grateful =)

Cheers,

-jj-
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: A memberlist
« Reply #12 on: January 14, 2007, 09:01:22 AM »

Updated above, sorts properly now.

-jj-
Logged
Zweiblum
Rookie
**
Offline Offline

Posts: 58


Re: A memberlist
« Reply #13 on: August 14, 2008, 05:24:40 AM »

anyway to get this for bebot 0.5.2 ?

and a !adminlist maybe thats just lists admins and leader of the bot
« Last Edit: August 14, 2008, 09:10:07 AM by Zweiblum » Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Module Requests > Topic: A memberlist
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 0
Guests: 19
Total: 19

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.183 seconds with 28 queries. (Pretty URLs adds 0.034s, 4q)
Loading...