BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Naturalistic on September 26, 2005, 09:35:14 am

Title: New Modules
Post by: Naturalistic on September 26, 2005, 09:35:14 am
Decided to work on a few modules myself. Kill some time.

A bit early, just posting what I'm working on.

Currently on:
- Add users to a raid currently in progress even when it's locked.
- Adding a !memberslist to display current members of the bot
- Adding minor fix to !online, to display bot admins.

Will post links to the code once I fully have them done and 100% bug free =)

Stay tuned for now.
Title: Re: New Modules
Post by: Zacix on September 26, 2005, 03:06:12 pm
Quote from: "Naturalistic"

- Add users to a raid currently in progress even when it's locked.


Wouldn't that kinda beat the purpose of the lock command?

Quote from: "Naturalistic"

- Adding a !memberslist to display current members of the bot


Be aware that if you have a open bot, this memberslist will grow huge over time.

Quote from: "Naturalistic"

- Adding minor fix to !online, to display bot admins.


If you just want to display the admins, try /tell <yourbot> !admin group. Should be easy to just alter the file admin.php if you want to display who's online, offline and online and in bot.

Welcome to the bebot coding community :)
Title: Re: New Modules
Post by: Khalem on September 27, 2005, 09:03:41 am
Quote from: "Zacix"
Quote from: "Naturalistic"

- Add users to a raid currently in progress even when it's locked.


Wouldn't that kinda beat the purpose of the lock command?


This is a good change actually.

It will allow raid admins to readd a person to the raid without having to unlock the raid, have the person join, relock the raid, and then deal with the morons who joined in addition.
Title: New Modules
Post by: Naturalistic on September 28, 2005, 08:17:00 am
Never said they were uber-awesome updates. Just some extra options.

And the adding users to a raid... Khalem said exactly why I'm adding it :)

!memberlist will only be done by admins/raid leaders for the purpose of cutting down lag.

But I appreciate your ideas, Zacix. :)

Anything else that could require more attention, I'd be happy to look at first. ;)
Title: Re: New Modules
Post by: ZubZero on January 18, 2006, 12:32:07 am
When will the memberslist module be done?

I also hope that you can filter the !memberslist like you do with !online (ex. !online doc)

Looking forward to this module :)
Title: Re: New Modules
Post by: Naturalistic on January 19, 2006, 12:19:44 am
Ah, that's done actually, just totally forgot to post.

Didn't even remember I made this thread... :-X
Title: Re: New Modules
Post by: ZubZero on January 19, 2006, 01:16:58 am
cool, does it have a function to show if they are online or not?
Title: Re: New Modules
Post by: Wolfbiter on January 19, 2006, 12:06:14 pm
I have a memberlist done, but no filters and not really formated (left such borign crap to natu). It's also raidbot-oriented... but should be easy to modify to suit your needs (I have no futher plan of developing it).

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;
    }
  }
?>
Title: Re: New Modules
Post by: stonybg on February 19, 2006, 12:02:18 am
have 2 coments on code

1. blobs not work
2 Bot go in circle
Quote
[ bot]: 250 Members (page 2 of 2) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 1 of 3)
[bot]: 250 Members (page 2 of 2) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 1 of 3)
[bot]: 250 Members (page 2 of 2) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 1 of 3)
[bot]: 250 Members (page 2 of 2) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 2 of 3) (page 1 of 3)
Title: Re: New Modules
Post by: MatHack on February 19, 2006, 12:31:30 am
the page-spam: http://bebot.link/index.php/topic,38.0.html
Title: Re: New Modules
Post by: stonybg on February 19, 2006, 01:07:45 am
stil have same replay
Title: Re: New Modules
Post by: Wolfbiter on February 19, 2006, 07:12:54 am
Use this (http://bebot.link/index.php/topic,234.0.html) fix instead.
Title: Re: New Modules
Post by: stonybg on February 19, 2006, 12:37:56 pm
ty for the help :D now work korekt
humm will be perfect if can add funltion for online status
Title: Re: New Modules
Post by: Heffalomp on July 15, 2007, 02:01:07 pm
anny quick fixes to get this to work on v0.2.11?
SimplePortal 2.3.7 © 2008-2024, SimplePortal