collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: A memberlist  (Read 12621 times)

0 Members and 2 Guests are viewing this topic.

Offline Shelnaria

  • BeBot Rookie
  • *
  • Posts: 17
  • Karma: +0/-0
A memberlist
« on: December 05, 2005, 04:23:56 am »
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.

Offline Handor

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: A memberlist
« Reply #1 on: December 15, 2005, 02:07:47 am »
  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.

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: A memberlist
« Reply #2 on: January 20, 2006, 10:58:20 am »
This one only works in tells, formatting is so so.. I don't really use it myself anymore.
Code: [Select]
<?
  /*
   * 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;
    }
  }
?>
Too many toons.

Offline Shelnaria

  • BeBot Rookie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: A memberlist
« Reply #3 on: February 11, 2006, 04:36:05 am »
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?


Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: A memberlist
« Reply #4 on: February 11, 2006, 05:53:11 am »
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: [Select]
<?
  /*
   * 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, 06:55:08 am by Wolfbiter »
Too many toons.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: A memberlist
« Reply #5 on: February 24, 2006, 11: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

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: A memberlist
« Reply #6 on: February 24, 2006, 04:24:29 pm »
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.
Too many toons.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: A memberlist
« Reply #7 on: March 15, 2006, 04:30:50 pm »
!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...

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: A memberlist
« Reply #8 on: March 15, 2006, 05:09:40 pm »
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 :P)

$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.
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, 05:13:52 pm »
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.

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: A memberlist
« Reply #10 on: March 15, 2006, 05:15:13 pm »
Unless I read that wrong.

Figured he wanted 'who' was online.

Same code can apply, $this -> useronline[$id]= $id; just replace with $buddycount++;
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: A memberlist
« Reply #11 on: June 22, 2006, 06:14:52 pm »
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-

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: A memberlist
« Reply #12 on: January 14, 2007, 03:01:22 pm »
Updated above, sorts properly now.

-jj-

Offline Zweiblum

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
Re: A memberlist
« Reply #13 on: August 14, 2008, 12:24:40 pm »
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, 04:10:07 pm by Zweiblum »

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 104
  • 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